[CM] GUILE -> Abnormal Exit (snd-rt)

Esben Stien b0ef@esben-stien.name
Sun, 11 Mar 2007 03:55:14 +0100


Trying to run some GUI code, I'm getting: 

<jack-rt-driver> -> destructor

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.

Process scheme exited abnormally with code 1

Here's the code: 

(define i (a_new_gnu_order 0 0.1 45 0.3))

(definstrument (a_new_gnu_order start-time duration frequency amplitude #:key
	 (partial0 1.0)(partial-amplitude0 0.8)
	 (partial1 1.593)(partial-amplitude1 0.6)
	 (partial2 2.135)(partial-amplitude2 0.6)
	 (partial3 2.295)(partial-amplitude3 0.35)
	 (partial4 2.917)(partial-amplitude4 0.3)
	 (partial5 3.598)(partial-amplitude5 0.2)
	 (amplitude-envelope '(0 0 .04 1 .4 1 1 0))
	 ;;(amplitude-envelope '(0 0.5 1 0 1 0)))
	 #:allow-other-keys)
  (let* ((start (floor (* start-time (mus-srate))))
	 (len (floor (* duration (mus-srate))))
					;wtf?
	 (foundit 1)
	 (face 100.0)
	 ;;base oscillator
	 (sine0 (make-oscil :frequency frequency))
	 (sine1 (make-oscil :frequency (* partial0 frequency)))
	 (sine2 (make-oscil :frequency (* partial1 frequency)))
	 (sine3 (make-oscil :frequency (* partial2 frequency)))
	 (sine4 (make-oscil :frequency (* partial3 frequency)))
	 (sine5 (make-oscil :frequency (* partial4 frequency)))
	 (sine6 (make-oscil :frequency (* partial5 frequency)))
	 ;;insert modulating oscillator
	 (mod (make-oscil :frequency 50))
	 (indenv '(0 2 100 1))
;snare	 (indenv '(0 100 50 0))
	 (devf (make-env :envelope indenv
			 :scaler (in-hz 75)
			 :start start 
			 :end len))	 
	 (amplitude-envelope (make-env :envelope amplitude-envelope
				       :scaler amplitude
				       :start start
				       :end len))
	 (output (make-vct len))
	 ;delete these two old lines from havanna
	; (osc (make-oscil))
	 ;(vol 4/6)
	 )
    ;;
;    (instrument 
     (<rt-play> 0 2
			   (lambda ()
			     (receive-midi (lambda (control data1 data2)
					     (set! control (logand #xf0 control))
					     ;;(printf "gakk! %x %x %x\\n" control data1 data2)
					     (if (= control #x90)
						 (begin
						   (set! foundit 1)))))

			     (out 
			      (* (env amplitude-envelope)
				 (+ (* partial-amplitude0 (oscil sine1 (* (env devf) (oscil mod))))
				    
				    (* partial-amplitude1 (oscil sine2 (* (env devf) (oscil mod))))
				    (* partial-amplitude2 (oscil sine3))
				    (* partial-amplitude3 (oscil sine4))
				    (* partial-amplitude4 (oscil sine5))
				    (* partial-amplitude5 (oscil sine6))
				    )
				 )
			      )
			     )
			   )
		;)
    (exit (lambda ()
	    (-> instrument stop)
	    (-> d hide)))
    
    (d (<dialog> "Finally!"  exit
		 "Close" exit
		 "Stop" (<- instrument stop)
		 "Start" (<- instrument play)))
    
    (<slider> d "Amplitude" 
	      0 (-> instrument face) 1.0
	      (lambda (val) 
		(set! (-> instrument face) val))
	      1000)
    
    (-> d show)))

Any pointers as to what I'm doing wrong?. When I uncomment the
"instrument" line, I'm getting an error that "instrument" is
undefined, but it seems to work fine for the examples in
rt-examples.scm.

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n