[Impromptu] problem using two metres

Michele Pasin michele.pasin at kcl.ac.uk
Wed Mar 11 11:06:22 GMT 2009


Hi dear Impromptu-fellows,

would you have a go with the code below?
On my machine the audio constantly disappears after exactly 1 minute  
and 33 seconds (I know, the melody sounds awful, it's because I  
stripped it down to the bare basics for making my point).

If you're wondering what kind of thing I was trying to do... well  
basically I wanted to make a piece by organizing it into various  
'patches' of 4/4, and call them from a 'master' patch of 8/4 (or 16/4  
or more..).
It was just an idea, maybe this approach is totally wrong since  
conception! In such case, how would you approach it instead?


tx a lot!

mik





===================================================

(au:clear-graph)

(define piano  (au:make-node "aumu" "dls " "appl"))
(define *mixer* (au:make-node "aumx" "smxr" "appl"))

(au:connect-node piano 0 *mixer* 1)
(au:connect-node *mixer* 0 *au:output-node* 0)

(au:update-graph)
(au:print-graph)

;;; times

(define *metro* (make-metro 120))
(define metre (make-metre '(4) 1)) ;;  a classic 4/4
(define metre2 (make-metre '(8) 1))

;;;;;;;;;
;;
;;; this crashes the sound output ... I timed it, always after 1:33

(define mel1
    (lambda (beat)
       (if (metre beat 1)
           (play piano 60 60 *second*))
       (if (metre2 beat 1 )
           (play piano 48 60 *second*))
       (if (metre2 beat 1  )
           (mel2 beat 36))
       (if (metre2 beat 5  )
           (mel2 beat 40))
       (callback (*metro* (+ beat .4)) 'mel1 (+ beat .5))))


(define mel2
    (lambda (beat note)
       (if #t
           (play piano note 50 10000))
       (if (not (metre beat 4))
           (callback (*metro* (+ beat .4)) 'mel2 (+ beat 1) note))))



(mel1 (*metro* 'get-beat))














More information about the Impromptu mailing list