;; load the synth
(sys:load "libs/core/instruments.xtm")
;; define a synth using the provided components
;; synth_note_c and synth_fx
(define-instrument synth synth_note_c synth_fx)
;; add the instrument to the DSP output callback
(bind-func dsp:DSP
(lambda (in time chan dat)
(synth in time chan dat)))
(dsp:set! dsp)
;; schedule 3 notes to play in succession
(define play-seq
(lambda ()
(play note (now) synth 60 80 10000)
(play note (+ (now) 22050) synth 64 80 10000)
(play note (+ (now) 44100) synth 67 80 10000)))
;; play
(play-seq)