Crashes after 30 mins/ wavs have clicks/ can't use MIDI files

Here you go everyone: https://we.tl/zwNrl9kwlg

I’ve isolated the (large) bit of code that’s causing me all of the problems, and I’ve reduced the number of .wav files (significantly) to the smallest number at which the experiment structure makes sense. The error message, possibly due to ordered dicts, is still appearing if I open it in PsychoPy v1.90.1, and it does not appear if I open it in v1.85.6 - so hopefully you’ll find that useful @Michael and @dvbridges ?

Jonathan - the variable that keeps growing excessively large is ‘thisExp’, isn’t it? I’m presuming what I’d need to do is regularly reset thisExp within the code then, and save the data on each attempt? Or would you try to run everything without an experiment handler? In your suggestion above, would ‘yourData’ equate to ‘thisExp’?

Thanks all!

I’m starting to feel like I’ve bitten off more than I can chew with all of this. As you will see if you open the file, my coding isn’t particularly elegant and is probably full of errors (even though it appears to work other than the issues listed in my original post). Do any of you live in London (where I teach) or Cambridge (where I study)? Would anyone PsychoPy savvy in either of those places be up for me paying them for an hour or two of their time to go through my code with me… What with the clicks and the crashing, I’ve hit a bit of a brick wall with all of this…