Split attention/Dual activation task

PsychoPy version 3

Hi all,

For my study I have 6 different blocks, where each block has a unique Audio file (whose selection is based on an Excel spreadsheet) and a loop with 55 rotations of a visual task (based on a different Excel spreadsheet). Essentially, I need the Audio file to play at the same time as whole of the visual task (one audio file throughout the 55 rotations).
For the time being, I have only managed to have the audio file play on its own.

I have created two loops;
one external loop for the 6 different conditions comprising of:
information per condition
the audio file
one internal loop of 55 visual trials
and some follow up questions, again unique to each condition (defined by an Excel sheet)

I’ve tried both having infinite duration for my audio file and ‘x’ seconds, but it seems that it will first complete the one routine and then progress to the other one.

Also, quite annoyingly, I am not getting any error messages.
I hope that made sense!

Thank you in advance!

As a component is contained within a routine, one component can’t span multiple routines. However, one variable can, so the way this is generally handled is to store the total time elapsed within the sound file in a variable at the end of each routine, then use the .seek() method of the Sound component to set it to the point it finished the last routine at, if that makes sense?

So, for example, if in the first trial they take 10s to respond, in the next trial the Sound component would start playing at 10s in to the audio file.

This would probably look like this:
‘Start Experiment’ tab:

soundStart = [0]*6 # Create list of six zeros

‘End Routine’ tab:

soundStart[blockNo] += t # Add time elapsed to soundStart

‘Start Routine’ tab (mySound is the name of your Sound component):

mySound.seek(soundStart[blockNo]) # Start sound where we last left off