[CM] dlocsig example

James Hearon j_hearon at hotmail.com
Mon Dec 14 10:03:02 PST 2015


Hi,
I'm getting myself all fouled up with trying to run a simple dlocsig example in clm.  I was using this one, from
https://ccrma.stanford.edu/~nando/clm/dlocsig/

(definstrument sinewave (start-time duration freq amp 
		         &key
			 (amp-env '(0 1 1 1))
			 (path (make-path :path '(-10 10 0 5 10 10))))
  (multiple-value-bind (dloc beg end)
      (make-dlocsig :start-time start-time
		    :duration duration
		    :path path)
    (let* ((osc (make-oscil :frequency freq))
	   (aenv (make-env :envelope amp-env :scaler amp)))
      (run
       (loop for i from beg below end do
	 (dlocsig dloc i (* (env aenv)(oscil osc))))))))

---------------------------------
I can move the samples in time using plain locsig and the run loop below, binding the variables start and end,
but dlocsig seems  to need the multiple-bind structure which I can't seem to to get to run.  I'm wondering if there's a better simple example someplace?  Thank You.

(definstrument sinewave (start-time duration freq amp deg dis
		         &key
			 (amp-env '(0 1 1 1)) )		 
    (let* ((osc (make-oscil :frequency freq))
	  (start (floor (* start-time *srate*)))
	 (end (+ start (floor (* duration *srate*))))
	   (aenv (make-env :envelope amp-env :duration duration :scaler amp))
                 (loc (make-locsig :degree deg :distance dis  :reverb .05)))
      (run
       (loop for i from start to end do
	    (locsig loc i (* (env aenv)(oscil osc)))
	    ))));)


More information about the Cmdist mailing list