URN a block of numbers

May 3, 2012 at 4:44pm

URN a block of numbers

Hi, what I want to do is cutup an audio file at random and not have any cut sections repeat. For example if I had a one minute file and played from 23 to 32 seconds (so you can probably see where I am coming from ;) those nine seconds would not be played again. The random playback process would continue until all parts of the dound have been played back.

I am completely flummoxed as to how to do this so any suggestions will be much appreciated.


May 3, 2012 at 5:55pm

It wouldn’t be too difficult if you cut the sound file up into equal sections. Too late for me to create a patch right now, but the steps would go something like:

1: get the total file length and divide that by the number of sections you want.
2. Assign each section a number (ie with counter) to identify it by and store that to a a coll (or dict) with respective segment start time.
3 use [urn] to step through a non-repeating sequence sequence of numbers to reference the coll , which in turn is used to seek the start time of the section in the file.

If you want or need different/arbitrary length segments, the solution would be trickier as you’d need a more elaborate method to accomplish step 1 (or try a different approach altogether)

May 3, 2012 at 6:01pm

I would cut it up, and stash the ranges in a coll with sequential indexes for the slices. Then you can use urn to generate the playback indexes to fetch the slices from the coll in random order.

May 3, 2012 at 6:06pm

I also think that [coll] is the way to go. Try [urn-jb] which doesn’t need to be reset.


You must be logged in to reply to this topic.