I am just recently getting into Processing after using Supercollider for a while. Now I am looking for code that plays another random video from a map on my computer every time it is cue’d. Similar to what is possible with the dictionary function in Supercollider.
Can anyone point me in the right direction for this?
Hi, I am not sure I understand your question since I have never used Supercollider, but there are dictionary data types in Processing https://www.processing.org/reference/StringDict.html. You could also use an ArrayList to store Movie objects (aka the videos), and access them by selecting a random index. https://www.processing.org/reference/ArrayList.html
Can you say more about what you mean by ‘map’? Do you mean, a directory of video files, or a text file that lists video files, or…?
Begin with the Processing > Examples > Libraries > Video > Movie > Loop example.
Instead of just providing the movie file name as a string (“transit.mov”), load a list of movie file names from a file with loadStrings:
…and then choose a random element from that list to be your movie file name.