An interface to RtMidi for Chez Scheme.
(import (rtmidi))
(define midiout (rtmidi-out-create-default))
(define channel 0)
(cond
((zero? midiout)
(display "Unable to create default MIDI out."))
(else
(let ([portcount (rtmidi-get-port-count midiout)])
(cond
((zero? portcount)
(display "No output ports.\n"))
(else
(rtmidi-open-port midiout 0 (rtmidi-get-port-name midiout 0))
(rtmidi-send-program-change midiout channel 5)
(rtmidi-send-control-change midiout channel 7 10)
(rtmidi-send-note-on midiout channel 64 90)
(sleep (make-time 'time-duration (* 250 1000000) 0))))
(rtmidi-send-note-off midiout channel 64 0)
(rtmidi-close-port midiout))
(rtmidi-out-free midiout)
)
)
- Scheme-style interface to RtMidi
- Full marshalling of Scheme data to C data
- Lower level ftype interface provided
-
Install Chez Scheme and RtMidi.
-
Add Chez-RtMidi to the Chez Scheme library path.
export CHEZSCHEMELIBDIRS="/path/to/chez-rtmidi/lib:$CHEZSCHEMELIBDIRS"
- Run an example
scheme --script ./simple.scm