@jonathan.kominsky You’re right, I should have been more clear. I’m not having trouble with creating sound objects (yet), and I do not get any error.
The full Python code above is meant to prevent trials from the same conditions to appear more than three times in a row, and also to add attention checks (catch trials) every 10th trial. To avoid repetitions of the same item, every item is popped of trialList after it appears.
The first part is there because I set presentation method to be sequential and not random, as was suggested in another post when using code to randomize.
The second part is supposed to create a shuffled trials list, and then run sequentially on it. The second part checks if the current item is from a condition which repeated three consecutive times, and if it is - reshuffling occurs.
The third part is supposed to insert catch trials every 10th trial.
Does it make any sense?
When I sync the study from the builder, this code is not compiled in Pavlovia, and items are presented sequentially.
Thanks a lot for your time, much appreciated!