Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Dec 01, 2011
Werner Almesberger wpwrak softusb: don't forget notifying the host when there are news from MIDI
The host interrupt wasn't asserted when enqueuing MIDI messages.
No surprise some controls acted strangely ...
dbcce91
Werner Almesberger wpwrak softusb: accept everything but non-MIDI and system messages
This patch removes the limitation to control change messages. We can
now also have "piano" notes and so on.
58daf4c
Showing with 7 additions and 2 deletions.
  1. +7 −2 softusb-input/main.c
9 softusb-input/main.c
View
@@ -485,6 +485,7 @@ static char process_midi(unsigned char *buf, unsigned char len)
{
unsigned char end = len & ~3;
unsigned char i, m, j;
+ char sent_something = 0;
/*
* In theory, control changes should be heralded by a CIN of 0xB,
@@ -496,14 +497,18 @@ static char process_midi(unsigned char *buf, unsigned char len)
*/
for(i = 0; i != end; i += 4) {
- if((buf[i+1] & 0xf0) != 0xb0) /* not a control change */
+ unsigned char type = buf[i+1] & 0xf0;
+
+ /* ignore non-MIDI and all system messages */
+ if(type < 0x80 || type == 0xf0)
continue;
m = COMLOC_MIDI_PRODUCE;
for(j = 0; j != 4; j++)
COMLOC_MIDI(4*m+j) = buf[i+j];
COMLOC_MIDI_PRODUCE = (m + 1) & 15;
+ sent_something = 1;
}
- return 0;
+ return sent_something;
}
static void poll(struct ep_status *ep,

No commit comments for this range

Something went wrong with that request. Please try again.