Hi there! I'm having a blast controlling Tidal via MIDI, using the usual "^33" syntax and a Novation controller.
This works for both knobs sending [0-127], but also with 'on-off' buttons which send either 0 or 127.
However, using those ones for state variations to toggle patterns, I had to resort to somecyclesBy:
do
d1 $ somecyclesBy "^44" (fast 2) $ "bd*4" # gain (range 0.2 0.8 "^78")
d2 $ "~ cp" # gain (0.9 * "^79")
d3 $ "~ cp" # gain (0.9 * "^79")
At scale I have the impression this can quickly result in late messages, and I wonder if that could be because somecyclesBy evaluates some probabilities, not just boolean values, so there might be more computing under the hood than I need here!
At first I was using sometimesBy but it looked like using the latter one improved a bit my situation, which is why I suspect there's something fishy in my approach.
Anyone has a suggestion how to refactor the above, so that d1 would fast 2 depending on Midi CC ^44 being 0 or 127, without resorting to someXBy?
Tried these few ones and I'm not sure I get how while works, but it doesn't seem suited here:
d1 $ sometimesBy "^44" (fast 2) $ "bd" -- Works as expected
d1 $ someCyclesBy "^44" (fast 2) $ "bd" -- Works as expected
d1 $ while "^44" (fast 2) $ "bd" -- No sound
d1 $ while 1 (fast 2) $ "bd" -- No instance for (Num Bool) arising from the literal ‘1’
d1 $ while True (fast 2) $ "bd" -- Couldn't match expected type ‘Pattern Bool’ with actual type ‘Bool’
Cool idea!
Did you manage to find another syntax that works for you?
I'm not in front of tidalCycles right now, but I wonder, if somethingl ike this works:
d1
$ fast (|+ 1 (cF 1 "44"))
$ "bd*4" # gain (range 0.2 0.8 "^78")
By the way, is the caret ^ operator a shorthand vor cF _ _ in a way? I can't find it in the docs, but it looks really handy.