Shuffle (supercollider vs Tidal)

In Tidal 'shuffle' seems to function somewhat different then 'Pshuf' in a Pbind in Supercollider.
Pshuf chooses a random pattern and plays the until you re-evaluate, which makes Pshuf pick another pattern.

In Tidal the shuffled pattern changes each cycle as far as I know.

The nice thing of 'Pshuf' in Supercollider is that it gives you repetition, which is good for a bass groove for instance.

Might be nice if such a shuffle would be included in Tidal.

I like to use the repeatCycles function to repeat the random part (which can arise from shuffle or another function like scramble), but it only repeats it for a finite number of cycles (which works for me, but that might not be what you're going for).

Something that is tricky with randomness in Tidal is that, in its way, it's fixed once and for all, in the sense that a random pattern will always yield the same result at a given cycle. Because of that, I'm not sure how you would go about repeating the same randomly-generated pattern forever (or until you reevaluate), at least in an Tidal-idiomatic way.

1 Like

This the hack I use:

repeatCycles 999 $ (1 <~) $ n (shuffle 16 $ run 16) # s "peri"

vary by changing the offset:

repeatCycles 999 $ (2 <~) $ n (shuffle 16 $ run 16) # s "peri"

2 Likes

Thanks.

(1 <~)

offsets the pattern one cycle?

Something like that. Yes, I think that's what it does. You can also use floats there to offset by, say, half or quarter of a cycle.

1 Like

maybe it could be possible to have a shuffle function with a seed parameter to initiate the PRNG, instead of using a global one. That way, shuffle x would always generate the same permutation for x

IIRC you can use loopFirst to loop the first cycle forever

loopFirst $ (1 <~) $ n (shuffle 16 $ run 16) # s "peri" 

Changing the 1 will then give you a difference sequence, so is essentially like changing the 'seed'.

5 Likes

That's good to know, thanks!