I just released midi_synth v0.3.0 which is a substantial update to the library. Unfortunately, it is completely backwards incompatible with v0.2.0, but on the plus side, it fixes quite a few big mistakes I made a couple years ago.
The main module,
MIDISynth, only handles low level MIDI commands now. I moved the helper functions for playing simple songs and for encoding MIDI commands to other modules. My hope is that other libraries can build upon the flexibility of being able to send nearly any MIDI command to
midi_synth and not be constrained the library. See the docs for examples. I think that the changes that need to be made to existing code are self-explanatory since the API was pretty small anyway.
Besides the name changes and API functions moving around, you now need to start a software MIDI synth yourself. You can do that by calling
MIDISynth.start_link/1 manually or by including it in one of your supervision trees.
Other improvements include:
- All configuration is passed to
MIDISynth.start_link/1. I removed the one use of the application environment, so you can now start up multiple synthesizers with different sound fonts if you want.
- C code gets built under
_build. This sounds small, but it prevents a number of issues especially if anyone ever starts cross-compiling
midi_synth for Nerves.
- The build system automatically downloads a Creative Commons-licensed general MIDI soundfont. This step could be improved, but at the moment, it simplifies getting started and this soundfont file is probably sufficient for most people.
I’ve tested this on OSX and Linux, and it seems to work. Of course, it’s audio, so Linux friends, please help if there are settings that you need tweaked or need to be exposed as user-configurable.