augustofilocamo / superOrgan

CollaborativeOrgan
GNU General Public License v3.0
22 stars 2 forks source link

Bug report: percussion often triggers when it shouldn't #6

Open jlearman opened 4 years ago

jlearman commented 4 years ago

The percussion trigger should be a normal legato trigger. That is, when a note starts, if any other notes are playing, the percussion envelope should not trigger. If no other notes are playing, percussion should trigger.

CollaB3 almost works like this but not quite. If I hold one note and do a fast two-note trill, some notes trigger percussion.

The incorrect triggers happen when the new note is shortly after a previous note. A slow trill never fails; as I pick up speed my stronger finger tends to get retriggered. (If I was a better player my timing would be even, but it's not: the stronger finger is early and the weaker one is late.)

It's easy to repro and does not require a particularly fast trill. (16th notes at a little faster than 120 BPM, if I'm not mistaken.) I can provide a MIDI file that does it, if that would help.

jlearman commented 4 years ago

Aha. I see the problem is more insidious.

Ideally, percussion is modeled by feeding the percussion waveform for all notes currently playing into a single amp envelope. This envelope is triggered as described above. So, the summing of all percussion voices happens prior to the amp envelope.

Instead, you've modeled it as percussion on the initial note only (which explains why you haven't implemented long percussion.) You have a trick to catch chords so that all notes in a chord get the percussion.

Let me know if you have any questions, but my guess is that you already know this. I have no idea whether the the underlying sound engine supports summing prior to an envelope. For example, you can't do this with soundfonts or SFZ. The model doesn't allow it.