Open
Description
Original discussion and maths breakdown:
#203 (reply in thread)
Breakdown of the steps:
- Add a
handlePitchBend
callback - Calculate a multiplicative factor (multiplied by the current note)
- Update the value passed to
tone
Caveats / things to look out for:
- Note change while having bend on: the multiplicative factor should be a global variable, so that it can be applied too in
handleNoteOn
andhandleNoteOff
. - Pitch bend range: the second argument of
handlePitchBend
is an int between 0 (max downwards bend), 0x2000 (neutral position) and 0x3fff (max upwards bend). The maximum bend in semitones should be astatic const int
constant (for an additional challenge, it could follow a ControlChange).