If this template helps then use it. If not then just delete and start from scratch.
OS: Mac OS 10.15.7
PsychoPy version 2021.2.3
Standard Standalone? (y/n) yes
What are you trying to achieve?:
I have a sound stimuli bank of hundreds of pop songs sorted by year. I also have a series of routines that correspond to the same years and need to present the correct songs to the correct years. I also want to include a space bar key response to end the routine early if I need to skip a song.
What did you try to make it work?:
I have a series of routines that present audio stimuli within a giant loop. The loop pulls from a master csv that has hundreds of candidate stimuli (see screen shot below). The stimuli are sorted by year, and each routine, also corresponding to a year, draws from a specific $column in the spreadsheet so whatever randomize stimuli is played corresponds to the year that the routine represents. Audio is “set every repeat” and starts at 0.0. (See screenshot below for the builder view)
For the key component, I used the preset to end routine when ‘space’ is pressed.
What specifically went wrong when you tried that?:
The program does not crash, but will simply not play stimuli from some of the years. See the log below (note that most of the trials did play, but a few did not - they say ‘none’ in the logs)
|12.2622 |EXP |New trial (rep=0, index=0): OrderedDict([(‘year_2005’, ‘2023_Original_38.wav’), (‘year_2004’, ‘Original_2022_38.wav’), (‘year_2003’, ‘2021_Original_38.wav’), (‘year_2002’, ‘2020_Original_38.wav’), (‘year_2001’, ‘2019_Original_38.wav’), (‘year_2000’, ‘2018_Original_38.wav’), (‘year_1999’, ‘2017_Original_38.wav’), (‘year_1998’, ‘2016_Original_39.wav’), (‘year_1997’, ‘2015_Original_38.wav’), (‘year_1996’, ‘2014_Original_38.wav’), (‘year_1995’, ‘2013_Original_38.wav’), (‘year_1994’, ‘2012_Original_38.wav’), (‘year_1993’, ‘2011_Original_38.wav’), (‘year_1992’, ‘2010_Original_38.wav’), (‘year_1991’, ‘2009_Original_38.wav’), (‘year_1990’, ‘2008_Original_38.wav’), (‘year_1989’, None), (‘year_1988’, None), (‘year_1987’, None), (‘year_1986’, ‘2004_Original_i_want_you.wav’), (‘year_1985’, ‘2003_Original_holidae_in_album_version_.wav’), (‘year_1984’, ‘2002_Original_groove_me.wav’), (‘year_1983’, ‘2001_Original_get_ur_freak_on.wav’), (‘year_1982’, ‘2000_Original_i_cry.wav’), (‘year_1981’, ‘1999_Original_meeting_in_my_bedroom.wav’), (‘year_1980’, ‘1998_Original_i_gotta_be.wav’), (‘year_1979’, ‘1997_Original_i_love_you_always_forever.wav’), (‘year_1978’, ‘1996_Original_in_the_hood.wav’), (‘year_1977’, ‘1995_Original_hold_me_thrill_me_kiss_me_kill_me.wav’), (‘year_1976’, ‘1994_Original_groove_thang.wav’), (‘year_1975’, ‘1993_Original_i_belong_to_you.wav’)])|
In other trials, I get nearly none to only half of the stimuli to play at all example below:
1.7511 | EXP | Created sequence: random, trialTypes=148, nReps=1, seed=None |
---|---|---|
11.7524 | EXP | New trial (rep=0, index=0): OrderedDict([(‘year_2005’, None), (‘year_2004’, None), (‘year_2003’, None), (‘year_2002’, None), (‘year_2001’, None), (‘year_2000’, None), (‘year_1999’, None), (‘year_1998’, None), (‘year_1997’, None), (‘year_1996’, None), (‘year_1995’, None), (‘year_1994’, None), (‘year_1993’, None), (‘year_1992’, None), (‘year_1991’, None), (‘year_1990’, None), (‘year_1989’, None), (‘year_1988’, None), (‘year_1987’, None), (‘year_1986’, ‘2004_Original_so_sexy.wav’), (‘year_1985’, ‘2003_Original_pump_it_up.wav’), (‘year_1984’, ‘2002_Original_oops_oh_my_.wav’), (‘year_1983’, ‘2001_Original_most_girls.wav’), (‘year_1982’, ‘2000_Original_step_into_a_world_rapture_s_delight_.wav’), (‘year_1981’, ‘1999_Original_whatever_radio_version_.wav’), (‘year_1980’, ‘1998_Original_sock_it_2_me_featuring_da_brat_.wav’), (‘year_1979’, ‘1997_Original_you_bring_me_up.wav’), (‘year_1978’, ‘1996_Original_before_you_walk_out_of_my_life.wav’), (‘year_1977’, ‘1995_Original_sprinkle_me.wav’), (‘year_1976’, ‘1994_Original_sweet_potatoe_pie.wav’), (‘year_1975’, ‘1993_Original_the_floor.wav’)]) |
I have tried specifying start times for the key and audio component (different from one another) in case this was the issue, as well as taking away the key component all together and I still have the same issue.
I would also like to point out that each year has a different number of candidate stimuli - some columns have as few as 12 items while others have 110. (I am not aware of this being an issue but let me know if it is!). My first question is if the issue is related to the spreadsheet columns being different lengths or not. And, if not, what might be conflict with the component?
Thank you so much for your help in advance!