Add voice ID fields for all non-MIDI note events

This will be useful when adding polyphonic modulation.
This commit is contained in:
Robbert van der Helm
2022-07-04 18:31:59 +02:00
parent f11b3c1a03
commit a2f8a9bebf
6 changed files with 209 additions and 22 deletions

View File

@@ -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,