Thank you for your reply, @wakecarter!
On trials with high-frequency beeps, the picture change is approx 3 seconds off. The trials with medium-frequency beeps, the picture change is about 600ms off. The picture change on the trials with low-frequency beeps is on time.
It’s really weird because I first run 3 practice trials, and the timing is fine on all of those. I set the duration of each picture stimulus in the code on the practice trials (see below) and have the trials run in sequential order (high-freq trial first, then medium, then low). listenDur = duration of the first image. tapDur= duration of the second image.
if practCond == 1:
listenDur = 5
tapDur = 10
elif practCond == 2:
listenDur = 7
tapDur = 14
elif practCond == 3:
listenDur = 8
tapDur = 18
For the real trials, I have the picture stimulus durations in an excel file and the different trials come in random order. Depending on which sound file is picked from the excel file, the corresponding image durations are then also picked.

I originally had these set in a code component, similar to the practice trials, rather than an excel file.
Like this:
cond = thisTrial['condition']
if cond == 'high':
listenDur = 5
tapDur = 10
elif cond == 'med':
listenDur = 7
tapDur = 14
elif cond == 'low':
listenDur = 8
tapDur = 18
I’d call the condition from the excel file on each trial and set the correct image durations accordingly. But JS didn’t like ‘thisTrial’, so I changed it to use the excel file.
Perhaps I could either:
A - edit the listenDur and tapDur values for the real trials to account for the lag. So, change 5 to 2 to account for the 3 seconds of lag. However, I wonder if the amount of lag will be the same for each computer/internet connection?
B - remove the excel sheet. Use code to randomly pick a condition, and then set the sound component and listenDur / tapDur values based on which condition is picked. This would get around JS not liking ‘thisTrial’. I’m not 100% sure on exactly how to do this. I think I’d need to put all the conditions into a list, then generate a random number on every trial and index into the list? I’d also need some code to make sure that each condition is picked an equal number of times. Perhaps, like ‘if cond1 = picked ‘100 times’, pick again…’. Not sure if this would solve the image timing issue…
If it comes to it, I think this might just be something that I can live with. I am mostly interested in analysing the participants’ ability to continue pressing the space bar at a consistent pace after the sound has stopped. Therefore, even if the picture that tells them to start responding in time with the sounds is a little delayed, they should have still begun responding by the time the sound stops. So, this shouldn’t interfere with my data collection. It just means that I can’t also analyse their ability to match their responses to the timing of the sounds (as they might not have started responding yet).
Thank you for all your help!