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

Hans-Christoph Steiner hans at eds.org
Fri May 26 13:01:25 CEST 2006

On May 25, 2006, at 7:24 PM, Martin Peach wrote:

> Hans-Christoph Steiner wrote:
>> I should say, I forgot that PWM was used in synthesis some, so I  
>> was  thinking about electronics and control when I was talking  
>> about PWM.   That's why my PWM objects are tailored towards, but  
>> should work fine  in the audio context too, unless you need the  
>> wandering DC offset.
> For controlling things with PWM I think you'll need to modify your  
> sound card if you want DC output. AFAIK they all have capacitors on  
> the ouput to block DC. I find it easier to program a PIC to do the  
> PWM and talk to it from PD using MIDI continuous controller  
> messages for 14-bit resolution, or noteon with velocity meaning  
> pulsewidth for 7-bits.

No, you don't need DC at all with PWM, unless you call the HIGH  
section of the pulse DC.  But since that section lasts in the range  
of milliseconds to microseconds, I think its safe to call it AC. ;)   
Actually the audio range of 20-20,000 is a good working range for  
cheap PWM.  High-quality PWM is much higher frequency.  The Atmel  
ATMEGA8 in the Arduino, for example, has three hardware PWMs which  
operate at ~30kHz.  That means in order to ensure its a real square  
wave, it has to have a frequency response that covers much higher  
that 30kHz.

The question I wonder about when using a sound card to output a PWM  
control signal is whether you can reliably get a positive-only  
voltage range, and not the usual -1 to 1 of audio.



                   ¡El pueblo unido jamás será vencido!

More information about the Pd-list mailing list