Support receiving SysEx in JACK standalone
This commit is contained in:
parent
68d68c0bc3
commit
8d9ae19d38
1 changed files with 5 additions and 14 deletions
|
@ -121,20 +121,11 @@ impl<P: Plugin> Backend<P> for Jack {
|
||||||
|
|
||||||
input_events.clear();
|
input_events.clear();
|
||||||
if let Some(midi_input) = &midi_input {
|
if let Some(midi_input) = &midi_input {
|
||||||
input_events.extend(midi_input.iter(ps).filter_map(|midi| {
|
input_events.extend(
|
||||||
// Unless it is a SysEx message, a JACK MIDI message is always three bytes or
|
midi_input
|
||||||
// less and is normalized (starts with a status byte and is self-contained).
|
.iter(ps)
|
||||||
if midi.bytes.len() <= 3 {
|
.filter_map(|midi| NoteEvent::from_midi(midi.time, midi.bytes).ok()),
|
||||||
// JACK may not pad messages with zeroes, so messages for things like channel
|
);
|
||||||
// pressure may be less than three bytes in length.
|
|
||||||
let mut midi_data = [0u8; 3];
|
|
||||||
midi_data[..midi.bytes.len()].copy_from_slice(midi.bytes);
|
|
||||||
|
|
||||||
NoteEvent::from_midi(midi.time, &midi_data).ok()
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
output_events.clear();
|
output_events.clear();
|
||||||
|
|
Loading…
Add table
Reference in a new issue