MWEngine icon indicating copy to clipboard operation
MWEngine copied to clipboard

Issues with event.addToSequencer() while the sequencer is running

Open vustav opened this issue 3 years ago • 5 comments

In my app I'm having a classic sequencer UI where clicking a cell adds or removes an event to be played at that position by calling event.addToSequencer(). I've noticed that clicking these too fast while the sequencer is running causes bugs. For instance if a step is on and I double click it (turn off then immediatelly turn it on again) it won't play. After playing around with a timer in the method that handles this it seems that a pause of around 1,4 seconds is required for this to work properly. I'm certain event.addToSequencer() is being called properly and this happens while the sequencer is running, paused it works as expected.

vustav avatar Apr 24 '22 17:04 vustav

I've gotten around this by adding the events to the sequencer on creation and the never remove them, just enable/disable. Is this how it's supposed to be handled?

vustav avatar Apr 26 '22 10:04 vustav

Hm, no that seems properly broken 🙈

I think what is going is that the events are not added to the currently running sub-sequence cache (explaining why your experiment with the timeout seemed to work). I'll have a look.

(If you are testing with (Base)SynthEvents, it may be possible that the bug you highlighted in issue #146 may be the culprit)

igorski avatar Apr 26 '22 17:04 igorski

The problem is still there with the latest build.

vustav avatar Apr 27 '22 20:04 vustav

Would you have some (pseudo) code relating to all operations you do with an event when you both add and remove them when clicking on the cell pads ? I can't quite reproduce and am wondering whether the sequence of things might be an issue (I'm curious whether you also set the event position prior/after addition to the sequencer or something related).

igorski avatar Jul 25 '22 16:07 igorski

If the event is off when clicked, event.addToSequencer() is called, and the other way around. Logs show them to be called in the right order at the right time etc.

vustav avatar Jul 26 '22 12:07 vustav