[PD] Re: [PD-announce] PWM in Pd

Hans-Christoph Steiner hans at eds.org
Thu May 25 16:17:49 CEST 2006


On May 25, 2006, at 2:59 PM, Frank Barknecht wrote:

> Hallo,
> Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
>
>> On May 25, 2006, at 12:22 PM, Frank Barknecht wrote:
>>> There also is a PWM in the docs, which doesn't need any externals:
>>
>> I should mention then that these objects are written in Pd, and only
>> rely on some purepd objects, which are also written in Pd.
>
> Except one external from zexy. ;)

>>> 3.audio.examples/K01.pulse.width.mod.pd
>>
>> Unfortunately, this patch is missing from CVS, so it doesn't make it
>> into Pd-extended.  But in any case, this is the PWM knowledge wrapped
>> up into a easy to use form.
>
> Sorry, I think it's called 3.audio.examples/J03.pulse.width.mod.pd
> now, but for years it was called 3.audio.examples/ 
> 22.pulse.width.mod.pd
> and for some time 3.audio.examples/E05.pulse.width.mod.pd as well. ;)
>
> It's just substracting two [phasor~]'s with slightly different
> frequencies, which is equivalent to PWM.

Ah yes, [pwm~] is using zexy's [>~].  I was looking at [pwm].  That  
example (I am looking at K01.pulse.width.mod.pd from 0.38.4) is very  
simple, but as it is, it is not usable.  Notice how the LOW and HIGH  
change values.  PWM needs be 0 for LOW and 1 for HIGH.  That example  
is usable in an audio context, since DC offset doesn't really  
matter.  I guess you could rely on the DAC in the soundcard to remove  
the DC, but that is probably asking for trouble.

I am open to suggestions for a different algorithm.  Or perhaps  
someone should write [>~] in Pd.

.hc


________________________________________________________________________ 
____

Man has survived hitherto because he was too ignorant to know how to  
realize his wishes.
Now that he can realize them, he must either change them, or perish.
		                                                -William Carlos  
Williams





More information about the Pd-list mailing list