OS (e.g. Win10): MacOS Catalina
PsychoPy version (e.g. 1.84.x): 2021.2.3
Standard Standalone? (y/n) If not then what?:Yes
What are you trying to achieve?:
I have a directory of popular songs – 50 for each year (1940-2023). I want to present 30 randomized songs from the range of years when the participant was 7-19 years old, based on the birth year input at the beginning of the experiment. Based on this input, the program will need to randomly select 30 from the possible 500 stimuli within that range.
I am trying to find the best way to set up my csv files. I could put audio filenames in separate csvs (1 for each year), or I could create one giant csv with corresponding rows or columns for the files by year. I am not sure which route to take - I will need to make sure the loop condition can use the input from the age range to limit what part of the stimuli directory it is looking at. I have an image of my potential experiment flow attached. I think what needs to happen is the age input occurs before the nested trial loop, and I have code in the next routine (codeInit) to generate the calculated range. It seems I would take the variable of that range and plug it into the condition(?) or selected rows(?) in the trial loop options, but I am not sure exactly what would work.
Another potential solution would be to create a csv file with all 500 possible songs for each corresponding birth year, in which case I would need to equate the birth year input with its corresponding csv as a condition. I am not sure if this is simpler.
Thanks in advance!