Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for nil midi data bytes (active sensing, etc) #658

Merged
merged 2 commits into from Nov 25, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -102,19 +102,19 @@ void* dev_midi_start(void *self) {
msg_buf[msg_pos] = byte;
msg_pos += 1;
}
}

if (msg_pos == msg_len) {
ev = event_data_new(EVENT_MIDI_EVENT);
ev->midi_event.id = midi->dev.id;
ev->midi_event.data[0] = msg_buf[0];
ev->midi_event.data[1] = msg_len > 1 ? msg_buf[1] : 0;
ev->midi_event.data[2] = msg_len > 2 ? msg_buf[2] : 0;
ev->midi_event.nbytes = msg_len;
event_post(ev);

msg_pos = 0;
msg_len = 0;
if (msg_pos == msg_len) {
ev = event_data_new(EVENT_MIDI_EVENT);
ev->midi_event.id = midi->dev.id;
ev->midi_event.data[0] = msg_buf[0];
ev->midi_event.data[1] = msg_len > 1 ? msg_buf[1] : 0;
ev->midi_event.data[2] = msg_len > 2 ? msg_buf[2] : 0;
ev->midi_event.nbytes = msg_len;
event_post(ev);

msg_pos = 0;
msg_len = 0;
}
}
} while (read > 0);

ProTip! Use n and p to navigate between commits in a pull request.