range package:tidal

range will take a pattern which goes from 0 to 1 (like sine), and range it to a different range - between the first and second arguments. In the below example, `range 1 1.5` shifts the range of sine1 from 0 - 1 to 1 - 1.5.
d1 $ jux (iter 4) $ sound "arpy arpy:2*2"
|+ speed (slow 4 $ range 1 1.5 sine1)
The above is equivalent to:
d1 $ jux (iter 4) $ sound "arpy arpy:2*2"
|+ speed (slow 4 $ sine1 * 0.5 + 1)
rangex is an exponential version of range, good for using with frequencies. For example, range 20 2000 "0.5" will give 1010 - halfway between 20 and 2000. But rangex 20 2000 0.5 will give 200 - halfway between on a logarithmic scale. This usually sounds better if you’re using the numbers as pitch frequencies. Since rangex uses logarithms, don’t try to scale things to zero or less.
Internal function used by shuffle and scramble
The fixRange function isn’t very user-friendly at the moment, but you can create a fix variant with a range condition. Any value of a ControlPattern wich matches the values will apply the passed function.
d1 $ ( fixRange ( (# distort 1) . (# gain 0.8) )
( pure $ Map.singleton "note" ((VN 0, VN 7)) )
)
$ s "superpiano"
<| note "1 12 7 11"