Secrets of Rapture: PWM
PWM (acronym for 'Pulse Width Modulation') is a common synthesis method, used to create 'animated' or 'fat' sounds out of a tiny pulse/square wave.
While most people knew PWM applied to sound synthesis back in the early ages of digital synthesizers, when analog VCO's (voltage controlled oscillators) were replaced by DCO's, the origins of PWM applied to audio are way older. I have recently learned that supercomputers like the UNIVAC were used to create music and several sound types including PWM back in the 50's.
From the ground up. A pulse waveform is a waveform which has only two states: on and off, and repeats those states cyclically.
The symmetry of the pulse waveform can be changed by modifying the relative width of the 'on' and 'off' parts, without changing the waveform frequency (the time/distance between consecutive cycles. This width, is usually known as 'Pulse Width'.
When the pulse waveform width changes, the timbre changes as well.
Narrower, or very wide pulses have a 'spiky' character:
http://www.rgcstuff.com/External/PWM/pwm-audio-1.mp3 (pulse 5%)
The 'spiky' character gets more 'rounded' when getting close to 50% width (aka Square Wave)
http://www.rgcstuff.com/External/PWM/pwm-audio-2.mp3 (pulse 50%)
PWM (again, 'Pulse Width Modulation'), consists in changing the width of the pulse dynamically in time. Either with a manual user control, or with automatic controls such envelopes or LFOs. Keep in mind that when most people refers to PWM, they are thinking in 'PWM by LFO', which has been the most abused trick in synthesizers. Here's how PWM sounds
http://www.rgcstuff.com/External/PWM/pwm-audio-3.mp3 (pulse 50%)
Ok. Those who are old enough as to have seen the -previous- Germany World Cup do know how to trick and get PWM out of old, analog synthesizers, and do know how old and modern digital and many software synths do it as well. But for the rest, here's the trick.
We create a pulse wave by stacking two saw waveforms, one going up and another going down. If we add both waveforms at identical level and phase, we get a silent output (the waveforms cancel each other perfectly). But if we shift the phase of one of the saws, the resulting sum is a pulse waveform, where the width depends on the phase shift. Naive, but effective.
I have stacked two waveforms as those in Audition to display this nice effect:
50% of phase shift gives us the square wave (50% pulse width):
25% of phase shift gives us the 75% of pulse with:
and so on. Here I'd like to note that in some nomenclature you'll see '50% width' as '50% of the cycle period', equals to the square wave, though in some synths the square wave is pointed as '100% width', and then '50% width' means '50% of the square wave', equals '25% width' of the other guys. That's not weird, we can't even agree to have a common AC voltage in our outlets worldwide, pulse width percentage won't get a higher priority.
Ok. For those who are not in deep alpha yet, here's how we do that PWM trick in Rapture.
1- You will need the two magic waveforms: perfect saw up and perfect saw down. We're offering those, whose price in retail stores is around $50, for free for the next 90 minutes. Here:
http://www.rgcstuff.com/External/PWM/perfectsawupanddown.zip You will want to drop those in the \Wavetables folder under your Rapture installation.
2- Load Rapture and initialize a patch, using the 'Initialize Program' function. I will bet you know where it is.
3- Load 'perfect saw up.wav' in Element 1, either by drag and dropping it or using the Load Multisample dialog.
Play it, and make sure you hear a saw waveform in action.
4- Now load 'perfect saw down.wav' in Element 2.
Now play. You might be surprised, that there's almost no sound coming out, if any. That's normal, as the waves are cancelling each other.
5- Click on the 'PHASE' control in the display on Element 2.
Play a note, no sound. Then, hit PGUP in your keyboard to move the phase in 10 degrees increments, and play a note again. Repeat this procedure up to 360 degrees.
You will then hear all pulse widths from 0 to 360. The 'spiky' ones will become 'round'
Good. Now we have PWM. We can assign a MIDI control to phase: while we don't have 'Phase' in the mod matrix, but we do have 'Sample Offset' which doubles as Phase when the sound engine is in wavetable mode.
Let's assign an LFO to pulse width. 'Sample Offset' is N/A as destination for an LFO, but Pitch is. Modulating phase and pitch are the same thing, with a different magnitude order, so we'll use the Pitch LFO for it. Here's a patch, bare bones, which has the LFO applied:
http://www.rgcstuff.com/External/PWM/PWM_barebones.prog Here's another patch, with a more dramatic effect. As we're using the Pitch LFO, we need to take care of the frequency-root relationship. In english, this makes the PWM to sound more like pitch in higher notes, so we add a Keyboard Tracking entry in the matrix to compensate. Here's a pad-like patch showing it:
http://www.rgcstuff.com/External/PWM/PWM_padlike.prog Using the PHASE control to determinate the static, start-up position of the sound, and then the LFO depth, many colorful, animated sounds can be realized. There's loads more about PWM, the combos of it with multi, ring and what not, but I'll let 'someone else' do that for me.
This text is guaranteed to have some broken link.
-René