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.
Thanks so much for your work on this project. I'm working on a master's degree right now and focusing on automatic synthesizer programming - so your work on this and the other work you have published on deep learning for synthesizer programming has been extremely helpful!
I tracked down a bit of an issue with the way that midi notes are being added to the buffer. Timestamps in MidiMessages are ignored in the MidiBuffer.addEvent method (this is true for v5.2.0 as well). This is causing midi notes to be triggered on every buffer iteration. This is also occurring for the note off MidiMessages once they begin to be triggered (less of an issue, but since the timestamp is being used, the message isn't being triggered on the correct sample).
This PR fixes that by ensuring that only one note on MidiMessage is sent during the first buffer, and then the note off MidiMessage is being set to the correct sample in the buffer.
Here is a waveform test rendering of a sine wave with no amplitude envelope:
before:

after:
