Hi,
I just made this sample code based on a thread here to test to convert to and back from float and while it works in S-rate, it does not work in k-rate.
// Capture the first input, it is encoded as a signed
// 32bit integer of which 27 bits are used.
// so to convert it to an interval [-1.0f , 1.0f]
// the following can be done:
float input_one = (inlet_in1 / (float) (1<<27));
// The following transforms the [-1.0f ; 1.0f] interval
// to the axoloti convention interval of [-(1<<27) ; (1<<27)-1]
outlet_out1 = (int32_t) (input_one * (1<<27));
Error is:
/Users/afonsob/Local_App_Dev/axoloti/build/xpatch.cpp: In member function 'void rootc::instanceobject__1::dsp(const int32_t*, int32_t (&)[16], int32_t&, int32_t&, int, int)':
/Users/afonsob/Local_App_Dev/axoloti/build/xpatch.cpp:182:48: error: invalid operands of types 'const int32_t* {aka const long int*}' and 'float' to binary 'operator/'
float input_one = (inlet_in1 / (float) (1<<27));
^
/Users/afonsob/Local_App_Dev/axoloti/build/xpatch.cpp:186:15: error: incompatible types in assignment of 'int32_t {aka long int}' to 'int32buffer {aka long int [16]}'
outlet_out1 = (int32_t) (input_one * (1<<27));
^
make: *** [/Users/afonsob/Local_App_Dev/axoloti/build/xpatch.bin] Error 1
shell task failed, exit value: 2
Compiling patch failed ( /Users/afonsob/Local_App_Dev/axoloti/patches/ZDF experiment.axp )