Woyten / tune

Make xenharmonic music and create synthesizer tuning files for microtonal scales.
MIT License
134 stars 6 forks source link

MIDI in leaves GUI artefacts #39

Closed tank-trax closed 2 years ago

tank-trax commented 2 years ago

Mint Uma 20.2 using PipeWire 0.3.39

./microwave run --midi-in "QuNexus MIDI 1" connects to the device but does not appear to release the note when the key is no longer being pressed

Here are 3 examples, using keyboard and mouse which work well, and then midi which leaves the residuals

https://user-images.githubusercontent.com/41337033/142774085-6f02909c-06e9-46b2-9fc0-f901591927cc.mp4

Woyten commented 2 years ago

@tank-trax Thanks for reporting the issue. I am unable to reproduce the problem. Can you execute ./microwave run --log --midi-in "QuNexus MIDI 1" to verify that your synth sends Note-Off events?

tank-trax commented 2 years ago

that looks to be it

[DEBUG] MIDI message received:
ChannelMessage {
    channel: 0,
    message_type: NoteOn {
        key: 59,
        velocity: 1,
    },
}

[DEBUG] MIDI message received:
ChannelMessage {
    channel: 0,
    message_type: NoteOn {
        key: 59,
        velocity: 0,
    },
}
tank-trax commented 2 years ago

I tested using midimon and it looks to be the Midi Controller at issue...

after playing C D E F G , there is Note On with a key and pressure value and rather than a Note Off gives a Note On with 0 pressure

image

if you want I can close this, unless you want to adapt to this MIDI controller's messages

Woyten commented 2 years ago

@tank-trax Thanks for investigating the problem! Can you tell whether sending NoteOn with velocity 0 instead of NoteOff is a common thing?

tank-trax commented 2 years ago

@Woyten uncertain if t is common... it is the behaviour of the QuNexus... am going to see if the Editor can make it send Note Off instructions rather than Note On 0

all other soft synths I've tried to date are able to stop playing notes when any of the keys are released, so my hunch is that it is not uncommon

perhaps a command that says something like if Note On 0 = Note Off

tank-trax commented 2 years ago

closing this... there was an issue with the device, updated firmware and it applied the Toggle Off function... now there's a Note Off upon release

thanks!!! and apologies but cool thing is your app helped me discover a bug in my hardware

Woyten commented 2 years ago

Haha! The magic of software: 1 problem arises and 2 people are getting smarter.

Anyway, I will address this problem at some point in the future. Printing warnings for doubled NoteOn events would be a first step. Adding some NoteOn { velocity: 0, .. } == NoteOff { .. } option would be a second one.

BTW: It seems to be a more common case than I thought: https://forum.bome.com/t/midi-keyboard-sends-note-on-of-velocity-0-instead-of-note-off-how-to-trigger-only-once/2500. But WHY???

Woyten commented 2 years ago

@tank-trax I just happened to buy a MIDI controller which sends NoteOn instead of NoteOff s.t. I finally decided to handle this special case in the newest tune-cli and microwaves releases. It's a stupid workaround with disadvantages: Now, when I press a key very very slowly, tune-cli and microwave think it's NoteOff...