Hi all,
I've attached a patch that should illustrate the difference between 0.54 and the new 0.55 (as of test3) cos~ behavior.
A couple of thoughts regarding the code I submitted some time ago to address the cosine symmetry, linked in the thread above.
For those who don't want to dig, it constructs the first quarter of the cosine table, and then manually copies those samples to the respective places in the rest of the table purely by symmetry and negation. It also makes sure that the zero crossings are exactly zero and the peaks exactly 1 and -1. IIRC I was doing this on an old mac laptop, one of the first intel models, and I couldn't get a symmetric table even using double precision and Christof's method of incrementing index and dividing by table size, rather than adding a constant phase increment. I think something was weird in clang's cos function, or a compiler flag wasn't working, or something -- it was so long ago and I gave up and just did the whole thing manually -- that's what we ended up using in cyclone's [cycle~] object.
Miller:
I don't very much like that code
I didn't think you did; but I hope you understand the motivation. :)
Christof:
This should ensure that the table is symmetric, unless the underlying cos() function is broken :)
I think the underlying cos() function is dependent on architecture and compiler? Even with the new cosine table, on my machine the zero crossings have a (very tiny) residual, so it's sitting at a very small DC offset. The rest of the function looks symmetric, though, and certainly much, much better than the previous one.
Matt
On Tue, May 28, 2024 at 2:08 AM Miller Puckette mpuckette@cloud.ucsd.edu wrote:
Well, I made the table size a variable and... oscillators slowed down by 10%. So I have to rethink my brilliant plan, perhaps include two baked-in versions of cos~, osc~, and vcf~, one at 512 and one at 2048.... rats.
Miller
On 5/27/24 7:39 PM, Alexandre Torres Porres wrote:
Em seg., 27 de mai. de 2024 às 06:59, Miller Puckette mpuckette@cloud.ucsd.edu escreveu:
So far I found code in cyclone (sic.c)
But that's an old cyclone, like I said :) I think we don't use it anymore since 0.3
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev