# Sentence Reading (RSVP) — MEG

MEG sentence-reading RSVP task investigating neural responses to ambiguous
(colexified) sentence processing in native and non-native French speakers.

Participants silently read French sentences presented word-by-word at 500 ms/word.
Sentences contain ambiguous or control words in resolved or unresolved contexts.
On catch trials (7.5%) a probe word appears and participants judge whether it is
related or unrelated to the sentence.

## Requirements

- Python ≥ 3.9
- PsychoPy **2025.1.1** (pinned — other versions may break parallel-port timing
  and RSVP scheduling; see `requirements.txt`)
- A parallel port for MEG triggers (optional — the script still runs without one
  and prints to the console instead)

## Install

```bash
git clone <this-repo>
cd colex-sentence-reading-meg
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt
```

On Linux, you may also need system libraries for the PsychoPy audio/graphics
backends (`libportaudio2`, `libasound2-dev`, `libgl1-mesa-glx`, `libsdl2-2.0-0`).

## Run

```bash
python code_RSVP_MEG.py                        # RSVP at sentence onset
python code_RSVP_MEG_wordbywordtriggers.py     # RSVP with per-word triggers
```

A dialog asks for the participant ID; output CSV is written to `data/`.

## Inputs

The scripts read sentences from `experimental_trials_listA.xlsx` or
`experimental_trials_listB.xlsx` (chosen at the dialog). Required columns:
`sentences`, `catch_trial`, `probe_word`, `probe-relation`.

## Files

```
code_RSVP_MEG.py                    # main RSVP script (trigger at sentence onset)
code_RSVP_MEG_wordbywordtriggers.py # variant with per-word triggers
experimental_trials_listA.xlsx      # trial list A
experimental_trials_listB.xlsx      # trial list B
stimuli_ListA.xlsx                  # stimulus pool A
stimuli_ListB.xlsx                  # stimulus pool B
exp2_stimuli.xlsx                   # aggregated stimulus metadata
requirements.txt                    # pinned dependencies
task.json                           # library metadata
```

## Contact

Abigail Licata — <abigail.licata@unige.ch>
