[CM] Simple oscillator?

Bill Schottstaedt bil at ccrma.Stanford.EDU
Sat May 15 03:48:29 PDT 2010


> Can you show me an example of the CM code to make a one second 440 hertz sine tone?

sndclm.html in the Snd tarball has information about CLM in Snd.
A sinewave instrument (in scheme) looks like this:

(definstrument (simp beg dur freq amp)
  (let* ((os (make-oscil freq))
	 (start (seconds->samples beg))
	 (end (+ start (seconds->samples dur))))
    (run
      (do ((i start (+ 1 i))) 
          ((= i end))
        (outa i (* amp (oscil os)))))))

(with-sound () (simp 0 1 440 .1))



More information about the Cmdist mailing list