;; violin-forker.lisp ;; Matt Wright, 1/5/4 ;; A simple recursive procedure for generating notes for the fm-violin instrument #| ;; Before you can use this you must compile and load the fm-violin instrument: (in-package :cm) (compile-file "v.ins") (load "v") |# ;; Here's my procedure: (defun violin-forker (starttime note-dur freq amp interval piece-dur) (if (> (+ starttime note-dur) piece-dur) '(have a nice day) (progn (fm-violin starttime note-dur freq amp) (violin-forker (+ starttime note-dur) note-dur (* freq interval) (/ amp 2) interval piece-dur) (violin-forker (+ starttime note-dur) note-dur (/ freq interval) (/ amp 2) interval piece-dur )))) #| This indicates the start of a multi-line comment Some examples: ;; Slow and clear, with octaves, starting from middle C (with-sound (:output "/zap/fork.snd") (violin-forker 0 1.0 (hertz 'c4) 0.9 2 3)) ;; Sort of whole-tone (with-sound (:output "/zap/fork.snd") (violin-forker 0 0.5 400 0.9 1.2 3)) ;; Faster notes means they build up exponentially a lot faster (with-sound (:output "/zap/fork.snd") (violin-forker 0 0.25 400 0.9 1.2 3)) ;; Perfect fifths (with-sound (:output "/zap/fork.snd") (violin-forker 0 0.3 300 0.9 1.5 2.5)) |#