jit.map

inu's icon

How do I specify a value for an int type in jit.map? (;ᴗ;)

Matteo Marson's icon

Hey Suika,

Afaik, [jit.map] can work with different input matrix types (float32, char, float64 and long) but it can't convert the matrix to another type, and the mapping range is always normalized [0 - 1].
What you can do, is to use [jit.trunc] after jit.map, to round the values to the closest (smaller) integer.
Anyway, I suppose looking at the image you posted, you want to use a matrix as a midi controller; if the low input value is 0, as well as the low output value, is 0, you can simply use a multiplication

Max Patch
Copy patch and select New From Clipboard in Max.