mididings icon indicating copy to clipboard operation
mididings copied to clipboard

NoteOn with zero velocity are discarded

Open muranyia opened this issue 8 years ago • 7 comments

The documentation mentions: "When sending events through a MIDI output port, or by using the Sanitize() unit, velocities greater than 127 will automatically be reduced to 127, and events with a velocity less than 1 will be removed." This is a problem with AKAI control surfaces which use a MIDI note on with zero velocity for turning LEDs off. Please provide a way for zero velocity note ons to pass through (either by a compile flag, by a runtime option, or by a function argument). Thank you!

muranyia avatar Jan 04 '17 23:01 muranyia

I struggled with this problem too; I use mididings on a project of mine and it involves transforming midi events, which is a problem when 0 velocity note events occur. A runtime option or function argument would be nice, indeed.

MaurizioB avatar Jan 05 '17 01:01 MaurizioB

@MaurizioB I've commented out lines 395-397 in src/engine.cc and now I can send NoteOn events with zero velocity.

muranyia avatar Jan 09 '17 21:01 muranyia

@muranyia Thanks, I wouldn't have been able to find it. I'll try it as soon as possible.

MaurizioB avatar Jan 10 '17 15:01 MaurizioB

I got this issue too. I'm trying to find a way to write a proper driver for my Akai midimix... but I need to send event with 0 velocity

lcoenen avatar Jul 21 '18 18:07 lcoenen

Hey guys, I did a quick fix for this. See https://github.com/lcoenen/mididings/tree/akai_fix

lcoenen avatar Jul 22 '18 11:07 lcoenen

Nice. Maybe it would be better to change the option name to something more generic, like accept_mute_notes.

MaurizioB avatar Jul 24 '18 12:07 MaurizioB

I just stumpled upon this problem, too. I see no reason to discard NoteOn with velocity=0, this is a normal MIDI message, like any other (and equivalent to NoteOff). My fix just changes the sanitize() code to remove NoteOns that are outside of specification, that is < 0, not < 1. https://github.com/mcvsama/mididings/commit/9839d6241b6f62af3f994763fac257affd062a08

mcvsama avatar Mar 14 '19 21:03 mcvsama