Goxpyriment Example Experiments¶
Pre-built executable programs for all examples.
If you want to compile these experiments from source on your computer, e.g. because you have Windows/ARM or macOS/Intel, read on.
Building from source¶
If Go is installed, you can run any example directly from a clone of the repository:
Or build and run from inside the example directory:
cd examples/hello_world
go run . # fullscreen by default
go run . -w # windowed 1024×768
go run . -w -s 1 # windowed, subject ID = 1
go run . -d 1 # fullscreen on monitor 1
go run . -w -d 1 # windowed on monitor 1
go build . # build a standalone binary
To build all examples (and tests) at once (binaries go to _build/):
(On Linux/macOS you can also use make examples or make all.)
Programs that open a GetParticipantInfo dialog collect all setup interactively (subject ID, monitor dimensions, fullscreen toggle, and any experiment-specific options). Pass -headless on the command line to skip the dialog and use field defaults — useful for scripted runs and automated testing. Programs that do not use the dialog still accept -w for windowed mode, -d N to select a monitor, and -s <id> for a subject ID.
Psychological Experiments¶
Full experiments that record and save behavioural data to an .csv file in goxpy_data/.
| Directory | Task | Reference |
|---|---|---|
| Attention-Posner-Task | Arrow cue directs covert attention; measure cost/benefit on reaction time to a peripheral target | Posner (1980) |
| Attentional-Blink | RSVP stream; participant detects two targets embedded in a stream of distractors — the second target is often missed within ~500 ms of the first | Raymond et al. (1992) |
| Change-Blindness | Flicker paradigm: alternating original and modified scenes separated by blanks; participant detects what changed | Rensink et al. (1997) |
| Classification-Posner-Mitchell | Classify letter pairs at three levels (physical, name, rule identity); RT increases with depth of processing required | Posner & Mitchell (1967) |
| Contrast-Detection-QUEST | 2-IFC adaptive staircase estimating the contrast detection threshold for a Gabor patch; converges on the 82 % correct point | Watson & Pelli (1983) |
| Finger-Tapping | Patterned finger-tapping: memorise a key sequence then reproduce it 6 times consecutively as fast as possible; only error-free runs recorded | Povel & Collard (1982) |
| Go-NoGo | Stop-signal task: respond to letters on go-trials; withhold response when a stop-signal tone is played at variable delays | Logan et al. (1984) |
| Hemispheric-differences-word-processing | Lateralised recognition memory: words studied in LVF or RVF, tested centrally with old/new judgements | Federmeier & Benjamin (2005) |
| Letter-size-illusion | Compare heights of letters vs. mirror/pseudo-letters; replicates the letter height superiority illusion (two experiments) | New et al. (2015) |
| lexical_decision | Decide whether a letter string is a word or a non-word (F / J keys); stimuli loaded from a CSV file | |
| LoT-geometry | Comprehension of geometric primitives and rules; reproduces Amalric et al. (2017) | Amalric et al. (2017) |
| Magnitude-Estimation-Luminosity | Stevens' magnitude estimation of luminance: assign a number to perceived brightness of grey disks | Stevens (1957) |
| Memory-for-binary-sequences | Memory and reproduction of auditory binary sequences of varying complexity | Planton et al. (2021) |
| Memory-Iconic-Sperling | Partial-report procedure measuring capacity and duration of iconic (visual sensory) memory | Sperling (1960) |
| Memory-Scanning | Hold a set of digits in memory; decide whether a probe was in the set — RT scales with set size | Sternberg (1966) |
| Memory_span | Adaptive staircase measuring immediate serial recall span for digits, letters, or words | |
| Mental-Logic-Card-Game | Mental logic and inference task using a card-game paradigm | |
| Mental-Rotation-2D | Decide whether two 3-D figures are identical or mirror images; RT increases linearly with angular disparity | Shepard & Metzler (1971) |
| Mental-Rotation-3D | Decide whether two 3D figures (procedurally generated assemblies of cubes) are identical or mirror images; RT increases linearly with angular disparity. | Shepard & Metzler (1971) |
| Mouse-tracking | Mouse-trajectory paradigm: click the image matching a spoken-onset target while the cursor path is sampled at ~36 Hz, revealing continuous attraction toward phonological competitors | Spivey et al. (2005) |
| Multiple-Object-Tracking | Track a subset of identical moving targets among distractors; evidence for a parallel tracking mechanism | Pylyshyn & Storm (1988) |
| Number-Change-Detection | Two concurrent dot-array streams (5 vs 20 dots) test infants' preference for numerosity change; experimenter codes looking direction in real time | Decarli, Piazza & Izard (2023) |
| Number-Comparison | Compare numerical magnitudes of digits and dot patterns; stimulus group (digits / regular / irregular / random) selected via GetParticipantInfo UI | Buckley & Gillman (1974) |
| Number-Double-Digits-Comparison | Compare two-digit numbers against a fixed standard (55 or 65); two experiments with different response-key mappings | Dehaene et al. (1990) |
| parity_decision | Classify single digits (0–9) as even or odd (F / J keys) | |
| Perception-of-Temporal-Patterns | Reproduction of isochronous and non-isochronous rhythmic patterns; tests internal clock induction and coding complexity | Povel & Essens (1985) |
| picture_naming | Vocal naming-latency task: a picture is named aloud while a microphone voice key measures RT from image onset; per-trial WAV files are saved for offline verification | |
| Posner-ANT | Attention Network Task (vertical variant): flanker arrows above/below fixation measure alerting, orienting, and executive attention networks | Fan et al. (2009) |
| Psychological-Refractory-Period | Two tasks presented in rapid succession; the second response is delayed when the SOA is short | Welford (1952) |
| Retinotopy | HCP retinotopic mapping paradigm (ported from Python); flickering wedge/ring/bar stimuli for visual cortex mapping; run type selected via GetParticipantInfo UI | |
| Sensory-Threshold-Estimation-Auditory | 1-up/2-down adaptive staircase with 2-IFC to estimate pure-tone hearing thresholds across multiple frequencies | Levitt (1971) |
| shadowing | Vocal shadowing-latency task: repeat a played sound aloud while a microphone voice key measures the delay between audio onset and speech onset | |
| Simon_task | Identify colour of a square regardless of its screen position; congruent trials are faster | Simon (1969) |
| simple_reaction_times | 20-trial simple RT task: press any key as quickly as possible when a target appears | |
| SNARC-effect | Parity judgment on digits 0–9 with reversed key mappings across blocks; demonstrates the SNARC effect | Dehaene, Bossini & Giraux (1993) |
| Statistical-Learning-Auditory | Statistical learning of tone sequences: exposure to a continuous tone stream with structured transitional probabilities, probed with 2AFC or head-turn preference | Saffran et al. (1999) |
| Statistical-Learning-Community-Structure | Implicit learning of community structure in a continuous visual sequence, with random-walk exposure and spacebar-based event segmentation | Schapiro et al. (2013) |
| Statistical-Learning-Visual | Implicit learning of statistical regularities in a shape stream, probed with forced-choice and RT tests | Turk-Browne et al. (2005) |
| Stroop_task | Name the ink colour of colour words; incongruent trials (e.g. RED in blue ink) are slower | Stroop (1935) |
| Subliminal-Priming | Masked word priming: words rendered invisible by surrounding masks still influence processing | Dehaene et al. (2004) |
| Temporal-Integration-Word-Recognition | Alternating odd/even letter components at variable SOA; Exp 1 (subjective report: 0/1/2 words perceived) and Exp 2 (lexical decision with RT); experiment selected via GetParticipantInfo UI | Forget et al. (2010) |
| Trubutschek_Unconscious_Working_Memory | Probe access to briefly presented stimuli below and above the threshold of consciousness | Trübutschek et al. (2017) |
| Visual-Illusion-Lilac-Chaser | Lilac chaser illusion: a ring of disappearing disks produces a rotating green afterimage | |
| Visual-Search | Feature vs. conjunction visual search across set sizes (4/12/24), measuring how reaction time scales with the number of distractors | Treisman & Gelade (1980) |
Demonstrations¶
Visual illusions, interactive showcases, and minimal templates. Most do not write a data file.
| Directory | Description |
|---|---|
| hello_world | Simplest possible goxpyriment program — good starting point for new users |
| Motion-Blur | Motion blur vs. phantom array demo: animated bar demonstrates retinal blur and the strobe effect at 60 Hz |
| play_two_gvvideos | Plays two .gv videos side by side, synchronised, logging keypresses with their time relative to video onset |
| play_two_videos | Plays two MPEG videos side by side, synchronised, logging keypresses with their time relative to video onset |
| play_videos | Plays a sequence of MPEG video files found in the assets folder |
| random-dot-stereogram | Random-dot stereogram that reveals a 3-D shape when fused binocularly |
| simple-rt-example | Minimal 10-trial reaction-time loop using ShowTS / GetKeyEventTS for hardware-timestamped RT |
| stimuli_extras | Showcase of advanced stimuli: visual mask, Gabor patch, dot cloud, stimulus circle, thermometer |
| Visual-Angle-Calibration | Draws concentric rings at 2°, 5°, and 10° of visual angle for a quick sanity-check of the units.Monitor calibration |
| Visual-Illusion-Ebbginghaus | Animated Ebbinghaus (Titchener circles) size-contrast illusion |
| Visual-Illusion-Kanizsa | Kanizsa illusory-contour square: a square is perceived where none is drawn |
| Visual-Persistence | Persistence-of-vision illusion: an image seen only through moving vertical slits integrates into a whole when the eyes track a moving dot |
Technical Tests¶
Hardware, timing, and feature tests live in the tests/ directory at the repository root (separate Go module). Build them with make tests.
| Directory | Description |
|---|---|
| bouncing_gv_movies | Two .gv movies bounce around the screen, additively blend on overlap, fire beep tones at frame markers, and log full state to the data file on every key press; demonstrates every runtime mutator media.Movie exposes (Pause, PauseWithLoop, SetRate, SeekFrame, SetPosition, SetSize, SetBlendMode) with the multi-movie synchrony invariant preserved via BeginBurst/EndBurst |
| GvFiles | Plays sequences of .gv movies while flashing a white square and pulsing DLP-IO8 line 0 at frame markers, for photodiode+oscilloscope display/TTL synchrony checks (port of PsyScope WhiteSquareSync) |
| set_fullscreen | Minimal SDL program that toggles exclusive fullscreen mode — sanity check for the fullscreen video path |
| sync_two_gv_movies | Two .gv movies played side by side under a shared MasterClock; demonstrates media.MovieManager multi-movie sync, burst-pause, Movie[At]/Movie[AtDisplay], and Display[Onset/Offset] events with optional TTL-trigger wiring |
| tearing_test | Full-height white bar sweeping horizontally to reveal screen tearing; prints frame-interval statistics on exit |
| test_av_sync | Verifies PlaySyncedWithFlip aligns audio onset with the VSYNC flip (icon flash + 1 kHz tone each second) |
| test_canvas | Drawing on an off-screen Canvas surface before presenting it in one frame |
| test_follow_mouse | A white dot follows the mouse cursor every frame — minimal real-time input loop |
| test_ft232h | Exercises an Adafruit FT232H breakout as an 8-bit TTL trigger device (output + input loopback) |
| test_fullscreen | Sanity check for fullscreen rendering through the control facade |
| test_getinfo | Demonstrates the GetParticipantInfo dialog: collects participant demographics and monitor characteristics before the experiment window opens |
| test_images | Loads every PNG file in the current directory and displays each one centered for one second |
| test_joystick | Move a cursor with a controller's analog stick (gamepad API with raw-joystick fallback, dead zone, live axis readout) — analog input handling |
| test_keyboard | Demonstrates every keyboard input method provided by the framework, section by section |
| test_labjackt4 | Exercises a LabJack T4 as an 8-bit TTL trigger device (output + input loopback) |
| test_linuxgpio | Exercises a Linux GPIO character-device (v2) trigger as an 8-bit TTL device (output + input loopback) |
| test_menu | Demonstrates the stimuli.Menu widget |
| test_mouse_audio_feedback | Left/right mouse clicks trigger ping/buzzer audio; useful for testing sound output |
| test_parallel_port | Reads and writes a Linux LPT parallel port via the ppdev kernel interface |
| test_playgv | Plays a single .gv video through the control facade |
| test_stream_images | High-precision RSVP loop streaming a sequence of images (PresentStreamOfImages) |
| test_stream_text | High-precision RSVP loop streaming a sequence of text strings |
| test_text_input | Demonstration of the TextInput stimulus collecting free-text keyboard input |
| Timing-Tests | Hardware timing verification suite: eleven sub-tests (frame jitter, true refresh rate, audio latency, photodiode/BBTK/oscilloscope checks) selected with -test |