Problem with sound feedback

OS: Windows 10
PsychoPy version: 2022.2.2
Hi everyone, I’m trying to use the sound feedback but I have 2 problems.

  1. When I do the task and I do a correct trial it gives me the right feedback and if I do a wrong trial it gives me the right feedback, but the problem is that the previous feedback influences the next one. I give an example to better explain what I mean, I do a right trial and it gives me the right feedback and then if I do the trial wrong after that it still gives me that it is right. Another example, if I do a wrong trial it gives me the incorrect feedback, but if I then do a right trial it gives me the feedback that marks me wrong. On excel it still gives me the right results.
  2. The other problem lies in the first feedback after the first trial. What happens is that I get a sound that is not among those saved. I have discovered that it is due to the fact that I initialise the variable with None (feedback= None), but I do not know what solution to apply to this problem.
    I attach the code and if you find it difficult to imagine the problems I am experiencing, I can attach a video in which I explain the problems.
    I thank those who will try to help me

Hi @MTH, if at the first presentation the feedback is still “None” it seems like your code does not run at the correct point in time. Could you describe the flow of a trial and the feedback and where the code is run?

Hi, the task is similar to Posner’s paradigm so you have to wait a stimulus after the presentation of a cue. There are 2 keys, a keyboard is to make sure that the subject does not respond prematurely and the other keyboard is for the response to the final stimulus. If you want I can also upload some screenshots. Do you also have any ideas regarding the first problem?

Yes, if the code runs at the wrong time your feedback will always refer to the previous trial instead of the current one. That’s why I asked when you run the code that you show.

Sorry, I forgot to respond to the other question. Technically I run the code immediately after the response or, if the subject doesn’t respond, after the final stimulus. I insert the code in the section “Begin routine”. I hope that I respond to your question.

So there is a separate feedback routine and the code runs when it begins? Sounds like it should be working. Could you upload your experiment so I can have a look?

Ah, easy fix: Right click your code component and click “move to top”. This way it runs before the sound is initialised :slight_smile: At the moment it is indeed running after the sound and therefore your sound always belongs to the trial before.

1 Like

I followed your suggestion and now everything works!!!
Thank you for your help and patience.

1 Like