[CM] ooooooops!

cristopher pierson ewing cewing@u.washington.edu
Thu, 30 Jan 2003 18:08:16 -0800 (PST)


Imagine my embarassment to find one of my own mistakes in this code:

It should read like this:

(defmethod change-env-dur ((env clm::seg) dur)
  (restart-env env)
  (let* ((new-env (copy-object env))
         (old-dur (/ (+ (clm::seg-end env) 1) *srate*))
         (dur-ratio (float (/ dur old-dur)))
         (new-data (loop for val in (clm::seg-data env)
                         for i upfrom 0
                         collect (if (evenp i)
                                   (* val dur-ratio);mistake was here
                                                    ;need to rescale
                                                    ;breakpoint x-vals too
                                   (/ val dur-ratio))))
         (new-end (floor (- (* (+ (clm::seg-end env) 1) dur-ratio) 1))))
    (setf (clm::seg-data new-env) new-data
          (clm::seg-restart-data new-env) new-data
          (clm::seg-end new-env) new-end)
    new-env))

Sorry about that (sheepish grin).

C


********************************
Cris Ewing
CARTAH Assistant
University of Washington
Home Phone: (206) 365-3413
E-mail: cewing@u.washington.edu
*******************************