Pitchbend - Unipolar mapping #1026
-
Hello, I am relatively new to programming - I've dug through some of the questions here, and made some progress but I seem to have a math issue. I have a footpedal pot to be sent via USBMIDI to use as CC or PB. For PB, I want the minimum to be 0 and the maximum to be 8191 (signed 14bit?) - for pitchbend UP only When hooked-up to a MIDI program, the 100% wiper position is correctly 16383 I have also tried manually subtracting - 9 from the min-out like this but no change If I subtract "16 or more"ish from the min-out, it completely skips 8192 and it becomes 8183 (msb/lsb 63 119)
To me, the problem seems to be a math issue because we're not calculating in floats? Is there a way to get your mappingFunction() to calculate in floats just in the backend? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
A possible issue could be the resolution of the sender:
If you need more resolution, you can use |
Beta Was this translation helpful? Give feedback.
This is indeed a bug in Control Surface, the
const
shouldn't be there, it's a copy-paste mistake from the line above it. (Usually this case doesn't happen, it's in the “no-op” version of the hysteresis class.) This should be fixed in the latest version.Since you're interested in changing the output range (the MIDI values), and not the input range (the raw analog values), I think it makes most sense to do the mapping in the MIDI sender. You could try something like this: