[CM] Receiving from portmidi

Rick Taube taube at uiuc.edu
Sun, 2 Dec 2007 09:41:49 -0600

sorry forget to append test code that shows how to use it:


(in-package cm)

(use-system :portmidi)
(pprint (pm:GetDeviceInfo ))
(defparameter pm (portmidi-open :input 1 :output 2))
(recv pm)
(recv? pm)

;; printout may or may not work under the callback depending on your
;; lisp. if not then look at mymessages to see if it worked.

(defparameter mymessages (list))
(recv-set! pm (lambda (m) (print m) (push m mymessages ) ))
(print mymessages)
(mapcar #'(lambda (m) (midi-print-message m 0)) mymessages)
(recv-stop pm)