Skip to content

Commit

Permalink
AlsaDriver: Add RPN/NRPN support
Browse files Browse the repository at this point in the history
If you can get them into the .rg file (xml editing), they will go out.

Feature Request #467
  • Loading branch information
tedfelix committed Jul 18, 2024
1 parent b20864a commit 776dcad
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/sound/AlsaDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 776dcad

Please sign in to comment.