Conditional Start time of a routine with precise delay: PreviousComponent.status==FINISHED + delay


Within a routine, I would like a new component to start precisely at 3 seconds after the previous component has finished. For example, I have one audio stimulus (.wav) file, then I wish to have exactly 3 seconds of silence/delay, and a new audio stimulus (.wav file) to start exactly 3 seconds after the previous stimulus has FINISHED.

So far within a routine for the second component I do:

start (time, seconds): $PreviousComponent.getDuration() + 3
where PreviousComponent is the first audio stimulus, and it starts at 0.0 of the new routine

However, this is not precise, as it does not account for a possible delayed start of the first stimulus, but instead is based on the pure theoretical duration of the previous sound, rather than when it actually ended.

I would like a simple statement to start a new stimulus exactly 3 seconds after the FINISH of the previous component.

something like this:
start (time, seconds): $PreviousComponent.status==FINISHED() + 3

However, this does not work: no error, but that stimulus simply never starts. Identical situation when I put start as ‘condition’ instead of ‘time’. I believe it is because I am mixing conditional statement for .status and time in seconds.

Could you please suggest a builder statement/code component to achieve a start of a new component precisely after x amount of time after the FINISH of a previous component, whilst keeping them both in the same routine?

Could you have an empty text component that is 3 seconds long and starts when the previous sound has finished. Then have your next component that starts when the empty text component has finished.

Dear Wakecarter,

thank you for your kind and swift reply.

Yes, that is a good idea.

However, I was hoping to avoid it since the stimuli of interest in my study are ONLY auditory. Using text as a proxy for a 3 second delay would introduce a new problem - for accuracy, I would probably need to synchronise this text component with the screen refresh (frames) whilst my critical auditory components do not have to be synchronised with the screen, thus probably causing potential discrepancy.

I thought that some elegant conditional statement could be the purest solution. What do you think?

Perhaps you could have a look at my newest question whether it is a big problem to synchronise audio stimuli and parallel port triggers with the screen (even though the audio and triggers are NOT related to the screen and thus the synchronisation imposes an unnecessary limitation of 60Hz refresh rate)?

Maybe it is not such a big deal as I think and I should use the text as you advised, and synchronise all with the screen refresh? The only trouble is I will be recording MEG and wanted to have most accurate timestamps and triggers possible.

Can you use an ISI component instead of a text component?