This package provides Racket bindings for the RtMidi package. It is currently undocmented, this file notwithstanding.
This package is not self-contained. It depends on the RtMidi package, and also requires you to compile a dynamic library used to connect to the RtMidi code.
At this point, this means that installing this package will require you to locate the package directory where this package is installed.
The best way to do this is probably to install the package using raco pkg install or the package manager, and then to evaluate
(collection-path"rtmidi")
to see where the directory lives.
Once you’ve located the collection directory, you’ll need to extract http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-2.1.0.tar.gz to the collection directory. Then run ‘make $PLATFORM‘, where ‘PLATFORM‘ is one of ‘linux‘, ‘macosx‘, or ‘windows‘.
The wrapper is C++98 and should compile with any modern C++ compiler.
I haven’t tried the Windows build with this Makefile; you might need to make some adjustments.
Some stubs:
Here’s a file that uses these functions:
(requirertmidi);Create RtMidiIn and RtMidiOut(definein(make-rtmidi-in))(defineout(make-rtmidi-out));List input and output ports(definein-ports(rtmidi-portsin))(printf"Input ports: ~a~n"in-ports)(defineout-ports(rtmidi-portsout))(printf"Output ports: ~a~n"out-ports);Open the first input and output port, if any(matchin-ports[(consa-portother-ports)(rtmidi-open-portin0)][other(printf(current-error-port)"no input ports\n")])(matchout-ports[(consa-portother-ports)(rtmidi-open-portout0)][other(printf(current-error-port)"no output ports\n")]);Send a note(rtmidi-send-messageout(list14465127))(sleep0.2)(rtmidi-send-messageout(list12865127));Read incoming messages until break(letloop()(pretty-print(syncin))(loop))