Just an update based on an earlier conversation I had with another friend, with a real-world example:
Say we have set our fader to pitchBend (we know this one goes from -8192 to 8191). This means that the range that the API has to deal with is in reality [0,16383].
Now, say, we have moved our fader to a pitchBend value of +60.
Let’s do the math: The API will convert this one to 8192+60=8252.
Now comes the interesting part:
The API needs to convert this one to the [0,1] range and as we previously saw, this means that it will try to set the hostValue to 8252/16383 = 0,503692852346945.
In fact, it does so and spits out this value to our mOnChangeValue of the hostValue. Cool!
BUT NOW, it has to store it! This far, the API was working at a “high” level, but now it really has to go on with a “final” storage to a binary.
Converting the above value to binary, we will get (note that certain rounding processes occur here):
00111111000000001111001000000100
BUT, this bin is no longer equal to our starting value, and we all know that it’s due to rounding. This is indeed a concern with the API, its binary rounding places!
If we convert this back to our float, we now get:
0.5036928653717041015625.
Now, the API will go on and RESEND this value, because it looks to it like we really have a change again. And it will resend this. This way we indeed have TWO messages for a unique action, and INDEED this can eventually cause jitters, while we’re changing the values using our controller.
The way to go is that Steinberg rounds consistently both while mOnProcessValueChange is triggered and BEFORE the mOnValueChange of the hostValue in order to have the very same value. I don’t know the infrastructure, but possibly it has to do with different rounding algorithms of javascript and c. But again, I simply don’t know. At which accuracy should this be done? Not that important, but since the most I know is 14-digits controllers, this rounding should go at least this far.
@Jochen_Trappe, I think you should have a look at this one, because it indeed can break controller’s behaviour. Note that what I mention above is already tested with a script and I can surely provide the snippet exposing the issue.