Repeat the sound component only in a routine

Correct me if I am wrong, but it looks like you tried to take the following approach:

This approach creates a loop to repeat the sound. If you press the slider, you want the loop to be finished. If the r key was pressed, you want the loop to start iterating.
As long as the participant presses the r key, the loop won’t be over. It will repeat the routine repeatedly until the participant presses the slider to finish the experiment.

Everything in your code seems to be fine except one thing. You need to set the keyboard component to end the routine as well. So, the routine will be over whenever the participant presses r, and the loop will start its iteration.

image

I created a simplistic example demonstrating this approach:
Repeat Sound.zip (20.3 KB)

Let me know if it fixed your inquiry and if you need any help :slight_smile: