Skip to content

Add pitch bend support to the SimpleSynth example #205

Open
@franky47

Description

@franky47

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 and handleNoteOff.
  • 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 a static const int constant (for an additional challenge, it could follow a ControlChange).

Metadata

Metadata

Assignees

No one assigned

    Labels

    examplesRelates to code in Examplesgood first issueIdeal for first-time open source contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions