OS (e.g. Win10): 10.13.4 PsychoPy version (e.g. 1.84.x): 1.85.4 Standard Standalone? (y/n) If not then what?: y What are you trying to achieve?:
Hi! I’m very new to the psychopy and python. this is my first time working with experiment programming, so I would love to get some advice from you guys…
I’m trying to make the audio stimuli repeat when pressed ‘r’ key.
After the audio stimulus is presented, I want to make
if pressed ‘return’, move on to the next task (evaluation)
I basically googled for three days if I can figure out what I can do with the ‘custom code’ within the builder, but I basically have no idea where to start…
is this something I can’t do on the builder view?
I followed your instructions, but my problem here is that the sound file I have is only 3~4 seconds, so I don’t know if this is my soundfile problem but it just stops playing after one loop.
So I want to make it replay only once after the original trial if the participant wants to listen to the stimuli again…
is there a way to make the audio file replay only once after the trial???
Yes, just set the nReps value to 2. That way, there can only be one replay, as the loop will finish after the first replay regardless of what key the person presses.
It’s not clear why that would be. Could you provide new screenshots of your flow panel (showing the new loop), the new loop’s dialog box, and the code in the code component?
Your keyboard component should be set up as it was originally: you need a keypress to end the routine (or else the loop can neither end nor go on to its second repetition), and you need the two options ('return' and something else).
The loop is in the right place, but please show us the loop dialog box and the code in the code component.
Whatever value you put in the code should be the one that ends the loop and goes on to the next stage. So with that code, 'return' will end the loop without replaying, the other response will allow the next replay to occur.
I’ve just noticed from that last screenshot that you are using an old version of PsychoPy. It can be worth using the latest version when developing a new study, so that you’re up to date with what other people making suggestions on the forum are using (but certainly resist updating during your data gathering).