FortySevenEffects / arduino_midi_library

MIDI for Arduino
MIT License
1.59k stars 255 forks source link

MIDI.sendPitchBend() Problem #345

Open matalog opened 6 months ago

matalog commented 6 months ago

The description of MIDI.sendPitchBend() here https://fortyseveneffects.github.io/arduino_midi_library/a00032.html#gaaaf16c1334640e690ecbd835d645e4cb is not correct. The negative values of the float f are not converted to negative numbers - they end up positive, so a sweep of the full range of pitch bend values with float from -1 to 1 results in an initial higher bend down to zero and back up to a higher bend again, instead of an initial low bend to zero to high bend.

I was able to use the MIDI.sendPitchBend() correctly by leaving out your code, and scaling my values to signed 16 (14) bit integers and putting that directly in MIDI.sendPitchBend(s14int,1) for example.

marchingband commented 4 months ago

Same here, I am using ESP32-S3, not sure if this is an arch related bug. I noticed MIDI_PITCHBEND_MAX is 8191, perhaps if it was 8191.0 it would work as intended.