;;; Continuing from my digest of my synth yesterday (check my phlog ..)

(setq *notes*
(loop for f in '(50 320 190 460)
 for lf = (let ((n 0)) (lambda () (+ f (* 30 (sin (incf n 0.001))))))
 for n = (synote (lambda () 1.5d0) lf (lambda () 0.2d0))
 collect n))

(mp:process-run-function 'beeps-1
(lambda () (mapc 'funcall *notes*)))

(setq *notes-2*
(loop for f in '(50 320 190 460)
 for lf = (let ((n 0)) (lambda () (+ f (incf n 0.001))))
 for n = (synote (lambda () 1.5d0) lf (lambda () 0.2))
 collect n))

(mp:process-run-function 'beeps-2
(lambda () (mapc 'funcall *notes-2*)))

(setq *granul*
(loop for x from -12 to 12
 for f = (* 440 (expt 2 (/ x -12.0)))
 for n = (note f f 0.1 0.1)
 collect n))

(mp:process-run-function 'beeps-3
(lambda () (mapc 'funcall *granul*)
 (mapc 'funcall (reverse *granul*))))

;; Something like this.