mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Add voice ID fields for all non-MIDI note events
This will be useful when adding polyphonic modulation.
This commit is contained in:
@@ -49,99 +49,117 @@ impl Plugin for MidiInverter {
|
||||
match event {
|
||||
NoteEvent::NoteOn {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
velocity,
|
||||
} => context.send_event(NoteEvent::NoteOn {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
velocity: 1.0 - velocity,
|
||||
}),
|
||||
NoteEvent::NoteOff {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
velocity,
|
||||
} => context.send_event(NoteEvent::NoteOff {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
velocity: 1.0 - velocity,
|
||||
}),
|
||||
NoteEvent::PolyPressure {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
pressure,
|
||||
} => context.send_event(NoteEvent::PolyPressure {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
pressure: 1.0 - pressure,
|
||||
}),
|
||||
NoteEvent::PolyVolume {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
gain,
|
||||
} => context.send_event(NoteEvent::PolyVolume {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
gain: 1.0 - gain,
|
||||
}),
|
||||
NoteEvent::PolyPan {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
pan,
|
||||
} => context.send_event(NoteEvent::PolyPan {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
pan: 1.0 - pan,
|
||||
}),
|
||||
NoteEvent::PolyTuning {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
tuning,
|
||||
} => context.send_event(NoteEvent::PolyTuning {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
tuning: 1.0 - tuning,
|
||||
}),
|
||||
NoteEvent::PolyVibrato {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
vibrato,
|
||||
} => context.send_event(NoteEvent::PolyVibrato {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
vibrato: 1.0 - vibrato,
|
||||
}),
|
||||
NoteEvent::PolyExpression {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
expression,
|
||||
} => context.send_event(NoteEvent::PolyExpression {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
expression: 1.0 - expression,
|
||||
}),
|
||||
NoteEvent::PolyBrightness {
|
||||
timing,
|
||||
voice_id,
|
||||
channel,
|
||||
note,
|
||||
brightness,
|
||||
} => context.send_event(NoteEvent::PolyBrightness {
|
||||
timing,
|
||||
voice_id,
|
||||
channel: 15 - channel,
|
||||
note: 127 - note,
|
||||
brightness: 1.0 - brightness,
|
||||
|
||||
Reference in New Issue
Block a user