Add NoteExpression and MIDI event support#22
Draft
emuell wants to merge 1 commit into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
notein events is pretty confusing. It should benote_idinstead to clearly separate it fromkey. I haven't changed that and usednoteinstead as the old PitchBend event and unchanged Note events do.