diff --git a/src/midi.rs b/src/midi.rs index cc6e6445..86e28953 100644 --- a/src/midi.rs +++ b/src/midi.rs @@ -59,7 +59,7 @@ pub enum NoteEvent { }, /// A volume expression event, available on [`MidiConfig::Basic`] and up. Not all hosts may /// support these expressions. - Volume { + PolyVolume { timing: u32, /// The note's channel, from 0 to 16. channel: u8, @@ -70,7 +70,7 @@ pub enum NoteEvent { }, /// A panning expression event, available on [`MidiConfig::Basic`] and up. Not all hosts may /// support these expressions. - Pan { + PolyPan { timing: u32, /// The note's channel, from 0 to 16. channel: u8, @@ -82,7 +82,7 @@ pub enum NoteEvent { }, /// A tuning expression event, available on [`MidiConfig::Basic`] and up. Not all hosts may support /// these expressions. - Tuning { + PolyTuning { timing: u32, /// The note's channel, from 0 to 16. channel: u8, @@ -93,7 +93,7 @@ pub enum NoteEvent { }, /// A vibrato expression event, available on [`MidiConfig::Basic`] and up. Not all hosts may support /// these expressions. - Vibrato { + PolyVibrato { timing: u32, /// The note's channel, from 0 to 16. channel: u8, @@ -104,7 +104,7 @@ pub enum NoteEvent { }, /// A expression expression (yes, expression expression) event, available on /// [`MidiConfig::Basic`] and up. Not all hosts may support these expressions. - Expression { + PolyExpression { timing: u32, /// The note's channel, from 0 to 16. channel: u8, @@ -115,7 +115,7 @@ pub enum NoteEvent { }, /// A brightness expression event, available on [`MidiConfig::Basic`] and up. Not all hosts may support /// these expressions. - Brightness { + PolyBrightness { timing: u32, /// The note's channel, from 0 to 16. channel: u8, @@ -165,12 +165,12 @@ impl NoteEvent { NoteEvent::NoteOn { timing, .. } => *timing, NoteEvent::NoteOff { timing, .. } => *timing, NoteEvent::PolyPressure { timing, .. } => *timing, - NoteEvent::Volume { timing, .. } => *timing, - NoteEvent::Pan { timing, .. } => *timing, - NoteEvent::Tuning { timing, .. } => *timing, - NoteEvent::Vibrato { timing, .. } => *timing, - NoteEvent::Expression { timing, .. } => *timing, - NoteEvent::Brightness { timing, .. } => *timing, + NoteEvent::PolyVolume { timing, .. } => *timing, + NoteEvent::PolyPan { timing, .. } => *timing, + NoteEvent::PolyTuning { timing, .. } => *timing, + NoteEvent::PolyVibrato { timing, .. } => *timing, + NoteEvent::PolyExpression { timing, .. } => *timing, + NoteEvent::PolyBrightness { timing, .. } => *timing, NoteEvent::MidiChannelPressure { timing, .. } => *timing, NoteEvent::MidiPitchBend { timing, .. } => *timing, NoteEvent::MidiCC { timing, .. } => *timing, @@ -184,12 +184,12 @@ impl NoteEvent { NoteEvent::NoteOn { timing, .. } => *timing -= samples, NoteEvent::NoteOff { timing, .. } => *timing -= samples, NoteEvent::PolyPressure { timing, .. } => *timing -= samples, - NoteEvent::Volume { timing, .. } => *timing -= samples, - NoteEvent::Pan { timing, .. } => *timing -= samples, - NoteEvent::Tuning { timing, .. } => *timing -= samples, - NoteEvent::Vibrato { timing, .. } => *timing -= samples, - NoteEvent::Expression { timing, .. } => *timing -= samples, - NoteEvent::Brightness { timing, .. } => *timing -= samples, + NoteEvent::PolyVolume { timing, .. } => *timing -= samples, + NoteEvent::PolyPan { timing, .. } => *timing -= samples, + NoteEvent::PolyTuning { timing, .. } => *timing -= samples, + NoteEvent::PolyVibrato { timing, .. } => *timing -= samples, + NoteEvent::PolyExpression { timing, .. } => *timing -= samples, + NoteEvent::PolyBrightness { timing, .. } => *timing -= samples, NoteEvent::MidiChannelPressure { timing, .. } => *timing -= samples, NoteEvent::MidiPitchBend { timing, .. } => *timing -= samples, NoteEvent::MidiCC { timing, .. } => *timing -= samples, diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index f398a6ee..a848d4bf 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -916,7 +916,7 @@ impl Wrapper

{ }); } CLAP_NOTE_EXPRESSION_VOLUME => { - input_events.push_back(NoteEvent::Volume { + input_events.push_back(NoteEvent::PolyVolume { timing: raw_event.time - current_sample_idx as u32, channel: event.channel as u8, note: event.key as u8, @@ -924,7 +924,7 @@ impl Wrapper

{ }); } CLAP_NOTE_EXPRESSION_PAN => { - input_events.push_back(NoteEvent::Pan { + input_events.push_back(NoteEvent::PolyPan { timing: raw_event.time - current_sample_idx as u32, channel: event.channel as u8, note: event.key as u8, @@ -933,7 +933,7 @@ impl Wrapper

{ }); } CLAP_NOTE_EXPRESSION_TUNING => { - input_events.push_back(NoteEvent::Tuning { + input_events.push_back(NoteEvent::PolyTuning { timing: raw_event.time - current_sample_idx as u32, channel: event.channel as u8, note: event.key as u8, @@ -941,7 +941,7 @@ impl Wrapper

{ }); } CLAP_NOTE_EXPRESSION_VIBRATO => { - input_events.push_back(NoteEvent::Vibrato { + input_events.push_back(NoteEvent::PolyVibrato { timing: raw_event.time - current_sample_idx as u32, channel: event.channel as u8, note: event.key as u8, @@ -949,7 +949,7 @@ impl Wrapper

{ }); } CLAP_NOTE_EXPRESSION_EXPRESSION => { - input_events.push_back(NoteEvent::Expression { + input_events.push_back(NoteEvent::PolyExpression { timing: raw_event.time - current_sample_idx as u32, channel: event.channel as u8, note: event.key as u8, @@ -957,7 +957,7 @@ impl Wrapper

{ }); } CLAP_NOTE_EXPRESSION_BRIGHTNESS => { - input_events.push_back(NoteEvent::Brightness { + input_events.push_back(NoteEvent::PolyBrightness { timing: raw_event.time - current_sample_idx as u32, channel: event.channel as u8, note: event.key as u8, diff --git a/src/wrapper/vst3/note_expressions.rs b/src/wrapper/vst3/note_expressions.rs index b242d7eb..63d14ecf 100644 --- a/src/wrapper/vst3/note_expressions.rs +++ b/src/wrapper/vst3/note_expressions.rs @@ -49,7 +49,7 @@ impl NoteExpressionController { match event.type_id { // kVolumeTypeID - 0 => Some(NoteEvent::Volume { + 0 => Some(NoteEvent::PolyVolume { timing, channel, note, @@ -58,7 +58,7 @@ impl NoteExpressionController { gain: event.value as f32 * 4.0, }), // kPanTypeId - 1 => Some(NoteEvent::Pan { + 1 => Some(NoteEvent::PolyPan { timing, channel, note, @@ -66,7 +66,7 @@ impl NoteExpressionController { pan: (event.value as f32 * 2.0) - 1.0, }), // kTuningTypeID - 2 => Some(NoteEvent::Tuning { + 2 => Some(NoteEvent::PolyTuning { timing, channel, note, @@ -75,21 +75,21 @@ impl NoteExpressionController { tuning: 240.0 * (event.value as f32 - 0.5), }), // kVibratoTypeID - 3 => Some(NoteEvent::Vibrato { + 3 => Some(NoteEvent::PolyVibrato { timing, channel, note, vibrato: event.value as f32, }), // kExpressionTypeID - 4 => Some(NoteEvent::Brightness { + 4 => Some(NoteEvent::PolyBrightness { timing, channel, note, brightness: event.value as f32, }), // kBrightnessTypeID - 5 => Some(NoteEvent::Expression { + 5 => Some(NoteEvent::PolyExpression { timing, channel, note,