[PD] cos~, feature or bug? (feature)

IOhannes m zmoelnig zmoelnig at iem.at
Thu Feb 24 09:33:55 CET 2005

august wrote:
> can someone please examine the attatched patch for me and see why I get
> WAY different values for [cos~] and [expr~ cos($v1)] ?

because [expr~] is mathematically correct and takes values from 0..2pi 
(and wraps)

[cos~] is a there to make an oscillator with a [phasor~] and thus takes 
values from 0..1 (it is very invconvenient if you have to scale the 
phasor~ to -pi..+pi if you want to make a sine out of it.

the attached patch shows how to make them the same
(note that they do not exactly make the same, since [expr~] really 
evaluates the cosine of the argument, while [cos~] just does a 
table-lookup and some interpolation)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testcos.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20050224/e3cc50ac/attachment.asc>

More information about the Pd-list mailing list