Forums > Jitter

Trying and failing to convert float32 to integer

December 2, 2012 | 5:38 am

I’m trying to use Jitter to generate a biased sine table made out of 8-bit integer values. I thought it would be easiest to start with floats and convert to integers at the end. I seem to be generating the data fine in float32 format, but I am not able to convert the resulting Jitter matrix to char or long. I have tried jit.coerce and a second jit.matrix object, but in both cases the result is garbage data. Am I misunderstanding what jit.coerce is supposed to do?

– Pasted Max Patch, click to expand. –


MIB
December 2, 2012 | 8:23 am

like this?????

– Pasted Max Patch, click to expand. –

December 2, 2012 | 6:16 pm

Thanks, that’s exactly what I need!
For my own understanding, why does it have to be of type long when all the integers are less than 256?


Viewing 3 posts - 1 through 3 (of 3 total)