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

add SYSEX handler for LV2 #3

Open
wants to merge 1 commit into
base: headless
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Synth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ if((buffer[0]&0xF0) == 0xB0 && buffer[1]==99) { dx7.printEGS(); return; }
for(unsigned i=0; i<size; i++) dx7.midiSerialRx.write(buffer[i]);
}

void DX7Synth::queueSysEx(const uint32_t size, const uint8_t *const buffer) {
for (uint32_t i = 0; i < size; ++i) {
dx7.midiSerialRx.write(buffer[i]);
}
}


// Parse MIDI stream coming from CPU into discrete messages for Jack
bool DX7Synth::queueMidiTx(uint32_t& s, uint8_t* &buffer) {
Expand Down
2 changes: 2 additions & 0 deletions src/Synth.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Synth {

// Midi I/O
virtual void queueMidiRx(const uint32_t size, const uint8_t *const buffer) {}
virtual void queueSysEx(const uint32_t size, const uint8_t *const buffer) {}
virtual bool queueMidiTx(uint32_t& size, uint8_t* &buffer) { return false; }

float outputBuffer[Synth::BufSize]; // Audio buffer
Expand Down Expand Up @@ -84,6 +85,7 @@ class DX7Synth : public Synth {

// Receive MIDI input and send to DX7
virtual void queueMidiRx(const uint32_t size, const uint8_t *const buffer);
virtual void queueSysEx(const uint32_t size, const uint8_t *const buffer);
bool parseMIDI(const uint32_t size, const uint8_t *const buffer);
bool serial = false; // Use DX7's native serial interface rather than sub-CPU for MIDI
void useSerialMidi(bool on) { serial = on; }
Expand Down
1 change: 1 addition & 0 deletions src/lv2_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ struct DX7Plugin {
case LV2_MIDI_MSG_PGM_CHANGE: dx7.queueMidiRx(2, msg); break;
case LV2_MIDI_MSG_CHANNEL_PRESSURE: dx7.queueMidiRx(2, msg); break;
case LV2_MIDI_MSG_BENDER: dx7.queueMidiRx(3, msg); break;
case LV2_MIDI_MSG_SYSTEM_EXCLUSIVE: dx7.queueSysEx(ev->body.size, msg); break;
default: break;
}
} else if (ev->body.type == uris.atom_Int) {
Expand Down