# How to randomise sounds in PsychoPy for each participant

OS MacOS Monterey
PsychoPy version latest

Hi! I need some help cause i am new to PsychoPy. Need it for my project.
I have 4 conditions. The conditions need to be randomised for each participants and also the sounds need to be randomised which one is played from two.
I’ve got 8 sounds.
4 are just songs for 60 secs
another 4 are the same songs but the tempo is lowered

A - sound 1 or sound 2
B - sound 1 or sound 2 (depends which one was in A)
C- sound 3 or sound 4
D- sound 3 or sound 4 (depends which one was in C)

for example when my participant gets ABCD, he might get A1B2C4D3 or C3B2A1D4
so when he get sound 1 in A then he needs to get sound 2 in B but lowered tempo…
how to do it? :((
thanks for your time! appreciate

Do you need an equal balance of pairings? (I’de assume probably yes) If so I would have a spreadsheet with two columns something like

letter_cond sound
A 1
A 2
B 1
B 2
C 3
C 4
D 3
D 4

Then feed this spreadsheet into your loop in a “random” loop type.

Becca

Thank you! It clarified something…

I’ve got 4 conditions and basically 4 sounds (but 8 cause all four needs to have lowered tempo)

Condition A - sound 1 or sound 2 (randomized for each participant)
Condition B - sound 1 or sound 2 (when sound 1 was played in A, here needs to be played sound 2), lowered tempo
Condition C - sound 3 or 4
Condition D - sound 3 or 4, lowered tempo

The hardest thing is that when in condition A sound 2 is played then in condition B sound 1 needs to be played but also it needs to be lowered. so psychopy needs to randomize which song is played in A (1 or 2) and also make sure that in condition B it will be sound that tempo is lowered sound1_low then…
So which sound from 1 or 2 will be played lowered needs to be randomized too. And the ABCD conditions need to be randomized too… So one participant will get DCAB and then with the songs for example D3low,C4,A1, B2low
Each sound is 60 secs, but I also need 60 secs breaks after each condition. (I am measuring changes in heart rate influenced by music…)

Maybe I can get any help with this, cause I can’t figure it out… I guess it is all about the loops.
Thank you for your time! Be safe!