Rework state handling of one-time-midi #787
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues
Fixes #758
Proposed changes
Reworks quite some internals of the synthesizer to ensure that the one time midi playback behind playBeat and playBeat are working correctly. it suffered from following issues:
Seeking during playback interfered with the playback position of the one time midi while it should seek on the main song midi. When playing notes/beats on mouse click, there happened a playback and seeking which messed up a lot of internals.
Multiple subsequent requests of playing one time midis before they actually finished also messed up some internal states.
The synth outputs reported also played samples if there weren't enough samples in the buffer. This wrongly advanced the internal player time axis.
The bounds lookup had a wrong assumption that there is only one bounds for a beat, but there can be multiple, due to this
findNoteAt
did not work correctly.There was a wrong time value passed to the midi note generation of playNote leading the note to never being played.
New: Events when a note is clicked. These events are available if the note bounds are included.
Checklist
Further details