|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
One incoming MIDI-ish event, normalised across formats. More...
#include <DSParkPlugin.h>
Public Types | |
| enum class | Type : uint8_t { NoteOn , NoteOff , PitchBend , ControlChange , ChannelPressure , PolyPressure , NoteExpression , NoteModulation } |
| enum class | ExpressionType : uint8_t { Volume , Pan , Tuning , Vibrato , Expression , Brightness , Pressure } |
| The per-voice expressions of Type::NoteExpression. More... | |
Public Attributes | |
| Type | type = Type::NoteOn |
| uint8_t | channel = 0 |
| 0..15. | |
| uint8_t | note = 0 |
| Key 0..127, or controller number for CC. | |
| float | value = 0.0f |
| Velocity / CC / pressure 0..1; bend -1..+1. | |
| int | sampleOffset = 0 |
| Frames into the NEXT processBlock call. | |
| bool | choke = false |
| NoteOff only: end the voice now, no release. | |
| ExpressionType | expression = ExpressionType::Volume |
| NoteExpression only. | |
| int16_t | param = -1 |
| NoteModulation only: the parameter index. | |
| int32_t | noteId = -1 |
| Host voice id of the note (-1: none given). | |
One incoming MIDI-ish event, normalised across formats.
VST3 delivers notes as native events and pitch bend / CC / pressure through its controller-mapping scheme; CLAP delivers note events plus raw MIDI; AU delivers raw MIDI bytes or, from hosts that send event lists, MIDI 2.0 messages (16-bit velocity, 32-bit controllers and bend, kept at that resolution in value). The wrapper translates ALL of them into this one struct so the plugin handles a single vocabulary.
sampleOffset is the event's position in frames RELATIVE TO THE NEXT processBlock call: events are always delivered (in time order) right before the block that contains them. A simple plugin may ignore the offset (worst error: one automation quantum); a sample-accurate synth starts its voice exactly sampleOffset frames into the block.
A NoteOff with choke set asks for the voice to stop at once, with no release phase (a CLAP NOTE_CHOKE, sent by hosts for choke groups such as an open hi-hat cut by a closed one). It is still a NoteOff, so a plugin that never reads the flag releases the voice exactly as before.
Two event types address ONE voice, by its channel, key and noteId (the id the host gave the voice's NoteOn, -1 when it gave none): the wrapper resolves the host's wildcards (every voice of a key, of a channel, of the port) against the voices it delivered, so the plugin always sees an exact voice.
expression (an ExpressionType) says which and value carries it - Volume a linear gain 0..4, Pan 0..1 (0.5 centre), Tuning semitones -120..+120, the others 0..1. A statement of value, not an increment; a voice starts from its neutral value (gain 1, pan 0.5, tuning 0) until one arrives. CLAP hosts send every type; VST3 hosts send the ones the class declares (see HasNoteExpressions).param is the parameter index. Comes from CLAP hosts. Ignore the types you do not use (a default: in the switch keeps working as types are added). Definition at line 633 of file DSParkPlugin.h.
|
strong |
The per-voice expressions of Type::NoteExpression.
Definition at line 648 of file DSParkPlugin.h.
|
strong |
Definition at line 635 of file DSParkPlugin.h.
| uint8_t dspark::plugin::MidiEvent::channel = 0 |
0..15.
Definition at line 660 of file DSParkPlugin.h.
| bool dspark::plugin::MidiEvent::choke = false |
NoteOff only: end the voice now, no release.
Definition at line 664 of file DSParkPlugin.h.
| ExpressionType dspark::plugin::MidiEvent::expression = ExpressionType::Volume |
NoteExpression only.
Definition at line 665 of file DSParkPlugin.h.
| uint8_t dspark::plugin::MidiEvent::note = 0 |
Key 0..127, or controller number for CC.
Definition at line 661 of file DSParkPlugin.h.
| int32_t dspark::plugin::MidiEvent::noteId = -1 |
Host voice id of the note (-1: none given).
Definition at line 667 of file DSParkPlugin.h.
| int16_t dspark::plugin::MidiEvent::param = -1 |
NoteModulation only: the parameter index.
Definition at line 666 of file DSParkPlugin.h.
| int dspark::plugin::MidiEvent::sampleOffset = 0 |
Frames into the NEXT processBlock call.
Definition at line 663 of file DSParkPlugin.h.
| Type dspark::plugin::MidiEvent::type = Type::NoteOn |
Definition at line 659 of file DSParkPlugin.h.
| float dspark::plugin::MidiEvent::value = 0.0f |
Velocity / CC / pressure 0..1; bend -1..+1.
Definition at line 662 of file DSParkPlugin.h.