PortMidi provides bindings for the PortMusic MIDI API.
To build PortMidi from source you will need an F# 3.0 compiler and .NET development environment. The
.sln files in the source directory should be understood by command line tools like Microsoft's msbuild or Mono's xbuild as well as IDEs such as MonoDevelop or VisualStudio.
PortMidi provides a few utilities to construct MIDI events and to handle timing. Apart from that it allows you to construct disposable
PortMidi.MidiOutputStream objects that wrap the native library functionality.
A simple MIDI output example may look like this:
open PortMidi use out = new MidiOutputStream(MidiOutputStream.DefaultDevice, latency = 10) out.Write(MidiEvent(ProgramChange, 0uy)) let events = MidiEvent.WithTimebase(Note.play 800 [ Note.C 4; Note.E 4; Note.G 4 ]) out.Write(events) MidiEvent.Await(events)