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.
I've been having trouble with the SuperCollider-based player, so I created a JavaSound (MIDI) version. It's pretty straightforward, except all the real work is done in the shutdown method -- up to that point, it just collects up a bunch of MidiEvents to be added to a Sequencer.
The MidiMain app is a variant of Main that uses the new player. It has one additional demo -- scales with overlap -- because one issue with MIDI is that I'm only using one channel and it doesn't like to have the same pitch turned on twice for overlapping notes. The player handles this case by only generating a NOTE ON message for the first of overlapping requests, and only generating a NOTE OFF for the last.
Two settings were added to build.sbt to run the demo in a forked JVM, because without forking the JavaSound devices don't work (see http://stackoverflow.com/questions/18676712/java-sound-devices-found-when-run-in-intellij-but-not-in-sbt).