PsychoPy script for an active auditory oddball paradigm in the Scully OPM-MEG facility. Based on the FieldTrip cued oddball paradigm.
Bimanual left/right index-finger responses, 3 blocks × 100 trials (~51 minutes), continuous EyeLink recording, VPIXX pixel-mode triggers, and hardware-scheduled VPIXX audio.
+-----------+-----+-----------------+---------+----------+-------+
| fixation | cue | auditory stim | resp. | feedback | BLINK |
| 1500 ms |500ms| 4000-8800 ms | 1000 ms | 400 ms | 500 ms|
| + | >+> | tones + oddball | + | (errors | |
| | or | | | only) | |
| | <+< | | | | |
+-----------+-----+-----------------+---------+----------+-------+
The subject sees an arrow cue directing them to prepare a left- or right-hand response, hears 3–7 standard tones (1000 Hz) followed by one deviant tone (1200 Hz), and presses the index-finger button on the cued hand as quickly as possible.
oddball_active_cued_ft_VPIXXaudio_KBDinput.py— main scriptEyeLinkCoreGraphicsPsychoPy.py— renders EyeLink calibration graphics inside PsychoPy*.wav— sound files used by EyeLink for calibration / target beeps
Software:
- PsychoPy 2026.1+
- pypixxlib (VPIXX)
- pylink (SR Research)
For Windows setup, an installer script that installs PsychoPy and the required dependencies is available at ScullyCenter-Psychopy-Install-Win.
Hardware:
- VPixx DATAPixx3 + SOUNDPixx + PROPixx
- SR Research EyeLink
- HID-keyboard button box (e.g. Current Designs)
Most common way: open the .py file in the PsychoPy Coder window and click Run.
Alternative for users with PsychoPy installed in a conda environment:
python oddball_active_cued_ft_VPIXXaudio_KBDinput.pyEither way, a startup dialog asks for participant ID, session number, and two dummy-mode checkboxes:
dummy_eyelink— run without EyeLink Host PC. Auto-forced on ifpylinkisn't installed.dummy_vpixx— run without a DATAPixx3. Audio falls back to PsychoPy sound (audible but not vsync-locked), and*_vp/*_vp_estcolumns in the output CSVs are left blank. Auto-forced on ifpypixxlibisn't installed.
A clean laptop with only PsychoPy installed can still run the paradigm end-to-end for demo or development purposes.
- VPIXX device on and reachable (
DPxOpensucceeds), or checkdummy_vpixx - VPIXX running Pixel Mode B (the script enables it)
- Audio wired to the desired path (headphones or loudspeakers) at audible volume
- Button box emitting keyboard events; update
KEY_CODESin the script to match your box - Button box TTL trigger output wired into the MEG trigger channel
- EyeLink Host PC at 100.1.1.1, or check
dummy_eyelink - Audio transit delay measured (microphone at earpiece); record for latency correction in analysis
Written to results/sub-<p>_ses-<s>_task-oddballftcued/:
..._trials.csv— one row per trial (main behavioral log)..._tones.csv— one row per tone with per-tone VPIXX timestamps..._presses.csv— one row per keyboard event (all presses, not just scored responses)....EDF— EyeLink data downloaded from the Host PC at session end
CSVs are flushed at the end of every block, so a crash mid-run doesn't lose completed blocks.
Timestamp columns are suffixed by clock provenance:
_pp— PsychoPy default clock (behavioral RT reference)_vp— VPIXX DATAPixx3 hardware clock (MEG alignment reference)_vp_est— Estimated VPIXX-clock time for events VPIXX didn't directly detect (keyboard presses). Accurate to within ~one video frame; use the button box's TTL wiring into the MEG trigger channel as the definitive response reference.
The module docstring at the top of oddball_active_cued_ft_VPIXXaudio_KBDinput.py covers everything not in this README: audio scheduling and vsync locking, trigger scheme, trigger vs. perceived-stimulus timing corrections, keyboard input caveats, response scoring rules, and block structure. Read there for extending or debugging the script.