OS : win10
PsychoPy version (e.g. 2024.2.4 Py 3.8):
Standard Standalone Installation? y
Do you want it to also run online? n
What are you trying to achieve?: I have developped a task with different steps (presentation of stimulus, learning phase and retrieval) and am now testing trigger delays and noticing that delays are not constant. I am wondering if the way in which I am sending triggers is the correct one.
In this “stimulus presentation” task, for example, I have a loop and, at each trial, I show a figure (abstract_image) for 2.5 sec in a specific position of a memory_arena; then the abstract_image disappears and the memory_arena is showed empty for 1 more second. I want to send a trigger when the abstract_image appears and when it disappears. So at the beginning, I used these commands in the “begin routine” and “end routine” of the code component in the trial routine.
“win.callOnFlip(pulse, IMG_ONSET_CODE)“
“win.callOnFlip(pulse, IMG_OFFSET_CODE)“
As this did not work, I am now using this in the “each frame” of the code component in the trial routine:
“if (abstract_image.status == pc.STARTED) and (not _img_onset_sent):
win.callOnFlip(pulse, IMG_ONSET_CODE)
_img_onset_sent = True”
and this in the “end routine” of the code component of the same routine:
“if _img_onset_sent and not _img_offset_sent:
win.callOnFlip(pulse, IMG_OFFSET_CODE)
_img_offset_sent = True”
The IMG_ONSET_CODE and the IMG_OFFSET_CODE should be 2.5 seconds apart so 2500 samples when collecting at 1000 Hz. However, this is the list of samples between each pair of triggers (2384, 2318, 2368, 2401, 2402, 2418, 2368, 2435, 2334, 2367, 2435, 2402, 2434, 2434, 2451)……Am I sending triggers in the right way or is there a better one?
This is the screenshot of the “trial” routine and the code is publicly available here (1_stim_presentation · master · Isotta Rigoni / test_visual_memory · GitLab):




