I'm trying to cut a buffer into a variable amount of slices (between 2 and, don't know, 256?) and randomize the order that they are played back in. It's a dynamically sized buffer currently being written using poke~.
Now I started to write something that took the total buffer size and divided it by however many steps I want, and that's giving me the step size. But then I got stuck in how to apply that to the loop start/end points. I want to make it so it slices the sample into equally sized pieces, which will change depending on total buffer size and/or slice amount.
Here is the patch as it stands (the dividing is happening in the bottom right)