I just worked out how to use midi input on effects and control busses thanks to this thread here: Tidal 1.7 control busses + midi control input = ❤️
This is a fantastic feature! I just have one query about it. Can anyone think of a way to map midi input onto a logarithmic range, so I could control tidal's filters with it?
From what I can gather, tidal automatically converts midi cc from a 1-127 range into a 0-1 range, which you can then multiply to get larger or smaller ranges. For example, # speed (8 * "^14") would allow midi cc 14 to control sample playback speed in a range of 0-8. However, if I wanted to control a low pass filter, to achieve a clean-sounding sweep of values, I'd have to somehow scale a cc input logarithmically between 0 and 10000.
Any ideas as to how to do this?
Hi! What you're looking for is
rangex, the exponential version of the
range function. There's some documentation here, but the usage is pretty straightforward:
# lpf (rangex 1 10000 "^14")
This would take your CC 14 input and map it to the logarithmic range 1-10000 (note, you have to start your output range on a positive number because log(0) is undefined).
thank u so much! I had tried that but didn't know about having to start from a positive number, works perfect with the new effects busses too
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
( Tidal/UI.hs at main · tidalcycles/Tidal · GitHub )
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/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.