I’m trying to synk an instrument to the host beats. Given that the host info doesn’t provide beats and phase info I was trying to use the modulo operator to “capture” the beats, but apparently this isn’t a solution…
instr 1
kIsPlaying chnget “IS_PLAYING”
kTimeInSeconds chnget “TIME_IN_SECONDS”
if kIsPlaying==1 then
if (kTimeInSeconds % 1)==0 then
printk 1, kTimeInSeconds
endif
endif
endin
This code prints only each 4 seconds. The same if I do modulo 2 or modulo 4.
With module 3 it prints every 12 seconds.
I guess that using a modulo condition on a control rate variable is not reliable. Who guarantees that the control rate kicks exactly at the right time? By the way I don’t understand why it happens a multiples of 4…
I’ve tried to see if something changes if I set different sampling rates, but it seems it doesn’t have any effect.