# \#experiment-design

**URL:** https://psychtoolbox.discourse.group/tag/experiment-design/18.md

[Latest](https://psychtoolbox.discourse.group/latest.md) · [Categories](https://psychtoolbox.discourse.group/categories.md) · [Tags](https://psychtoolbox.discourse.group/tags.md)

---

## ["Invalid movie handle provided" error message](https://psychtoolbox.discourse.group/t/invalid-movie-handle-provided-error-message/5719)

<div class="topic-metadata">

**Author:** [@inichoson](https://psychtoolbox.discourse.group/u/inichoson)\
**Replies:** 2\
**Last updated:** [June 12, 2025, 11:55pm UTC](https://psychtoolbox.discourse.group/t/invalid-movie-handle-provided-error-message/5719 "2025-06-12T23:55:05Z")

</div>

I have a script that just plays videos back to back based off of the “Play Movies Without Gaps” script in PTB’s Movie Demos. I am having a weird issue though where the script consistently picks one movie iteration to qui…

---

## [Inconsistent timing of stimulus event code and photosensor](https://psychtoolbox.discourse.group/t/inconsistent-timing-of-stimulus-event-code-and-photosensor/5593)

<div class="topic-metadata">

**Author:** [@engell](https://psychtoolbox.discourse.group/u/engell)\
**Replies:** 10\
**Last updated:** [December 30, 2024, 11:14pm UTC](https://psychtoolbox.discourse.group/t/inconsistent-timing-of-stimulus-event-code-and-photosensor/5593 "2024-12-30T23:14:46Z")

</div>

PTB: 3.0.19 Matlab R2022a Linux Ubuntu 20.04 Stim timing issue: event code sometimes precedes visual stimulus, sometimes follows it. Hello, I was hoping someone might have some helpful insight regarding a timing iss…

---

## [Non-uniformity correction](https://psychtoolbox.discourse.group/t/non-uniformity-correction/5538)

<div class="topic-metadata">

**Author:** [@MrAndre89](https://psychtoolbox.discourse.group/u/MrAndre89)\
**Replies:** 2\
**Last updated:** [November 11, 2024, 2:14am UTC](https://psychtoolbox.discourse.group/t/non-uniformity-correction/5538 "2024-11-11T02:14:28Z")

</div>

Are there any routines in Psychotoolbox to correct spatial non-uniformities of displays, either at luminance (more important) or color (less important) levels?

---

## [Best practice: TTL event triggers in PTB stimulus presentation loop](https://psychtoolbox.discourse.group/t/best-practice-ttl-event-triggers-in-ptb-stimulus-presentation-loop/4659)

<div class="topic-metadata">

**Author:** [@johannesjuliusm](https://psychtoolbox.discourse.group/u/johannesjuliusm)\
**Replies:** 6\
**Last updated:** [October 5, 2024, 2:30am UTC](https://psychtoolbox.discourse.group/t/best-practice-ttl-event-triggers-in-ptb-stimulus-presentation-loop/4659 "2024-10-05T02:30:14Z")

</div>

Dear community, I am working on an auditory experiment in which multiple short sounds (400ms long) are played in random order, which is controlled by a loop. For every sound onset, I wish to send an event marker (TTL pu…

---

## [Script is running, but no sounds are played](https://psychtoolbox.discourse.group/t/script-is-running-but-no-sounds-are-played/4997)

<div class="topic-metadata">

**Author:** [@Ellen](https://psychtoolbox.discourse.group/u/Ellen)\
**Replies:** 4\
**Last updated:** [August 19, 2024, 1:50pm UTC](https://psychtoolbox.discourse.group/t/script-is-running-but-no-sounds-are-played/4997 "2024-08-19T13:50:49Z")

</div>

Hi, I am setting up my audio-visual experiment. My code, which has video and audio, worked perfectly fine on my screen and computer (it is a PRIME B560M-A with Windows 11 version 22H2, 64-bit operating system and 11th G…

---

## [Parallel Playback of multiple 4K HDR Videos on different displays](https://psychtoolbox.discourse.group/t/parallel-playback-of-multiple-4k-hdr-videos-on-different-displays/5189)

<div class="topic-metadata">

**Author:** [@Dounia](https://psychtoolbox.discourse.group/u/Dounia)\
**Replies:** 5\
**Last updated:** [March 8, 2024, 2:57am UTC](https://psychtoolbox.discourse.group/t/parallel-playback-of-multiple-4k-hdr-videos-on-different-displays/5189 "2024-03-08T02:57:24Z")

</div>

MatLab R2023b, Psychtoolbox 3.0.19, GStreamer 1.22.6, CPU: AMD Ryzen 9 5900X 12-Core processor 3.7GHz, RAM: 32GB, GPU: NVIDIA GeForce RTX 3080, OS: Windows 10 Pro, Displays: two 55” LG OLED G2 (3840x2160). Hello again, …

---

## [Joystick dead zone](https://psychtoolbox.discourse.group/t/joystick-dead-zone/5271)

<div class="topic-metadata">

**Author:** [@gopie](https://psychtoolbox.discourse.group/u/gopie)\
**Replies:** 0\
**Last updated:** [February 26, 2024, 4:00am UTC](https://psychtoolbox.discourse.group/t/joystick-dead-zone/5271 "2024-02-26T04:00:13Z")

</div>

Hi All. Im sampling position data from a joystick but have just realised that the dead zone is problematic (see attached). I removed the dead zone by adjusting the X11 config, but this just caused the cursor to jitter ar…

---

## [ShowCursor makes cursor transparent?](https://psychtoolbox.discourse.group/t/showcursor-makes-cursor-transparent/5172)

<div class="topic-metadata">

**Author:** [@mikemugno518](https://psychtoolbox.discourse.group/u/mikemugno518)\
**Replies:** 2\
**Last updated:** [November 16, 2023, 5:40pm UTC](https://psychtoolbox.discourse.group/t/showcursor-makes-cursor-transparent/5172 "2023-11-16T17:40:30Z")

</div>

Using latest PTB, Windows 10/OS 12.7, Matlab 2023b Hi all, I’m using the HideCursor/ShowCursor functions and they work just fine on my macbook, but not on windows. HideCursor works fine, but when I call ShowCursor the …

---

## [BlurredMipMap - but for Procedural textures?](https://psychtoolbox.discourse.group/t/blurredmipmap-but-for-procedural-textures/5151)

<div class="topic-metadata">

**Author:** [@Ian-Max-Andolina](https://psychtoolbox.discourse.group/u/Ian-Max-Andolina)\
**Replies:** 9\
**Last updated:** [November 5, 2023, 11:58pm UTC](https://psychtoolbox.discourse.group/t/blurredmipmap-but-for-procedural-textures/5151 "2023-11-05T23:58:38Z")

</div>

BlurredMipmapDemo uses a very neat trick to generate a “foveated” rendering like effect where the mouse position is sharply focused but this blurs depending on distance. This demo depends on movie frames, and running on …

---

## [Centering sentences in a block of text, sentences skewed?](https://psychtoolbox.discourse.group/t/centering-sentences-in-a-block-of-text-sentences-skewed/5125)

<div class="topic-metadata">

**Author:** [@maxlabassistant](https://psychtoolbox.discourse.group/u/maxlabassistant)\
**Replies:** 4\
**Last updated:** [October 24, 2023, 4:47pm UTC](https://psychtoolbox.discourse.group/t/centering-sentences-in-a-block-of-text-sentences-skewed/5125 "2023-10-24T16:47:35Z")

</div>

Hi everyone, I am trying to center individual sentences on the screen that together form a block of text (like a passage). I am first drawing “censored” sentences (with some words missing) and then replacing them one-by…

---

## [Visual angle of the virtual viewscreen using PsychVRHMD Stereoscopic mode](https://psychtoolbox.discourse.group/t/visual-angle-of-the-virtual-viewscreen-using-psychvrhmd-stereoscopic-mode/5139)

<div class="topic-metadata">

**Author:** [@pychen](https://psychtoolbox.discourse.group/u/pychen)\
**Replies:** 0\
**Last updated:** [October 23, 2023, 6:25am UTC](https://psychtoolbox.discourse.group/t/visual-angle-of-the-virtual-viewscreen-using-psychvrhmd-stereoscopic-mode/5139 "2023-10-23T06:25:54Z")

</div>

Dear all, I’m working on conducting experiments with HTC Vive, using random-dot stereograms as stimuli. Currently, I am using the Stereoscopic mode of the PsychVRHMD command to present the stereo image pair to the left …

---

## [Run Psychtoolbox Studies online!](https://psychtoolbox.discourse.group/t/run-psychtoolbox-studies-online/5123)

<div class="topic-metadata">

**Author:** [@LindseyF](https://psychtoolbox.discourse.group/u/LindseyF)\
**Replies:** 0\
**Last updated:** [October 12, 2023, 2:56pm UTC](https://psychtoolbox.discourse.group/t/run-psychtoolbox-studies-online/5123 "2023-10-12T14:56:02Z")

</div>

Hello PTB community, Did you know you can run Psychtoolbox studies online? Collect data remotely using your existing code, with little to no modifications. You can: Access broader or special populations Collect data r…

---

## [Using psychtoolbox with matlab for online use](https://psychtoolbox.discourse.group/t/using-psychtoolbox-with-matlab-for-online-use/3031)

<div class="topic-metadata">

**Author:** [@ggolarai](https://psychtoolbox.discourse.group/u/ggolarai)\
**Replies:** 3\
**Last updated:** [September 26, 2023, 1:46pm UTC](https://psychtoolbox.discourse.group/t/using-psychtoolbox-with-matlab-for-online-use/3031 "2023-09-26T13:46:20Z")

</div>

Hi, I’m wondering if psychtoolbox can be adapted for online presentation of experiments. I’ll appreciate any advise. Thanks, G.J

---

## [Is there a way to run psychtoolbox code online?](https://psychtoolbox.discourse.group/t/is-there-a-way-to-run-psychtoolbox-code-online/3395)

<div class="topic-metadata">

**Author:** [@RAM](https://psychtoolbox.discourse.group/u/RAM)\
**Replies:** 2\
**Last updated:** [September 26, 2023, 1:44pm UTC](https://psychtoolbox.discourse.group/t/is-there-a-way-to-run-psychtoolbox-code-online/3395 "2023-09-26T13:44:43Z")

</div>

Hi. I would like to know if there any provisions which let me run my experiment coded in psychtoolbox to run online?

---

## [VR/XR experiments](https://psychtoolbox.discourse.group/t/vr-xr-experiments/4977)

<div class="topic-metadata">

**Author:** [@masat](https://psychtoolbox.discourse.group/u/masat)\
**Replies:** 5\
**Last updated:** [July 14, 2023, 12:42pm UTC](https://psychtoolbox.discourse.group/t/vr-xr-experiments/4977 "2023-07-14T12:42:51Z")

</div>

Thanks to the newly introduced Virtuality features, I started to think about VR/XR experiments seriously. I am excited if I can use VR for rigorous presentation of stimuli in psychophysics experiments. But, first of all…

---

## [Delays in image presentation](https://psychtoolbox.discourse.group/t/delays-in-image-presentation/4918)

<div class="topic-metadata">

**Author:** [@Indusjazz](https://psychtoolbox.discourse.group/u/Indusjazz)\
**Replies:** 3\
**Last updated:** [April 19, 2023, 8:25pm UTC](https://psychtoolbox.discourse.group/t/delays-in-image-presentation/4918 "2023-04-19T20:25:55Z")

</div>

Hi, I am trying to program an experiment involving the serial presentation of png images taken from the same folder as the script shown below. Two images are presented per random series of 0, 4, 8 or 12 items representi…

---

## [Using 2 different stereomodes in the same experiment/display](https://psychtoolbox.discourse.group/t/using-2-different-stereomodes-in-the-same-experiment-display/4943)

<div class="topic-metadata">

**Author:** [@Jeff\_beca](https://psychtoolbox.discourse.group/u/Jeff_beca)\
**Replies:** 1\
**Last updated:** [April 18, 2023, 3:39pm UTC](https://psychtoolbox.discourse.group/t/using-2-different-stereomodes-in-the-same-experiment-display/4943 "2023-04-18T15:39:55Z")

</div>

Hello, I would like to use two different stereomodes at the same time. \[window, windowRect\] = PsychImaging(‘OpenWindow’,screenNumber,grey,,,,stereoMode); Namely stereomodes 100 and 101. I have an experiment that would…

---

## [Listening to keyboard (fmri scanner triggers) while playing videos](https://psychtoolbox.discourse.group/t/listening-to-keyboard-fmri-scanner-triggers-while-playing-videos/4940)

<div class="topic-metadata">

**Author:** [@nass](https://psychtoolbox.discourse.group/u/nass)\
**Replies:** 5\
**Last updated:** [April 18, 2023, 6:28am UTC](https://psychtoolbox.discourse.group/t/listening-to-keyboard-fmri-scanner-triggers-while-playing-videos/4940 "2023-04-18T06:28:48Z")

</div>

I’m using PTB with windows. I’m presenting videos and fixation crosses and it works. I also need to collect fmri triggers (aka keyboard presses) during the entire experiment. I found a solution that suggests using a m…

---

## [Key presses not being logged with kbCheck](https://psychtoolbox.discourse.group/t/key-presses-not-being-logged-with-kbcheck/4903)

<div class="topic-metadata">

**Author:** [@jTneurd90](https://psychtoolbox.discourse.group/u/jTneurd90)\
**Replies:** 3\
**Last updated:** [March 25, 2023, 12:16pm UTC](https://psychtoolbox.discourse.group/t/key-presses-not-being-logged-with-kbcheck/4903 "2023-03-25T12:16:55Z")

</div>

I have been mostly programming this task on the lab computer, my keypresses were being logged with mostly the same code (~95%, I’ve made some placement changes). Now, (on my macOS laptop; Ventura.13.2.1) it is not workin…

---

## [Drawing diamond shapes](https://psychtoolbox.discourse.group/t/drawing-diamond-shapes/4891)

<div class="topic-metadata">

**Author:** [@Mikel](https://psychtoolbox.discourse.group/u/Mikel)\
**Replies:** 2\
**Last updated:** [March 13, 2023, 3:56pm UTC](https://psychtoolbox.discourse.group/t/drawing-diamond-shapes/4891 "2023-03-13T15:56:41Z")

</div>

Hello, My token number is JTKTU2AV-202322110417:059b4e141afb382956cd2ecd8e0f1c23f06b58088ede94174ffe9a41f7e09387 I need to present 6 diamond shapes simultaneously for a short duration of 50 ms followed by 150ms blank, …

---

## [Framed Polygon misalignment](https://psychtoolbox.discourse.group/t/framed-polygon-misalignment/4887)

<div class="topic-metadata">

**Author:** [@jTneurd90](https://psychtoolbox.discourse.group/u/jTneurd90)\
**Replies:** 0\
**Last updated:** [March 10, 2023, 10:26pm UTC](https://psychtoolbox.discourse.group/t/framed-polygon-misalignment/4887 "2023-03-10T22:26:37Z")

</div>

I used the example from the framed polygon tutorial My goals are Present both left and right side triangle locations based on a matrix of x,y window dimensions ( y will be the same for both sides) Create matrix contai…

---

## [TTL trigger pulse fMRI](https://psychtoolbox.discourse.group/t/ttl-trigger-pulse-fmri/4872)

<div class="topic-metadata">

**Author:** [@Ram88](https://psychtoolbox.discourse.group/u/Ram88)\
**Replies:** 1\
**Last updated:** [March 1, 2023, 7:03pm UTC](https://psychtoolbox.discourse.group/t/ttl-trigger-pulse-fmri/4872 "2023-03-01T19:03:40Z")

</div>

Hi experts, I use a Matlab code for a visual task on an fMRI study. We have a VPixx system for delivering audio/video and recording triggers and responses. The trigger pulse is coming from TTL 15. As this is not transla…

---

## [Checking luminance persistence programmatically (is it possible?)](https://psychtoolbox.discourse.group/t/checking-luminance-persistence-programmatically-is-it-possible/4836)

<div class="topic-metadata">

**Author:** [@amancari](https://psychtoolbox.discourse.group/u/amancari)\
**Replies:** 3\
**Last updated:** [February 9, 2023, 5:44pm UTC](https://psychtoolbox.discourse.group/t/checking-luminance-persistence-programmatically-is-it-possible/4836 "2023-02-09T17:44:13Z")

</div>

Hello, I am using moving dot stimuli, and I need to check whether the monitor luminance decays fast enough so as to not leave a trace of the dot after it moves. Is there a way to “read” the monitor’s physical output? A…

---

## [KbQueueXXX functions: which to use and where do they go in relation to the trials' loop?](https://psychtoolbox.discourse.group/t/kbqueuexxx-functions-which-to-use-and-where-do-they-go-in-relation-to-the-trials-loop/4832)

<div class="topic-metadata">

**Author:** [@PHJT003](https://psychtoolbox.discourse.group/u/PHJT003)\
**Replies:** 0\
**Last updated:** [February 6, 2023, 11:54am UTC](https://psychtoolbox.discourse.group/t/kbqueuexxx-functions-which-to-use-and-where-do-they-go-in-relation-to-the-trials-loop/4832 "2023-02-06T11:54:56Z")

</div>

Dear Psychtoolbox users, I wrote a script to run a 2AFC task where participants must respond within a fixed deadline of 2 seconds. If participants respond earlier, then they move to the subsequent trial straight away. T…

---

## [There is a delay in starting the break period](https://psychtoolbox.discourse.group/t/there-is-a-delay-in-starting-the-break-period/4811)

<div class="topic-metadata">

**Author:** [@minji](https://psychtoolbox.discourse.group/u/minji)\
**Replies:** 4\
**Last updated:** [February 3, 2023, 1:37am UTC](https://psychtoolbox.discourse.group/t/there-is-a-delay-in-starting-the-break-period/4811 "2023-02-03T01:37:34Z")

</div>

Hello, I am a student who has been learning the program for over a month. I have a question because there is a part that I can’t solve while writing the code. It flips by 1 second after reaching the halfway point before…

---

## [What is key press prevention principle?](https://psychtoolbox.discourse.group/t/what-is-key-press-prevention-principle/4815)

<div class="topic-metadata">

**Author:** [@minji](https://psychtoolbox.discourse.group/u/minji)\
**Replies:** 0\
**Last updated:** [February 1, 2023, 1:51pm UTC](https://psychtoolbox.discourse.group/t/what-is-key-press-prevention-principle/4815 "2023-02-01T13:51:08Z")

</div>

hello. This time, I am curious about the principle of the code, so I leave a question. If you write the code like this, if you hold down the key, the rectangle will keep growing. if keyCode(escapeKey) exit …

---

## [How can I get consecutive responses with one key?](https://psychtoolbox.discourse.group/t/how-can-i-get-consecutive-responses-with-one-key/4814)

<div class="topic-metadata">

**Author:** [@minji](https://psychtoolbox.discourse.group/u/minji)\
**Replies:** 4\
**Last updated:** [February 1, 2023, 8:42am UTC](https://psychtoolbox.discourse.group/t/how-can-i-get-consecutive-responses-with-one-key/4814 "2023-02-01T08:42:03Z")

</div>

hello! I have a question because I don’t know how to write the code for the key response. In the experiment loop, make it win or lose when the space key is pressed when the shape is within a certain area. Press the spac…

---

## [PsychHID KbQueueGetEvent not working properly](https://psychtoolbox.discourse.group/t/psychhid-kbqueuegetevent-not-working-properly/4757)

<div class="topic-metadata">

**Author:** [@jsebas24](https://psychtoolbox.discourse.group/u/jsebas24)\
**Replies:** 7\
**Last updated:** [January 7, 2023, 12:14am UTC](https://psychtoolbox.discourse.group/t/psychhid-kbqueuegetevent-not-working-properly/4757 "2023-01-07T00:14:38Z")

</div>

Hello everyone! I’m trying to program a Matlab routine on Windows, the idea is to press a mouse click following an audio signal. I need hi precision, so after reading the documentation I decided to use PsychHID functio…

---

## [KbQueue for multiple key presses](https://psychtoolbox.discourse.group/t/kbqueue-for-multiple-key-presses/4762)

<div class="topic-metadata">

**Author:** [@amancari](https://psychtoolbox.discourse.group/u/amancari)\
**Replies:** 1\
**Last updated:** [January 1, 2023, 2:31pm UTC](https://psychtoolbox.discourse.group/t/kbqueue-for-multiple-key-presses/4762 "2023-01-01T14:31:41Z")

</div>

Hello, I need to run a task in which I present a series of stimuli and collect multiple key presses (of the same key) in a single trial, to analyze their timing. The stimuli have to be presented continuously and indepen…

---

## [QUEST posterior parameters and stopping rule](https://psychtoolbox.discourse.group/t/quest-posterior-parameters-and-stopping-rule/4320)

<div class="topic-metadata">

**Author:** [@dilcetan](https://psychtoolbox.discourse.group/u/dilcetan)\
**Replies:** 2\
**Last updated:** [November 18, 2022, 12:16pm UTC](https://psychtoolbox.discourse.group/t/quest-posterior-parameters-and-stopping-rule/4320 "2022-11-18T12:16:43Z")

</div>

Dear all, I have several miscellaneous questions about QUEST. I am trying to use QUEST in a paradigm that does not have a fixed nAFC structure. n changes between 2 to 6 on every trial. This posesses the problem of a…

[Next page](https://psychtoolbox.discourse.group/tag/experiment-design/18.md?match_all_tags=true&page=1&tags%5B%5D=experiment-design)
