[CM] polyshape

James Hearon j_hearon at hotmail.com
Fri Feb 5 18:51:05 PST 2021


I'm getting confused on make-polyshape and partials->polynomial.

    re: sndclm manual
    partials->polynomial takes a list or float-vector of partial numbers and amplitudes and returns the Chebyshev polynomial coefficients that produce that spectrum. These coefficients can be passed to polyshape (the coeffs argument), or used directly by polynomial...

    (partials->polynomial '(1 1 3 2 6 1))
    ;(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0)

    I'm trying to figure out how to use the coefficients, but I get an "attempt to apply a real -1.0, etc. error" when I plugin the float vector to the coeffs parameter.

    (with-sound ()
      (let ((gen (make-polyshape 400.0 :coeffs (-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0))))
        (do ((i 0 (+ i 1)))
            ((= i 88200))
          (outa i (* .5 (polyshape gen 0.25))))))

    How do you go about applying the partials->polynomial output to make-polyshape?  I couldn't seem to grep an example of that in the code.

    Thank you,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210206/5800f2a2/attachment.html>

More information about the Cmdist mailing list