phasor~ and cos~ versus [cycle~

robin's icon

hi. i'm sure this has been discussed before, but what are the advantages of using cos~ driven by a phasor over just usng cycle~? I'm thinking specifically of Emmanuel Jourdan's ej.vdb~ object...

thanks

Emmanuel Jourdan's icon
robin's icon

from the man himself! i'm still ppc so i guess i'll stick with it, though it would be interesting to test a bit more thoroughly

thanks emmanuel, and also thanks for having made the patch, very useful

robin

Leafcutter John's icon

On my machine a non-intel 1.33Ghz iBook G4

400 cycle~ objects use about 73% of the CPU (as measured by adstatus)

400 Phasor~ Cos~ pairs come in at around 44% (as measured by adstatus)

If anyone wants to test for themselves i attach the test patch.

best,

John.

kjg's icon

Quote: Leafcutter John wrote on Wed, 20 February 2008 03:05
----------------------------------------------------
> On my machine a non-intel 1.33Ghz iBook G4
>
> 400 cycle~ objects use about 73% of the CPU (as measured by adstatus)
>
> 400 Phasor~ Cos~ pairs come in at around 44% (as measured by adstatus)
>

I used John's patch to test on my machine, a macbook pro 2.16 GHz. It's an intel instead of ppc and the results are basically opposite:

400 cycle~ objects use about 25% of the CPU (as measured by adstatus)

400 Phasor~ Cos~ pairs come in at around 46% (as measured by adstatus)

so, if you're on ppc, go phasor/cos, if you are on intel, go cycle.

regards,
kjg

Adam Murray's icon

Quote: Emmanuel Jourdan wrote on Mon, 18 February 2008 07:29
----------------------------------------------------
> [phasor~]+[cos~] should also be more
> precise, but I'm not sure that you'll hear the difference.
>

I have an LFO object where I use [phasor~]+[cos~] because I was worried about accurately producing a sine wave. The interpolation that cycle~ does would become more of an issue at very low frequencies, right? I'm still not sure you would hear the difference but I figured for a general purpose LFO object this is the safer route to avoid artifacts. Is that a reasonable choice?

Interesting performance results, thanks for posting this info.

kjg's icon

Quote: Adam Murray wrote on Wed, 20 February 2008 03:55
----------------------------------------------------
> Quote: Emmanuel Jourdan wrote on Mon, 18 February 2008 07:29
> ----------------------------------------------------
> > [phasor~]+[cos~] should also be more
> > precise, but I'm not sure that you'll hear the difference.
> >
>
> I have an LFO object where I use [phasor~]+[cos~] because I was > worried about accurately producing a sine wave. The
> interpolation that cycle~ does would become more of an issue at > very low frequencies, right? I'm still not sure you would hear > the difference but I figured for a general purpose LFO object
> this is the safer route to avoid artifacts. Is that a
> reasonable choice?

As far as I know, cycle uses linear interpolation, so yes, at (very) low frequencies it should a tiny bit off from a quasi-perfect sine wave. I do not believe it would be perceivable in most cases and even if it were (when a/b-ing) it wouldn't be worse necessarily, just a bit different. For a lot of lfo duties, a triangle wave is already a nice 'approximation' of a sine wave.. so an interpolated 512 step sine wave should be just fine!

I personally am more interested in the audio frequencies range, to see (hear actually) if there is a difference. there seems to be, but i'm not sure which one is better...
they sound slightly different, that's for sure. cycle~ actually _looks_ cleaner on the spectroscope.
when you sum the two to cancel out things get pretty bad..

here is a little patch you can listen for yourself and test your ears and your soundcard. hit space a few times.. then take a guess.. ;)

regards,
kjg

Max Patch
Copy patch and select New From Clipboard in Max.