[CM] Sbcl and realtime cm

Ken renueden@earthlink.net
Fri, 06 Oct 2006 11:06:26 -0700


Rick Taube wrote:
> i just ran some short tests of rts and portmidi on my linux box:
>     planet ccrma
>     sbcl 0.9.10
>     cffi 0.9.1
>
> and portmidi input works and the timing of algos seems very solid.  i 
> have checked in CM's portmidi sources  that has setchannelmask 
> commented out because its missing in the latest portmidi sources. (ill 
> add this back in when roger makes another release of portmdi). it will 
> take several hours for the sources to migrate to cvs, look for rev. 
> 1.3 of cff-portmidi.lisp (new sources
> so i will now try testing in your version of sbcl to see if i can 
> duplicate your problems.
>
> this is what i am using to test
>
> ;;;------------------------------------------------------
> (in-package cm)
>
> (progn (use-system :rts)
>        (use-system :portmidi)
>        (defun simp (num rhy key wid)
>          (process for i below num
>                   output (new midi :time (now)
>                               :keynum (between key (+ wid key))
>                               :amplitude .7)
>                   wait rhy))
>        )
>
> (pprint (pm:getdeviceinfo))
>
> ;; fix port numbers for your setup.
> (defparameter pm (portmidi-open :input 0 :output 1))
>
> ;;;
> ;;; output test
> ;;;
>
> (rts pm)
>
> ;; eval this multiple times to test output
> (sprout (simp (pick 8 12 16) .1 (between 50 70) 12))
>
> ;;;
> ;;; input -> output test.
> ;;;
>
> (recv pm)
> (recv-set! pm
>            (lambda (m)
>              (if (note-on-p m)
>                  (sprout (simp (pick 8 12 16) .1 (note-on-key m) 12)))))
>
> ;; now play keyboard, each key down triggers new algo
>
> (recv-stop pm)
>
>
> _______________________________________________
> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>
On this example, I get the same error invalid number of arguments: 5.

With the recieve example, lisp crashes when I play the midi keyboard.

How can I trace this?

It must be the portmidi library I have.  Its the default Ubuntu supplied 
lib.  I tried building the latest sources, but sbcl wouldn't load the 
porttime lib that I built, so I went back to the Ubuntu lib.

k