Hi all,
I am trying to wrap my head around kRate values. Essentially, in the patcher a kRate values ranges from -64 to 64, but they are understood to be 27 bit values. I am wondering how this translates to larger values in code.
For example, in axoloti_math.h the MTOFEXTENDED macro passes the input value to the mtof48k_ext_q31 function, which is this:
static inline uint32_t mtof48k_ext_q31(int32_t pitch) {
int32_t p=__SSAT(pitch,29);
uint32_t pi = p>>21;
int32_t y1 = pitcht[128+pi];
int32_t y2 = pitcht[128+1+pi];
int32_t pf= (p&0x1fffff)<<10;
int32_t pfc = INT32_MAX - pf;
uint32_t r;
r = ___SMMUL(y1,pfc);
r = ___SMMLA(y2,pf,r);
uint32_t frequency = r<<1;
return frequency;
}
If I understand correctly, the __SSAT function binds the pitch to a 29 bit value, so I’m assuming that pitch is a value greater than -64 to 64.
Is there any literature in the Ksoloti/Axoloti documentation that explains how the kRate values work? I hope this question makes sense. Thanks!