From: Clemens Ladisch Date: Mon, 22 Jun 2009 08:00:46 +0000 (+0200) Subject: seq_midi_event: fix decoding of (N)RPN events X-Git-Tag: v1.0.21~32^2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=394b376b3b10308a5d21da7ef87f002b4bf07bf8;p=alsa-lib.git seq_midi_event: fix decoding of (N)RPN events When decoding (N)RPN sequencer events into raw MIDI commands, the extra_decode_xrpn() function had accidentally swapped the MSB and LSB controller values of both the parameter number and the data value. Signed-off-by: Clemens Ladisch --- diff --git a/src/seq/seq_midi_event.c b/src/seq/seq_midi_event.c index 92c749ab..53d05725 100644 --- a/src/seq/seq_midi_event.c +++ b/src/seq/seq_midi_event.c @@ -567,10 +567,10 @@ static int extra_decode_xrpn(snd_midi_event_t *dev, unsigned char *buf, int coun if (dev->nostat && count < 12) return -ENOMEM; cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f); - bytes[0] = ev->data.control.param & 0x007f; - bytes[1] = (ev->data.control.param & 0x3f80) >> 7; - bytes[2] = ev->data.control.value & 0x007f; - bytes[3] = (ev->data.control.value & 0x3f80) >> 7; + bytes[0] = (ev->data.control.param & 0x3f80) >> 7; + bytes[1] = ev->data.control.param & 0x007f; + bytes[2] = (ev->data.control.value & 0x3f80) >> 7; + bytes[3] = ev->data.control.value & 0x007f; if (cmd != dev->lastcmd && !dev->nostat) { if (count < 9) return -ENOMEM;