[CM] Sbcl and realtime cm

Ken renueden@earthlink.net
Thu, 05 Oct 2006 19:06:15 -0700


I'm having additional trouble with portmidi and rts.

I have installed the latest cvs of the following:
cm
rts
portmidi interface
cffi-062925

lisp:
sbcl 0.9.17

Sbcl loads everything fine including cffi, portmidi and rts.
Going through the examples I get the following.
Example 3 of the Portmidi entry:

(define *pm* (portmidi-open :latency 0 :input 3 :output 0))

(define myseq (new <cid:part1.06020304.00070202@earthlink.net> seq <file:///home/nunativs/sound/cm/system/cm/doc/dict/seq-fn.html>))

(portmidi-record! myseq)

portmidi-record!: receiver already active.
   [Condition of type SIMPLE-ERROR]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {AD40161}>)

Backtrace:
  0: (PORTMIDI-RECORD! #<seq {AF1A211}>)
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (PORTMIDI-RECORD! MYSEQ) #<NULL-LEXENV>)
  2: (SWANK::EVAL-REGION "(portmidi-record! myseq)
" T)
  3: ((LAMBDA NIL))
  4: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS (T)) #<unused argument> #<unused argument> #<CLOSURE (LAMBDA NIL) {B17E94D}>)
  5: (SWANK::CALL-WITH-BUFFER-SYNTAX #<CLOSURE (LAMBDA NIL) {B17E94D}>)
  6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL "(portmidi-record! myseq)
") #<NULL-LEXENV>)
  7: ((LAMBDA NIL))
  8: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) #<unused argument> #<unused argument> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL) {B17E26D}>)
  9: ((LAMBDA NIL))
 10: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) #<unused argument> #<unused argument> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL) {B58372D}>)
 11: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION {ABDD701}> #<CLOSURE (LAMBDA NIL) {B17E11D}>)
 12: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {ABDD701}> #<FUNCTION (LAMBDA NIL) {B58372D}>)
 13: (SWANK::HANDLE-REQUEST #<SWANK::CONNECTION {ABDD701}>)
 14: ((LAMBDA NIL))
 15: ((LAMBDA NIL))
 16: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) #<unused argument> #<unused argument> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL) {AD540C5}>)
 17: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION {ABDD701}> #<CLOSURE (LAMBDA NIL) {AD540D5}>)
 18: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {ABDD701}> #<CLOSURE (LAMBDA NIL) {AD540C5}>)
 19: (SWANK::CALL-WITH-BINDINGS NIL #<CLOSURE (LAMBDA NIL) {AD540A5}>)
 20: ((LAMBDA NIL))
 21: ("foreign function: call_into_lisp")
 22: ("foreign function: funcall0")
 23: ("foreign function: new_thread_trampoline")
 24: ("foreign function: #xB7FC8341")

Example #2 of rts:
(define fluff '(60 62 64 67 72 65 69 48 50))

(define (endless-fluff num dur knums)
  (process <cid:part2.00080903.08060003@earthlink.net> repeat num for i from 0 
	   output
           (new <cid:part1.06020304.00070202@earthlink.net> midi <cid:part4.09080208.07000506@earthlink.net> :time (now <cid:part5.03050708.09080803@earthlink.net>) 
                :duration (* 2 dur)
                :amplitude .5
                :keynum (pickl <cid:part6.05060106.06040706@earthlink.net> fluff))
	   wait (pick <cid:part7.01060806.02030707@earthlink.net> dur (/ dur 2) (/ dur 4))
	   when (= i (1- num))
	   sprout (process <cid:part2.00080903.08060003@earthlink.net> repeat 4
                           output (new <cid:part1.06020304.00070202@earthlink.net> midi <cid:part4.09080208.07000506@earthlink.net> :time (now <cid:part5.03050708.09080803@earthlink.net>) 
                                       :duration 5
                                       :amplitude .5 
                                       :keynum (pickl <cid:part6.05060106.06040706@earthlink.net> knums)))
	   and
	   sprout (endless-fluff 20 1 knums)))

(rts *pm*)

(sprout (endless-fluff 20 1 fluff))


invalid number of arguments: 5
   [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {AD43161}>)

Backtrace:
  0: (RTS-ENQUEUE 1 #<CLOSURE (LAMBDA NIL) {A6CB425}> 10.493859 10.493859)
  1: (SPROUT #<CLOSURE (LAMBDA NIL) {A6CB425}> :TO NIL :AT NIL)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SPROUT (ENDLESS-FLUFF 20 1 FLUFF)) #<NULL-LEXENV>)
  3: (SWANK::EVAL-REGION "(sprout (endless-fluff 20 1 fluff))
" T)
  4: ((LAMBDA NIL))
  5: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS (T)) #<unused argument> #<unused argument> #<CLOSURE (LAMBDA NIL) {A696DC5}>)
  6: (SWANK::CALL-WITH-BUFFER-SYNTAX #<CLOSURE (LAMBDA NIL) {A696DC5}>)
  7: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL "(sprout (endless-fluff 20 1 fluff))
") #<NULL-LEXENV>)
  8: ((LAMBDA NIL))
  9: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) #<unused argument> #<unused argument> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL) {A6966E5}>)
 10: ((LAMBDA NIL))
 11: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) #<unused argument> #<unused argument> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<FUNCTION (LAMBDA NIL) {B58A72D}>)
 12: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION {ABDF701}> #<CLOSURE (LAMBDA NIL) {A696595}>)
 13: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {ABDF701}> #<FUNCTION (LAMBDA NIL) {B58A72D}>)
 14: (SWANK::HANDLE-REQUEST #<SWANK::CONNECTION {ABDF701}>)
 15: ((LAMBDA NIL))
 16: ((LAMBDA NIL))
 17: ((SB-PCL::FAST-METHOD SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK (T T)) #<unused argument> #<unused argument> #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL) {AD520C5}>)
 18: (SWANK::CALL-WITH-REDIRECTED-IO #<SWANK::CONNECTION {ABDF701}> #<CLOSURE (LAMBDA NIL) {AD520D5}>)
 19: (SWANK::CALL-WITH-CONNECTION #<SWANK::CONNECTION {ABDF701}> #<CLOSURE (LAMBDA NIL) {AD520C5}>)
 20: (SWANK::CALL-WITH-BINDINGS NIL #<CLOSURE (LAMBDA NIL) {AD520A5}>)
 21: ((LAMBDA NIL))
 22: ("foreign function: call_into_lisp")
 23: ("foreign function: funcall0")
 24: ("foreign function: new_thread_trampoline")
 25: ("foreign function: #xB7FC8341")


I notice that almost all the rts examples give errors, nor can i get a 
usb midi keyboard to function as an input.
I am able to get portmidi to spit out midi processes, but the timing 
will get screwed up or the notes will not all come out.
I am shooting for realtime midi in and out at some point, so any 
pointers on which direction to pursue are greatly appreciated.
Thanks,
Ken