# How to randomly pair videos with songs

**URL:** <https://discourse.psychopy.org/t/how-to-randomly-pair-videos-with-songs/38633>\
**Category:** Builder\
**Created:** [February 13, 2024, 4:07pm UTC](https://discourse.psychopy.org/t/how-to-randomly-pair-videos-with-songs/38633 "2024-02-13T16:07:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Hayward](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tom_hayward/32/40816_2.png) [@Tom\_Hayward](https://discourse.psychopy.org/u/Tom_Hayward)\
**Post date:** [February 13, 2024, 4:07pm UTC](https://discourse.psychopy.org/t/how-to-randomly-pair-videos-with-songs/38633/1 "2024-02-13T16:07:29Z")

</div>

Hi,

I am working on an undergraduate project, I am trying play videos of a car simulation with a new sound in the background of each video. I have managed to get psychopy to play the videos in random order, however, the videos are always paired to the same song (the one they are next to in the spread sheet). I am unsure how to randomise the pairing.

If anyone could give me some advice on this that would be a massive help. I have attached some images of the current draft for better context.

Thanks in advance,  
Tom

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/2/7251730174e072a2806574005bf05ceb9a6d156c.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/a/6aa2c25cbbe6937df4a221eb5ebc0bc26e56b477.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 13, 2024, 4:10pm UTC](https://discourse.psychopy.org/t/how-to-randomly-pair-videos-with-songs/38633/2 "2024-02-13T16:10:36Z")

</div>

Have a look at my independent randomisation demo for one method

> [@PsychoPy Online Demos](https://discourse.psychopy.org/t/psychopy-online-demos/22319):
>
> If you have routines or experiments that are likely to be useful to others, please create a post in this thread, editing your post to add new demos so there is one post per creator. Ideally set your demos so they can be tested without consuming a credit (if you don’t have a site license) by adding a final routine that can’t end, disabling save incomplete results and adding a small number of credits. Please do not discuss the demos in this thread or create more than one post unless you have a la…

---

<div class="post-metadata">

**Author:** ![Tom\_Hayward](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tom_hayward/32/40816_2.png) [@Tom\_Hayward](https://discourse.psychopy.org/u/Tom_Hayward)\
**Post date:** [February 13, 2024, 6:17pm UTC](https://discourse.psychopy.org/t/how-to-randomly-pair-videos-with-songs/38633/3 "2024-02-13T18:17:01Z")

</div>

Thank you very much!  
Unfortunately I don’t know how to code, is there any way you could post the psychopy file so I could have a look at how it’s set up? Or is the only way to code it?

Thanks again,  
Tom

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [February 13, 2024, 7:49pm UTC](https://discourse.psychopy.org/t/how-to-randomly-pair-videos-with-songs/38633/4 "2024-02-13T19:49:40Z")

</div>

Click on the code link to go to the Gitlab repository and then download the psyexp builder file.
