[PD] setting phasor's phase without clicks

Frank Barknecht barknech at ph-cip.uni-koeln.de
Thu May 16 09:25:37 CEST 2002

Krzysztof Czaja hat gesagt: // Krzysztof Czaja wrote:

> finally found some time to look closer at the math (I am math-blind
> without a sheet of paper).  

Me, too. And I should have used wrap~ indeed, that does the same [>~
1] and substracting 1 or 0, I just didn't think of it. All those objects...

> The min~ solution is apparently cheaper than Varga's, and the output
> scaling is not tricky at all -- it is: ((a + 1) / a) * min~(x, a *~
> (1 -~ x)).  The input (`a' coeff) scaling is best done with an exp,
> in order to have symmetric control around zero.

The important idea behind Varga's algorithm is "Bandlimiting".  The
standard phasor has harmonics beyond the Nyquist frequency because of
the abrupt changes from 1->0 and unfortunatly now that I took a sheet
of paper, the way I realised trisaw has the same problem. Duh. I
looked closer at Varga's code and he uses a new Csound function table
generator, GEN30. This does the following:

"GEN30 extracts a range of harmonic partials from an existing

The 4(x-x^2) expression is used in Varga's code to fill a table with
such a waveform, that GEN30 then reads while limiting the upper border
of the harmonics range. 

Because these gen30-generated table later is used in an oscili
(==tabosc~ in PD) with varying frequency, one cannot simply use one 
table for every trisaw~ frequency, because that would introduce
aliased frequencies again. Varga's solution is to fill 128 tables,
one for each midi note, with GEN30-functions from 4x(1-x) polynoms and 
limited upper harmonic borders of "nyquist_frequency/note_frequency"

All this I didn't do in my trisaw~ and so I alias the same amount as

Life's a dog.

 Frank Barknecht                                  _ _______footils__

More information about the Pd-list mailing list