[CM] help new to lisp and common music

Rick Taube taube@uiuc.edu
Tue, 29 Nov 2005 16:23:08 -0600


On Nov 29, 2005, at 6:59 AM, τασα σωτηρίου wrote:

> can anybody tell me how to use with-sound in a lisp project?
> I have a list of notes and rhythm but I don.t know how to get a snd 
> file out
> of it
> Please help me
> Tasa

(load (compile-file "/path/to/clm-3/v.ins"))

(with-sound ()
   (fm-violin 0 1 440 .5))

(defparameter list-of-notes
   (loop repeat 10 collect (+ (random 220) 220)))

(defparameter list-of-rhythms
   (loop repeat 10 collect (* .25 (+ 1 (random 3)))))

(with-sound ()
   (loop with x = 0
         for n in list-of-notes
	    for r in list-of-rhythms
         for x = 0 then (+ x r)
         do (fm-violin x (* r 1.5) n .5)
            (incf x r)))