running status problem was: (midi note-off with note-on and velocity 0)

hi everybody,

first post here...

i bought a sjs-one synth ( http://devsound.se/2012/sjs-one ), soldered it together and it all works perfect so far with a keyboard.
the real purpose for this synth was to use it with my midi bass ( http://www.industrialradio.com.au/products/pro4.php ) and here i'm running into problems. lots of held notes and a big mess :slight_smile: the midibass does not send true note-offs but note-ons with velocity 0. i looked at the code and i see there that it only recognises true note-offs to release notes. so far so good. now i tried changing the behaviour to recognise note-on with velocity 0 to act as note-off but i cannot get it to work. i attach the code and my modified version which does not work. any help or hint from an arduino/midi guru would be very much appreciated.
parts of the code are low level and i don't understand them. let me know if you need any additional infos, a dump of a midi-stream from my bass for example...

thanks!

Archive.zip (21.6 KB)

supersaw_sylt.ino (20.2 KB)

Try handling the note on 0 without dropping through to the next case.

    if( midi->data2 ) {
        // note on, add to "playlist"
        p_add( midi->data1, midi->data2 );
    } else {
        p_release( midi->data1 );
    }
    break;

Pete

thanks, but it does also not work. i am in contact now with the guy who wrote the synth code and note on with velocity 0 is already handled (the break is in the if brackets of the first case and so jumps to note off if it is 0). i found out that my bass sends midi with running status (status byte is omitted if it stays the same) and the synth does not handle that gracefully. this will be a major change in code... i will post back when i hear from the dev again.

cheers

Releasing synth code that doesn't handle running status is not acceptable now days because all MIDI transmitters use running status.

This is how to handle it:

1.Buffer is cleared (ie, set to 0) at power up.
2.Buffer stores the status when a Voice Category Status (ie, 0x80 to 0xEF) is received.
3.Buffer is cleared when a System Common Category Status (ie, 0xF0 to 0xF7) is received.
4.Nothing is done to the buffer when a RealTime Category message is received.
5.Any data bytes are ignored when the buffer is 0.

thanks! i sent the dev your implementation plan. he will fix it in the library as soon as possible.

ok, it is fixed! thanks for all the inputs.

janost:
because all MIDI transmitters use running status

This is simply not true.

There is a bit of confusion here. Using note on with zero velocity is not called running status.

Running status is where the first byte of the MIDI command is missed out and it is assumed to be the previous message.
So the first message might be "note on, of pitch 65, of velocity 127" and the second message could be "of pitch 55, of velocity 89"

There is no special name for a zero velocity note on meaning note off.

i am sorry but you did not get it right. the synth was not working properly (stuck notes). looking at the code i assumed it was because it did not handle the noteon velocity 0 case right. (when actually it did in a clever way)
later in my investigation i found out it does not handle running status. thats when i changed the topic title.
i then told the dev to fix the running status problem which he did very fast. so all is good :slight_smile:

cheers