Logarithmic midi control in tidal

know about having to start from a positive number ...

let me (again) advertise the :doc command. It shows the info that you missed.

ghci> :doc rangex
rangex :: (Functor f, Floating b) => b -> b -> f b -> f b
  	-- Identifier defined at src/Sound/Tidal/UI.hs:1702:1
 `rangex` is an exponential version of `range`, good for using with
frequencies.  Do *not* use negative numbers or zero as arguments! 

I can see the mathematical beauty of the implementation
( https://github.com/tidalcycles/Tidal/blob/main/src/Sound/Tidal/UI.hs#L1702 )

rangex from to p = exp <$> _range (log from) (log to) p

but it does go counter to everyday experience with logarithmic potentiometers (e.g., sliders on a mixing desk): they typically go from 0 to 1 (or somewhere), with 0 = total silence (and not: 0 = forbidden)

Supercollider has similar functions
( supercollider/lang/LangSource/MiscInlineMath.h at develop · supercollider/supercollider · GitHub ) (tidal's rangex is their expexp? they can addidionally specify the base of the logarithm = the skewness of the curve) but they have the same problem (division by zero, log of zero). Huh.

1 Like