EDIT: If you'd like to skip to the solution it's here.
[Note that I'm using branch 1.8.2. Transitions went away in 1.9.]
It's common for musicians, especially drummers, to throw in a short change before a longer-lasting one. For instance, in the last bar before the chorus, the drummer is likely to play a fill, and then during the chorus another beat.
I want to do the same thing using Tidal. Here's some code that works, but doesn't do what I want:
do setcps 1 d1 $ (1/16) <~ ( s "numbers" |*| n (slow 8 $ run 8) ) d2 $ s "[gabba/8, bd, hh*4]" -- verse do jumpMod' 2 8 0 $ sound "[bd,<hc hh>*8]" -- chorus jumpMod' 2 8 7 $ sound "bd*4" -- fill
Voice 1 here counts off the beats the whole time. (Those "numbers" samples are laggy so I've made them a little early.)
The idea is that voice 2 starts playing the verse, and then should briefly (for the 7th, that is the last, of 8 cycles) play a fill before entering the chorus. That's what I would expect if I evaluated the second do-block around beat 2, which is what I do.
Is this kind of scheduling multiple transitions at once something others already have a solution to? I'm trying to understand how transitions are coded, so I can write a version of
wash that accepts multiple patterns and delays, but it's a mind-bender.
Returning to the code above, if I evaluate the jumpMod' instructions one at a time, the transitions always happen on the right beat mod 8, although they might take an extra 8 cycles -- for instance, I might ask at cycle 3 for a change to happen at cycle 7 mod 8, and rather than changing at cycle 7, it changes on cycle 15.
But what's weirder is the interaction. If I evaluate the second do-block around cycle 2 mod 8, it changes into the chorus immediately, and then 13 cycles later (when voice 1 says "seven") switches to the fill and stays there.