Skip to content

Add NoteExpression and MIDI event support#22

Draft
emuell wants to merge 1 commit into
ilmai:mainfrom
emuell:feature/mpe
Draft

Add NoteExpression and MIDI event support#22
emuell wants to merge 1 commit into
ilmai:mainfrom
emuell:feature/mpe

Conversation

@emuell

@emuell emuell commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
  • adds a bunch of new events (PolyXXX and MIDIXXX)
  • removes the old PitchBend event (breaking change, see below)
  • adds compiletime definitions to opt in for MIDI and note expression events with sensible defaults
  • adds note ID tracking in VST3 event handlers
  • dynamically creates dummy VST3 parameters for MIDI events as needed (which was previously done only for PitchBend)
  • forwards CLAP_NOTE_EXPRESSION events as defined by the CLAP standard if enabled

Main intention was to add MPE support and note expressions to my synth, but I ended up not dealing with MPE in the plugin-things layer. Instead, I only added the infrastructure to allow plugins to implement MPE via raw MIDI CC message handling.

The MidiCapabilities and NoteExpression gates are quite opinionated. Please let me know if you would prefer using bitflags, runtime configuration or something completely different here. I think options are definitely needed here, because enabling all MIDI events would add 16*128 parameters just for MIDI CCs, which is completely overkill. Runtime options also would work, but compile time options are a nice fit here too IMHO.

This is a breaking change. In order to handle MPE, I need to process raw MIDI Pitch Bend and tuning events separately. So the old Pitch Bend event is now delivered as either PolyTuning or MidiPitchBend.

Note expressions in CLAP are straightforward to deal with. In VST3 this is quite messy. So to unify things across standards I am here only allowing VST3 note expressions to be added from the defined set of CLAP expressions. So totally custom VST3 note expressions cannot be added via this approach.

To document and showcase all this better, I could also add a small synth example with note expressions in addition to the gain example.

BTW: The field note in events is pretty confusing. It should be note_id instead to clearly separate it from key. I haven't changed that and used note instead as the old PitchBend event and unchanged Note events do.

Allows plugins (especially synths) to react on standard CLAP NoteExpressions and MIDI messages (as
e.g. requeired for MPE support).

Event capabilities, receiving is gated via compile time consts in Plugin in order to avoid overhead.

Also extract raw MIDI-byte parsing into a new shared helper function, used by both the CLAP MIDI
event path and the standalone host's MIDI input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant