| Reference | Downloads | Github

How do I select a subset of rows/stimuli from TWO conditions files and then randomly arrange these two selections into one sequence for presentation?

Hi all,

I am creating an oddball task, in which our subjects much press a button when the auditory stimulus that is not like the others is played. I am very new to coding and am hoping that these problems can be solved mostly using the builder.

I currently have two conditions files (“standard_conditions.csv” containing stimuli files A, B, C, and D and “oddball_conditions.csv” containing stimuli files A2, B2, C2, and D2). For my stimulus presentation, I need it to do the following in a loop:

  1. Arrange the 4 possible standard stimuli (from “standard_conditions.csv”) into an 8-stimuli-long presentation where each of the 4 stimuli appears 2 times each (i.e. A-B-B-D-C-A-C-D; store this sequence, as we do not need to play it yet)
  2. Then, randomly select ONE of these 8 stimuli and REPLACE it with an altered version of it from the 4 choices in oddball_conditions.csv. (For example, I would need to replace one stimulus called “A” with “A2” or “B” with “B2” but I cannot replace “A” with “B2.”)
  3. Play this 8-stimuli-long sequence 100 times with each iteration being a new randomization made from the above steps.

Also, if there is a better way to structure my conditions files that will make this easier to do, that solution would be appreciated as well!

OS X El Capitan
PsychoPy version: v1.85.2

What do you mean by:

i.e. how does the file contains files? Or do A, B, C, D represent filenames?

I mean that my four standard stimuli (A, B, C, and D) are listed each on their own row a condition in the file.


I’m trying to achieve the same thing with different stimuli, have you had and luck?