Stim onset timing

Is there a way to present stimuli at times from a conditions file ?

I have a loop with 2 routines, each are 4 seconds in duration. I was hoping to make their start times (0,4,8,12,16,…), where routine1’s start times are (0,8,16,…) and routine2’s start times are (4,12,20,…).

I cannot seem to create a global variable that starts with the loop but tracks the remainder of the experiment. The reason I’d like to call start times from a conditions file is so that lags don’t accumulate across the whole experiment.

Thanks for any advice!

If you start a clock in Begin Experiment

myClock = coreClock()

and then reset it in End Routine just before your loop starts.


then you end your two routines in code instead of using the duriation

In Each Frame

if myClock.getTime() > (8*trials.thisN + 4):
     continueRoutine = False


if myClock.getTime() > (8*trials.thisN + 8):
     continueRoutine = False