Note Off can be "note on with velocity 0"

Bug #1643312 reported by feeling
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ttyMIDI
Invalid
Undecided
Unassigned

Bug Description

Hello,

ttyMIDI work fine, but when I use my Roland midi keyboard, notes never goes down.

I investigate the messages, and apparently, my keyboard send a "note on, with velocity 0" to stop the key, this is in phase with the midi specifications.

Can ttyMIDI be adapted to be in phase with this ?

Serial 0x90 Note on 000 072 085
Serial 0x90 Note on 000 072 000

(tested on a raspberry pi 3 with fluidsynth and the disable bluetooth patch to remap uart0).

Regards.
Laurent.

Revision history for this message
feeling (feeling001) wrote :

Here is my patch (it work fine with my roland A33, except the expression & bender lever)

  case 0x90:
   /* If the velocity is NULL, then lets handle this event like a "note off" */
   if(param2 == 0x00) {
    if (!arguments.silent && arguments.verbose)
     printf("Serial 0x%x Note off %03u %03u %03u\n", operation, channel, param1, param2);
    snd_seq_ev_set_noteoff(&ev, channel, param1, param2);
    }
   /* Else the velocity is positive, it's a real note on */
   else {
    if (!arguments.silent && arguments.verbose)
     printf("Serial 0x%x Note on %03u %03u %03u\n", operation, channel, param1, param2);
    snd_seq_ev_set_noteon(&ev, channel, param1, param2);
   }
   break;

  case 0xF0:
   /* staccato note end with an 0xF8 event (why ?) ... so let's handle that like a note off */
   if(channel == 0x08 && param2 == 0x00) {
    if (!arguments.silent && arguments.verbose)
     printf("Serial 0x%x Special off %03u %03u %03u 0x%02x\n", operation, channel, param1, param2, buf[0]);
    snd_seq_ev_set_noteoff(&ev, 0x00, param1, param2);
    break;
    }

  case 0xA0:
   if (!arguments.silent && arguments.verbose)
    printf("Serial 0x%x Pressure change %03u %03u %03u\n", operation, channel, param1, param2);
   /* I don't understand why, but fast notes are assimiled to pressure change, let's handle that like a note on .... */
   snd_seq_ev_set_noteon(&ev, 0x00, param1, param2);
   /* snd_seq_ev_set_keypress(&ev, channel, param1, param2); */
   break;

Changed in ttymidi:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.