There is an object in RTC-lib for PureDate called anti-bis that can filter out repetitions in a stream of numbers. Is there an existing way to do that in SC? What I’d like to be able to do is to replace a repeated value with a different fixed value, usually a rest. Something like:
Prand((0..9),inf).asStream.nextN(10)
-> [ 1, 1, 2, 4, 4, 7, 2, 9, 5, 6 ]
Instead, something like
Pantibis(Prand((0..9),inf), Rest()).asStream.nextN(10)
-> [ 1, Rest(), 2, 4, Rest(), 7, 2, 9, 5, 6 ]
or
Pantibis(Prand((0..9),inf), 99).asStream.nextN(10)
-> [ 1, 99, 2, 4, 99, 7, 2, 9, 5, 6 ]
The closest answer I have found on the list involves PIdev from miSCellaneous_lib:
https://scsynth.org/t/controlling-repetition-rate-in-randomness/917
but it doesn’t quite seem to do what I’m looking for. Or does it?