[CM] CM, rt, portmidi osx, linux

andersvi@extern.uio.no andersvi@extern.uio.no
Wed, 08 Feb 2006 16:19:27 +0100


Hi there.

Im trying to get CM running with (set-receiver! ...) without much
luck here.

Mac:

How do i compile libportmidi.a to a shared library?

Linux:

CM cvs-snapshot from before 31/12/05, trying with portmidi,
midishare, cmucl-19a and SBCL 0.9.9.16 both with and without
thread-support.

Portmidi *out* from CM works in both cmucl and sbcl on the
linux-box here.  However i cant get anything in.
(pm::getdeviceinfo) lists a lot of plausible devices, such as

 (:ID 11 :NAME "Synth input port (20278:0)" :TYPE :OUTPUT :OPEN NIL)
 (:ID 12 :NAME "Virtual Keyboard" :TYPE :INPUT :OPEN NIL)

doing:

> (define *pm*
   (portmidi-open :output 11 :latency 0))

> (define (zzz len lb ub wai amp)
   (process repeat len
            output (new midi :time (now)
                        :duration .1 :amplitude amp
                        :keynum (between lb ub))
            wait wai))

> (rts (list (zzz 50 20 50 .5 .5)) *pm*)

plays nice piano-sounds from fluidsynth, and im able to sprout
processes in the queue:
 
 (sprout (utsleng 2))

adds further notes to the output while the first is playing.

However,

> (define *pm* (portmidi-open :input 12 :output 11 :latency 0))

> (set-receiver! #'(lambda (mm ms) mm (print ms)) *pm*)

and playing my virtual keyboard here crashes cmucl, and hits an
error in sbcl.

If someone has this working on a linux machine with portmidi,
would they be kind enought to post some info about versions of
lisp/CM/portmidi?

-anders