Browse Source

Simplify the MIDI to microX conversion

master
Damien Goutte-Gattat 9 years ago
parent
commit
a4765c12a4
  1. 13
      src/microx.c

13
src/microx.c

@ -343,18 +343,11 @@ kmx_microx_dump(midi_io_t *midi,
* microX internal representation, the sixth byte of that
* group has its 8th bit set; so the real value of that byte
* is not 16, as transmitted, but 96.
*
* FIXME: The following conversion code is really ugly.
*/
for ( ; i < n; i++, k++ ) {
if ( k % 8 == 0 ) {
for ( m = 0; m < 7; m++ ) {
if ( (reply[i] >> m) & 0x1 )
data[j+m] = 0x80;
else
data[j+m] = 0;
}
}
if ( k % 8 == 0 )
for ( m = 0; m < 7; m++ )
data[j+m] = (reply[i] >> m) << 7;
else
data[j++] += reply[i];
}

Loading…
Cancel
Save