![]() If stim_list != 'standard.wav' and stim_list != 'standard. Would you have any advice? Do you know where is my mistake? filename_to_read = _thisDir + os.sep + 'MMN_stim.csv'įilename_to_write = _thisDir + os.sep + 'MMN_stim_' + expInfo + '.csv' It could simply be: if not rr: trials5.finished True. Just navigate to the file using the conditions field. shuffle randomizes the order of the two sequences in-place, while list converts the iterator that results from chain into a list: from itertools import chain, izip from random import shuffle solvable s1, s2, s3, s4 unsolvable u1. No, a builder loop imports an Excel file for you automatically. I set the loop type in random and left in blank the random seed option but that only set a different random order for every subject not for every repeat of the loop. You can then flatten using the chain function to get the S3, U2, S2, U4, S4, U1, S1, U3 sequence you want. I want to set the loop so every repeat, the stimuli list appears in a different random order. In other words, each deviant stim must always be immediately followed by a standard stim.īellow is the code I inserted in my first routine. OS: Win10 PsychoPy version : 2021.2.1 I’m building a Simple Reaction Time experiment. I would like to randomise my list by making sure that a deviant stim will never be immediately followed by another deviant. So I have 1030 lines of standard stim, 100 for deviant_1, 100 for deviant_2, 100 for deviant_3, and 100 for deviant_4. If you want your loop to end based on some condition, rather than based on a certain number or iterations, then you could use a whileloop. ![]() there are 6 types and 4 trials so there should be a total of 24 trials). I have a csv file (MMN_stim.csv) containing my stim and trigger’s info (it will be an EEG study). 1366×768 167 KB I have tried inserting some code which I modifed based on this thread: Randomly select every 4 row in condition file However, I think I am missing code which instructs psychopy to repeat the cycle so all conditions for each type eventually play (i.e. The text component of my first routine never shows up so I guess psychopy is running the while loop again and again, but the message "reshuffle. The script keeps running without ending (even after 1 or 2 minutes) and I can’t figure out why. You can use a number of different Loop Types in PsychoPy. ![]() I tried to use Mirjam’s code to randomize my stimuli according to 1 condition but it did not work. Loops control the repetition of Routines and the choice of stimulus parameters for each.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |