DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::plugin::MidiEvent Struct Reference

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
}
 

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.
 

Detailed Description

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. 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.

Definition at line 386 of file DSParkPlugin.h.

Member Enumeration Documentation

◆ Type

Enumerator
NoteOn 

note = key, value = velocity 0..1.

NoteOff 

note = key, value = release velocity 0..1.

PitchBend 

value = bend -1..+1 (note unused).

ControlChange 

note = controller number, value = 0..1.

ChannelPressure 

value = pressure 0..1 (note unused).

PolyPressure 

note = key, value = pressure 0..1.

Definition at line 388 of file DSParkPlugin.h.

Member Data Documentation

◆ channel

uint8_t dspark::plugin::MidiEvent::channel = 0

0..15.

Definition at line 399 of file DSParkPlugin.h.

◆ note

uint8_t dspark::plugin::MidiEvent::note = 0

Key 0..127, or controller number for CC.

Definition at line 400 of file DSParkPlugin.h.

◆ sampleOffset

int dspark::plugin::MidiEvent::sampleOffset = 0

Frames into the NEXT processBlock call.

Definition at line 402 of file DSParkPlugin.h.

◆ type

Type dspark::plugin::MidiEvent::type = Type::NoteOn

Definition at line 398 of file DSParkPlugin.h.

◆ value

float dspark::plugin::MidiEvent::value = 0.0f

Velocity / CC / pressure 0..1; bend -1..+1.

Definition at line 401 of file DSParkPlugin.h.


The documentation for this struct was generated from the following file: