[open] Esay way off adding file pool items as variables?
I couldn't find anything regarding this in the various help sections and tutorials.
So I have around 300 soundfiles in my file pool, and want to add then to a variable in my loop. Is there an easy way to copy/paste the sound file names into the variable? Or do I have to hand-type them all?
Comments
Hi,
The folder that contains the file pool is available as
exp.pool_folder, so you can get a list of all files in the pool like this (randomly shuffled):Then, at the beginning of each trial, you could get one item from this list and use it as an experimental variable, like so (in the prepare phase of an
inline_script):Does that help at all?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Well, I am not the best at coding within Open Sesame (I only followed an introductory course)
I do however, get what the script is trying to do. My question is just: Where in the experiment do I place the first part of the script (where it retrieves a file list)? if I place it in an in-line script before the loop sequence (the actual experiment) starts, it says fname_list stays undefined When it tries to run the prepare phase of the second script.
If this takes too much time to properly explain, i will just do it by hand. It would take it bit longer, but at least I know how that works
Thanks for the help anyway!
Just at the very begging of the experiment in the prepare phase of an
inline_scriptitem should do the trick!Check out SigmundAI.eu for our OpenSesame AI assistant!