FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
207 stars 49 forks source link

MIDI note_off issue #235

Closed moonshaadow closed 1 year ago

moonshaadow commented 2 years ago

Describe the bug New midi features are really nice. But a strange behavior is always here. When I send a note_off message, LiSP read it as a note_on.

Then if I try to manually set a note_off message, this is not working as expected.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Edit Cue > Cue Control > Midi Controls
  2. Click on capture
  3. send a midi note_on then a midi_note_off
  4. See that both two messages are set to "NOTE_ON"

OR:

  1. Add manually a note_on midi control and set it to START (not DEFAULT)
  2. Add manually a note_off midi control with same datas and set it to STOP (not DEFAULT)
  3. test the behavior of the midi note and see that note_on action is ok but note_off action does nothing

Expected behavior NOTE_OFF should be correctly recognized and should trigger action .

Screenshots Capture d’écran du 2022-03-02 23-55-09

Linux Show Player version: built from development branch

OS Version Debian Testing

FrancescoCeruti commented 2 years ago

I'm unable to reproduce the behavior. Can you tell me how did you send the midi messages?

MIDI is mostly handled via an external library (mido), maybe it's related to this https://github.com/mido/mido/issues/130 ?

moonshaadow commented 2 years ago

I send the messages with a midi keyboard, I could try with others tools if you want. But I trust the output of Gmidimonitor, which is good for this task. I've tried with another monitor as well.

FrancescoCeruti commented 2 years ago

I'm testing using https://vmpk.sourceforge.io/ and monitoring with Gmidimonitor or https://kmidimon.sourceforge.io/ I get the same readings of the application.

The only exception is the one mentioned before in the link (note_on with 0 velocity might be interpreted differently).

I might try to build a VM to test on Debian :thinking:

Stav88 commented 2 years ago

I reproduce the bug using material (ProdipeMIDIlilo). So I try to test with VMPK but it doesn't produce the bug. It seems the it need a midi device.

Tested OS :

Tested application versions :

Material :

I have try to log the message in MIDIInput.__new_message(). Followin are messages I received when I press a note of my keyboard and release it :

01:42:39.062 INFO:: note_on channel=0 note=36 velocity=64 time=0
01:42:41.770 INFO:: note_on channel=0 note=36 velocity=0 time=0

Note that if I trace using aseqdump -p 32, I see :

 32:0   Note on                 0, note 36, velocity 64
 32:0   Note off                0, note 36

As we can see in aseqdump source code and in gmidimonitor source code, velocity=0 is translated to Note off. The bug of mido, you have quoted, don't.