I think it’d be nice if the gate durations from Kria were relative to the clock (internal or external) and division of the triggers of a track. With current functionality, if you use a slow clock or have a track with a long clock division, the gates are still relatively short. It’d be great if you could have voices that let long notes ring out.
I read through the source code a bit and found the line of code where durations get set (line 470, ansible_grid.c). If I’m just interested in getting longer gates in general (which I am), I think I could just increase the bitshift by a bit or two more.
dur[i1] = (k.p[k.pattern].t[i1].dur[pos[i1][mDur]]+1) * (k.p[k.pattern].t[i1].dur_mul<<2);
becomes
dur[i1] = (k.p[k.pattern].t[i1].dur[pos[i1][mDur]]+1) * (k.p[k.pattern].t[i1].dur_mul<<4);
I’m presuming that ultimately the duration is in ms. This would be the easiest solution.
Even better would be to incorporate the time interval between clock pulses into the calculation so a slower clock yields proportional gates. For the internal clock, the variable “clock_period” seems to store the time between clock pulses (again, I am assuming this is in ms), but based on my read, the “handler_KriaTr” function is called automatically when the clock input receives a trigger.
I’m very novice as far as C programming goes so I’m a little clueless as to where to read how much time has passed between the handler_KriaTr callbacks and how much precision I’d need to use to store it. If anyone can advise on how to accomplish this, maybe I could try it.
As for the clock division of the track’s triggers, I believe that would be as simple as multiplying the existing line by the track’s “tmul” variable:
dur[i1] = (k.p[k.pattern].t[i1].dur[pos[i1][mDur]]+1) * (k.p[k.pattern].t[i1].dur_mul<<2) * k.p[k.pattern].t[i1].tmul[mTr];
I think the bitshift + multiplying by the track division/multiplier (it is a division even though its referred to as a multiplier in the code, right?) would be fine, but feels like it’d be cool for it to all be linked to the clock speed so if anyone would like to shed any light on that, I’d love to get some tips!