int to float how to do smooth interpolation ?
Hi everyone,
The problem.
I send midi from ableton Live into max and then to a jit.gl.model. I want to use the midi to transform the rotate xyz.
Soooo midi 0 - 127 (so it's 128) to rotateX 0-360.
I tried expr $f1 /127. * 360.
but the numbers jump in a very visible way which makes the movement very choppy.
I tried line after the expr object with a smooth time of 100, but when I go from say rotate 0 to rotate 180, it spins way too fast.
I've gone through the forums the whole day but can't find what must be a simple solution or is it ? ;-)
From what i gather its smooth interpolation, jus can't nail it.
Any and all help appreciated !
sounds like you need jit.anim.drive in your life!
Hi Wetterburg,
I know the basics of anim drive , and I fed midi into it but it only has one speed setting for all midi coming in, so If i have a midi square or saw line which, so it could be the right thing to use but I'm not sure how. Ableton live is my sequencer which alters bpm with the midi clips adapting to the main bpm. Any clue how to sync anim drive to a Master bpm ?
Simply put if i have a midi ctrl data going from 0 to 127 in 4 seconds and staright after that 0 to 127 in 2 seconds jit.anim.drive just turns at the same speed
From this:
I tried line after the expr object with a smooth time of 100, but when I go from say rotate 0 to rotate 180, it spins way too fast.
it seems like you're trying to use interpolation to replace your messages; you're sending the 0, then the 180, and it spins real quick, yeah?
Well, I think that typically the interpolation in line, line~, slide~, whatever, are used to smooth out the steps inbetween, rather than provide the whole line.
Try drawing your curve, the steppy one from earlier. Then feed that through a really fast line - you want that line object to simply draw the steps inbetween, not provide the whole ramp, if that makes sense?
Sorry, if I'm misreading you there - it's sometimes difficult to see what people want to do from reading text online.
jit.anim.drive is mega-awesome for things like this, though, you really should consider giving it an extra chance. The @speed argument is "units per second", so you can do some really simple math to figure out how fast it needs to be.
Another idea could be to switch to pitchbend messages for the finer stuff? Or map a live.dial to live instead - that way you can do higher resolution data, too, iirc, and send that as "anything but midi" across to max. We use 32-bit floats in my orchestra, it works really well over UDP.
oh, to specify a bit: you can still send the raw, low-res midi in, and use that to control jit.anim.drive, it'll do smoothing, if you need it to, and you can turn it off, in the case of "square wave" stuff. But perhaps start by eliminating midi values, since Live itself is plenty capable of doing much higher-res automation things.