[PD] very compressed chip sounds

Mathieu Bouchard matju at artengine.ca
Tue Oct 11 21:06:46 CEST 2011

Le 2011-10-12 à 01:32:00, hardoff goes bananas a écrit :

> no idea what causes the transpose/chord shift in this patch, but if you 
> leave it for a while, it inevitably does happen.

You are greatly amplifying error accumulation coming from [phasor~]. With 
a samplerate of exactly 44100 and a frequency of exactly 2, an ideal 
[phasor~] would increase by an amount of 2/44100 at each sample, leading 
to a new 0 at every 22050. The truth is a bit different.

If you do it with regular pd floats (float32), the amount 2/44100 gets 
computed as 12466118/pow(2,15+23) instead, because that's the closest 
fraction that this format can express.

For reasons of error accumulation, [phasor~] uses a «double» (float64) for 
storing the phase, but then it stores 1/44100 as a float, an computes 
2*(1/44100) as a float too, therefore a [phasor~ 2] doesn't have the exact 
frequency of 2.

BTW, have you tried [phasor~ 2.01] and other things like that ? At least 
on my computer, it's more interesting than [phasor~ 2].

| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC

More information about the Pd-list mailing list