x42 / midifilter.lv2

LV2 plugins to filter midi events
https://x42-plugins.com/x42/x42-midifilter
GNU General Public License v2.0
70 stars 20 forks source link

NoDup (MIDI Duplicate Blocker) blocks both notes #17

Closed fraunos closed 6 years ago

fraunos commented 6 years ago

NoDup leaves only single notes, when there's two (a duplicate occurs) it blocks both, so if you would use a controller that is not capable of emitting single notes (always plays duplicates) you would hear nothing.

x42 commented 6 years ago

I cannot reproduce this. If I send two (or more) note-on events for the same note, the first note-on event is passed.

Then all note-on events (for the same note) are blocked until an equal number note-off events are received. The last note-off is passed and the filter only ever passes a single event.

In a quick test It works just fine with an emulated keyboard that sends duplicate events. Can you please elaborate how this fails for you?

x42 commented 6 years ago

Here's what it looks in Ardour, using duplicate and triple events:

dup-blocker dup-block-3

fraunos commented 6 years ago

Alright, it could be something else wrong with my setup. I found out it occurs only, when I record the pads, not the keys. Below are the midi files recorded. It may be related to After Touch function, which I am currently unable to turn off to check if it helps... Also it occurs only on playback - during live playing it shows only KP events (After Touch) or sometimes just works... When I inpect MIDI files it looks like there are no duplicates actually. I am not really sure what it is, but when playing back some notes are to loud, as if they where duplicated, and when I put the Duplicate Blocker the notes are gone.

output

drums midi.zip

x42 commented 6 years ago

There are duplicate note-on events without matching note-off. (All the missing note-offs are at the end of the midi file).

e.g. On, On, On, On, Off .... On, Off, On Off .... Off, Off, Off

I don't yet know a good solution to work around this, but this explains why no-dup does not work in this case.

Dumping the .mid with https://github.com/markc/midicomp shows

midicomp drums_pads.mid  | grep -v SeqSpec | grep n=36

74791 On ch=10 n=36 v=127
80724 Off ch=10 n=36 v=127
135331 On ch=10 n=36 v=127
135331 On ch=10 n=36 v=127
135331 On ch=10 n=36 v=127
135331 On ch=10 n=36 v=127
135331 On ch=10 n=36 v=127
140571 Off ch=10 n=36 v=127
163726 On ch=10 n=36 v=127
167297 Off ch=10 n=36 v=127
208713 On ch=10 n=36 v=127
208713 On ch=10 n=36 v=127
208713 On ch=10 n=36 v=127
208713 On ch=10 n=36 v=127
218504 Off ch=10 n=36 v=127
....
fraunos commented 6 years ago

Thanks for analyzing! It will definitely help to find a solution, if there exists an easy one. Just to note, I am using a Swissonic ControlKey 88, if it's more hardware related it could be helpful to know.

fraunos commented 6 years ago

Alright, sorry for bothering! I guess it's completely hardware related, found out there's a button for disabling After Touch and it works now. Cool! Thanks for very helpful insights and awesome plugins!