Hi,
Thank you for the example re: polyshape , square wave. I am surprised to see
that fractions vs. decimals for amps in the float-vector makes a difference in
the chebyshev coefficients.
(partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9 ))
;(0.0 1.0 0.0 -7.999999999999999 0.0 35.2 0.0 -54.85714285714286 0.0
28.44444444444444)
(with-sound (:srate 48000 :channels 1 :play #t)
(let ((gen (make-polyshape 100.0 :coeffs #r(0.0 1.0 0.0 -7.999999999999999
0.0 35.2 0.0 -54.85714285714286 0.0 28.44444444444444) ))
)
(do ((i 0 (+ i 1)))
((= i 88200))
(outa i (* .75 (polyshape gen 1.0 ))))))
When trying to plug the coefficents back into make-polyshape, I get a different
wave shape, which looks more like a triangle-ish wave instead of the square:
^^^^^^
I believe this is where I'm stuck, trying to empirically understand how the
chebyshev coefficient numbers work for additive synthesis. I thought the
problem might be normalization or order of coefficients? Still not sure where
I'm going wrong.
Any help, advice much appreciated.
Regards,
Jim
________________________________
From: [email protected] <[email protected]> on
behalf of [email protected] <[email protected]>
Sent: Tuesday, October 26, 2021 9:00 AM
To: [email protected] <[email protected]>
Subject: Cmdist Digest, Vol 161, Issue 11
Send Cmdist mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."
Today's Topics:
1. poly questions (James Hearon)
----------------------------------------------------------------------
Message: 1
Date: Tue, 26 Oct 2021 17:40:43 +0000
From: James Hearon <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [CM] poly questions
Message-ID:
<dm6pr10mb2537ab5eb7d8ec958cbb12c2e5...@dm6pr10mb2537.namprd10.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
Trying to get an understanding of all the interesting aspects of polywave in
snd, and chebyshev polynomials, coefficients etc. I was trying to get a
squarish wave from the coefficients but failing.
Also tried partials->polynomial, and normalize-partials with same result.
Wondering what I'm misunderstanding about how you would employ the coefficients
for a typical float-vector of partials, and amps for say a square wave?
(with-sound (:srate 48000 :channels 1 :play #t)
(let ((gen (make-polyshape 100.0 :coeffs (partials->polynomial (float-vector
1 1 3 .33 5 .2 7 .142 9 0.111)) ))
)
(do ((i 0 (+ i 1)))
((= i 88200))
(outa i (* .75 (polyshape gen 1.0 ))))))
Also, if I can ask more than one question per email, how do you go about using
the generators:
mus-chebyshev-tu-sum x t-coeffs u-coeffs
mus-chebyshev-t-sum x t-coeffs
mus-chebyshev-u-sum x u-coeffs
I couldn't seem to locate an ex. for those, but I did see the c code in clm.c
which is interesting.
Thank you,
Regards,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20211026/e9ebab85/attachment-0001.html>
------------------------------
_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
End of Cmdist Digest, Vol 161, Issue 11
***************************************
_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist