Hi There,
You are on the right lines for sure! What makes this a bit tricker is that you want a component to be presented multiple times within the same routine as a the video. So, there are 2 solutions:
- add multiple sound components each with its own predetermined onset
- do this in code (which I think is the approach you might prefer here!)
For solution 2, you would use the code you have but with a few more considerations. On each frame within the routine we want to detect a) is the tone currently being presented and b) are we currently waiting for a tone to be presented c) if neiter a nor b let’s pick an interval to wait then present the tone (and do this continuously whilst our trial is going on in the background.
Since there are a couple of bits of code here, here is a demo to help you on your way. A tone is presented every 3-5 seconds on a lop for the duration of a 10 second long trial.
toneRandom.psyexp (9.2 KB)
Hope this helps,
Becca