Closed sowbug closed 1 year ago
This is solved by the new multipass main loop.
We even detect a simple version of loops -- if the sender is listening on the same channel as a message it sends, then we drop it. That doesn't prevent A -> B -> C -> A, though.
This effectively means that all messages happen simultaneously. You could imagine situations where a message is triggered only if a device is in a certain state, and that state is set by a different message. But I think it's OK, at least for now, to call that undefined.
This causes problems with controllers that send MIDI to instruments. If the instrument gets its tick() before the controller does, then it won't start emitting sound until the next batch. This all depends on how the Store hash table happens to store items for any given run.
As long as there are no cycles, then we should be able to do this all in one frame, so that they all appear to happen simultaneously.