Closed jpcima closed 5 years ago
Note: it is not optimally efficient, considering it iterates all active notes every period.
TickIterations
in the sequencerThe logic is supposed to be this: a new note will receive a Time-To-Live value in seconds.
The time will decrease every period until <= 0.
Until dropped to 0 or less, the key-off will be kept from occurring, and the flag isOnExtendedLifeTime
is true
to indicate a note which has key-off pending.
Note(2): when there will exist code to allow double notes, it must take special care for the search predicate of active-notes to ignore the one which is already flagged with isOnExtendedLifeTime
, and go for the next.
(failing to make to check, it's possible that you will double-release a note which is pending, for example)
A little song where those drums are has zero length: War3#12.mid.gz
Will try some now at my job... Yeah, it works at me, but I didn't benchmarked the thing yet, I think to do this at my home, or when you'll make the "has delayed notes" flag to don't loop this (mainly on songs are don't using percussions, or all percussions are has valid note length).
I heard the difference on "corruptdrums" files papiezak has posted on the linked issue. It worked in realtime synth, and also in midiplay compared to master branch with sequencer fix disabled. In both cases, drums could be heard which were silent before.
The commit 1de7ee2 is for caching the numer of notes which have a TTL countdown in progress.
The new function cleanupNote
syncs channel state after a note has been removed.
It's used on two occasions: note-off, and when a double-note replaces the one before with equal note number.
It fixes an overlooked problem about portamento before: if a double-note overrides a previous one, it would forget to decrement the gliding_note_count
.
Woops... This song makes a crash: Game10.mid.gz
This song makes a crash: Game10.mid.gz
Ok, let me check it.
Just now I uploaded a sample of papiezak's, on the libADLMIDI branch, as I was submitting the identical PR. OI06.MID.gz OI06.MID-after.opus.gz OI06.MID-before.opus.gz
What I know: it's from updateArpeggio
where the assertion raises. The active note does not exist.
I will study this case later.
Fixed it in the latest.
46
I wrote something quick, not really tested.