1
0
Fork 0

Parse redundant CLAP MIDI events just in case

This commit is contained in:
Robbert van der Helm 2022-04-11 15:56:33 +02:00
parent 476dfb9f81
commit 63ad2b2cb8

View file

@ -982,6 +982,33 @@ impl<P: ClapPlugin> Wrapper<P> {
let event_type = event.data[0] & midi::EVENT_TYPE_MASK;
let channel = event.data[0] & midi::MIDI_CHANNEL_MASK;
match event_type {
// Hosts shouldn't be sending this, bu twe'll handle it just in case
midi::NOTE_ON => {
input_events.push_back(NoteEvent::NoteOn {
timing: raw_event.time - current_sample_idx as u32,
channel,
note: event.data[1],
velocity: event.data[2] as f32 / 127.0,
});
}
// Hosts shouldn't be sending this, bu twe'll handle it just in case
midi::NOTE_OFF => {
input_events.push_back(NoteEvent::NoteOff {
timing: raw_event.time - current_sample_idx as u32,
channel,
note: event.data[1],
velocity: event.data[2] as f32 / 127.0,
});
}
// Hosts shouldn't be sending this, bu twe'll handle it just in case
midi::POLYPHONIC_KEY_PRESSURE => {
input_events.push_back(NoteEvent::PolyPressure {
timing: raw_event.time - current_sample_idx as u32,
channel,
note: event.data[1],
pressure: event.data[2] as f32 / 127.0,
});
}
midi::CHANNEL_KEY_PRESSURE => {
input_events.push_back(NoteEvent::MidiChannelPressure {
timing: raw_event.time - current_sample_idx as u32,