Convert OSC to Midi messages

FriFlo's icon

Hi guys,

I am new to max an I love it!

Right to the topic: I was already successfulestablishin midi in/out an udp recieve/send to get and send both midi and OSC data. With pack I also found out how to make an incoming OSC message to a specific midi controller. Next was scaling the float OSC value to the 0-127 midi CC LSB. I did that with the "scale" object. Very flawless so far!
Where I am stuck right now is, that the controller sends a lot of double values, because the resolution of OSC is greater than 128 steps (midi). What is the most elegant way, to ...

... either ignore the unnecessary steps from OSC ....
... or filter double values resulting from the "scale 0. 1. 0 127?

Maybe there is an altogether more elegant way to do all that. Forgive my ignorance, as i am new to this!

Thank you,

Fritz.

broc's icon

You can filter the resulting double values by inserting a [change] object (simple=elegant).

FriFlo's icon

That's it! Thank you very much!

FriFlo's icon

One more thing: I put OSC Messages through a "scale 0. 1. 0 127" object. When I move the fader, I get all values from 0 - 127 (some double, but change helped me to change that). Now I discovered, that one value is missing. I never get 126??? all other values, but never 126, no matter how slow I move the fader ... any idea?

Spip's icon

There's a patch that coulb be helpful

broc's icon

The missing value in the upper range may happen if the resolution of OSC input is not linear, but logarithmic.
You could try using the 5th argument of [scale] for adjustment.