Create 30sec run of flickering images
Hi there,
I'm trying to create an experiment where I flicker between two jpg images at a given rate. The images are actually a checkerboard, but I'm not confident to create these in Psychopy, so I've just created an inverse images that I want to present in alternating order, for example at 100 ms per stimulus:
-checkerboard1 (100 ms)
-checkerboard2 (100ms)
and repeat for 30 seconds. In between each block of 30 sec checkerboard flicker I'll just have a simple baseline with empty screen with a fixation point.
I've done some reading on timing and I'm using Expyriment backend to take advantage of V-Sync and Blocking flip (I think these are automatically utilised here?).
Originally I built my task with a block Loop with a variable 'stim' that defined which jpg image to show on the sketchpad. This loop had 200 rows (check1.jpg, check2.jpg, check1.jpg, etc etc such that a single sequence would last 30 sec).
Then the trial sequence just had a single sketchpad with an image defined by the 'stim' variable, with duration 100 ms.
I also had a second block look with a single sketchpad wiht a fiation point and this had duration 30000 ms.
The task worked, except of course for the glitchiness of having to call the new sequence each loop.
So after reading about timing, I tested out a different approach. Here I removed the 'stim' variable in the Block loop. Instead I had multiple sketchpads in the trial sequence: sketchpad 1, sketchpad 2, sketchpad 1, etc. The sketchpads with check1.jpg added were all linked, and similarly the sketchpads with check2.jpg added were all linked.
The flicker was much smother (I also changed the sketchpad durations to 95 ms to allow for meeting the refresh deadline). But the task keeps crashing with an 'unknown' error. To test it out I actually 'only' added 30 sketchpads (15 for check1.jpg, 15 for check2.jpg) . So I'm guessing this is making the task a bit unstable? Of course, at 100 ms per stimulus, this only gives me 3 seconds for the block duration, and I need 30 sec!
So hoping there's a much more efficient way to get this task to run?
Comments
Hi @rlaycock,
If you need flickering for that long, using individual sketchpads might be a bit unstable indeed (just a hunch not something that I "know").
I would go for a presentation within an inline_script, as for example demonstrated here.
So, essentially use a while loop to control the timing.
Hope this helps,
Eduard