compose icon indicating copy to clipboard operation
compose copied to clipboard

Added JavaSound MIDI player

Open bhoward opened this issue 9 years ago • 1 comments

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).

bhoward avatar Jun 30 '16 19:06 bhoward

This is really useful. Why isn't it merged yet though?

omelkonian avatar Aug 07 '16 12:08 omelkonian