[sdiy] Dumb PWM question

Tom Wiltshire tom at electricdruid.net
Thu Feb 28 19:57:22 CET 2008


On 28 Feb 2008, at 13:40, Scott Gravenhorst wrote:

> Didn't someone mention the idea of a digital simulation using  
> arithmetic methods to
> produce a sound file?
>
> Was that done?

Not exactly, but what we're talking about is Phase Distortion, so dig  
your Casio CZ out of the back of the cupboard and have a play with  
it. In fact, just dig your Casio CZ!

I did a similar thing to that suggested (Phase Distortion on arbitary  
oscillator waveforms, not just pulses) on a dsPIC and got the  
following results:

	http:/www.electricdruid.com/LFOBassline.aiff
	http:/www.electricdruid.com/EnvelopedOscillator.aiff

Sorry for the huge AIFF files. I don't seem to have anything that  
exports mp3. As you can hear, the results sound very FM-esque, as we  
would expect. These are just the raw oscillator. Pitches are provided  
by a sequencer, and the first example changes the PD amount with an  
LFO, whilst the second uses an envelope.

If someone could do the requested PWM-on-a-Triangle/sine/etc wave  
samples, I'd still love to hear them.

If you don't want a digital oscillator, here's a sketch of an  
analogue-ish way to do it, at least for arbitary oscillator  
waveforms, if not arbitrary signals:

	http://www.electricdruid.com/images/pd/idea.gif

  It depends on the fact that there is a source of modulation that is  
synchronised with (in this case 'identical to') the input signal.
There is a delay line to provide the necessary storage. As someone  
pointed out, unless you delay the signal you'd have to look into the  
future. The circuit itself is basically a simple BBD vibrato  
modulated at audio frequencies.

Here's another picture of what the effect looks like (from my PIC LFO):

	http://www.electricdruid.com/images/lfo/PDDiagramV9C.gif

Hope this sparks ideas for someone,
Regards,
Tom






More information about the Synth-diy mailing list