From 776dcad595c331f7ee0b604f79f0b6da027742f7 Mon Sep 17 00:00:00 2001 From: Ted Felix Date: Wed, 17 Jul 2024 21:29:10 -0400 Subject: [PATCH] AlsaDriver: Add RPN/NRPN support If you can get them into the .rg file (xml editing), they will go out. Feature Request #467 --- src/sound/AlsaDriver.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/sound/AlsaDriver.cpp b/src/sound/AlsaDriver.cpp index 84f34b949..7e8deb2f5 100644 --- a/src/sound/AlsaDriver.cpp +++ b/src/sound/AlsaDriver.cpp @@ -4022,8 +4022,8 @@ AlsaDriver::processMidiOut(const MappedEventList &rgEventList, sprintf(out, "%c", MIDI_END_OF_EXCLUSIVE); sysExData += out; - // Note: sysExData needs to stay around until this event - // is actually sent. event has a pointer to its contents. + // Note: sysExData needs to stay around until this event is + // actually sent. event has a pointer to its contents. snd_seq_ev_set_sysex(&alsaEvent, sysExData.length(), (char*)(sysExData.c_str())); @@ -4064,6 +4064,26 @@ AlsaDriver::processMidiOut(const MappedEventList &rgEventList, rgEvent->getData2()); break; + case MappedEvent::MidiRPN: + // Based on snd_seq_ev_set_controller(). + // There is no snd_seq_ev_set_regparam(). + alsaEvent.type = SND_SEQ_EVENT_REGPARAM; + snd_seq_ev_set_fixed(&alsaEvent); + alsaEvent.data.control.channel = channel; + alsaEvent.data.control.param = rgEvent->getNumber(); + alsaEvent.data.control.value = rgEvent->getValue(); + break; + + case MappedEvent::MidiNRPN: + // Based on snd_seq_ev_set_controller(). + // There is no snd_seq_ev_set_nonregparam(). + alsaEvent.type = SND_SEQ_EVENT_NONREGPARAM; + snd_seq_ev_set_fixed(&alsaEvent); + alsaEvent.data.control.channel = channel; + alsaEvent.data.control.param = rgEvent->getNumber(); + alsaEvent.data.control.value = rgEvent->getValue(); + break; + // These types do nothing here, so go on to the // next iteration. case MappedEvent::Audio: