(sys:load "libs/core/instruments.xtm")
(make-instrument fmsynth2 fmsynth)
(bind-func dsp:DSP
(lambda (in time chan dat)
(cond ((< chan 2)
(fmsynth2 in time chan dat))
(else 0.0))))
(dsp:set! dsp)
;; first version (redefine *lst* whenever you like)
(define *lst* '(60 63 67))
(define looper
(lambda (beat dur)
(set! *lst* (rotate *lst* -1))
(play fmsynth2 (car *lst*) 60 (* .3 dur))
(callback (*metro* (+ beat (* .5 dur))) 'looper
(+ beat dur)
dur)))
(looper (*metro* 'get-beat 4) 1/4)
;; second version using playp
;;
;; playp is a world unto itself - explore :)
;;
;; a very short intro to playp at
(define looper2
(lambda (beat dur)
(playp 1 0 fmsynth2 0 `(60 63 67) 80 (* .3 dur))
(callback (*metro* (+ beat (* .5 dur))) 'looper2
(+ beat dur) dur)))
(looper2 (*metro* 'get-beat 4) 1/4)