Secrets of Rapture: PWM

Author
René
Max Output Level: -68 dBFS
  • Total Posts : 1103
  • Joined: 2004/01/06 13:15:57
  • Status: offline
2006/06/10 12:40:38 (permalink)

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é
#1

12 Replies Related Threads

    Frank@ProSounds
    Max Output Level: -87 dBFS
    • Total Posts : 199
    • Joined: 2006/03/12 20:09:34
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/10 15:44:37 (permalink)
    50 dollars!!!











    #2
    lawapa
    Max Output Level: -68 dBFS
    • Total Posts : 1144
    • Joined: 2005/01/09 19:14:51
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/10 17:53:23 (permalink)
    Most interesting Rene. Thank's for taking the time, and providing the freebies. It's copy/pasted with progs.
    #3
    Paradroid
    Max Output Level: -81 dBFS
    • Total Posts : 454
    • Joined: 2005/05/27 23:50:17
    • Location: Melbourne, Australia
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/10 19:23:07 (permalink)
    'fat' sounds out of a tiny pulse/square wave

    It'll all comes a full circle and we're back talking about lard.

    Thanks René, these tutorials/history lessons are great!
    #4
    AT
    Max Output Level: 0 dBFS
    • Total Posts : 10654
    • Joined: 2004/01/09 10:42:46
    • Location: TeXaS
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/10 19:40:19 (permalink)
    René,

    glad I beat your expanding deadline - about as fat as Rapt gets with 9 waves.

    Thanks for all the little bits- makes sound design more fun. Imight drop in some other waves that way, see if we can't get some waldorf like stuff going (and yes, I fooled with the 40 waves posted).

    Lately, I been playing with the drum sounds. They sound even less like percussion, now, but what the hey.

    Thanks, later,

    @
    post edited by AT - 2006/06/10 19:50:26

    https://soundcloud.com/a-pleasure-dome
    http://www.bnoir-film.com/  
     
    there came forth little children out of the city, and mocked him, and said unto him, Go up, thou bald head; go up, thou bald head.
    24 And he turned back, and looked on them, and cursed them in the name of the Lord. And there came forth two she bears out of the wood, and tare forty and two children of them.
    #5
    b rock
    Max Output Level: 0 dBFS
    • Total Posts : 8717
    • Joined: 2003/12/07 20:31:48
    • Location: Anytown (South of Miami), U.S.A.
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/10 20:25:24 (permalink)
    That's a well put together tutorial, René. And you did the whole thing without mentioning the phrase 'duty-cycle' (OK, you did say 'cycle'.) Thanks: I owe you 50 bucks for the sawtooths.

    It really is amazing how many sound variations that you can get by simply varying the Phase in one of two identical .wavs in as many Elements. That crystal-clear sound engine of yours doesn't hurt, either. I can't resist piling on with another simple example of Phase in action:

    Element 1: sine .wav at a Phase of 0 degrees.
    Element 2: sine .wav at a Phase of 180 degrees.

    Total cancellation. The same goes for sine cube.wav, sine squared.wav, and any other symmetrical waveforms. Now click on the Multi [3v, 5v, 7v, 9v] in one of the Elements, and explore just how wide you can make a couple of sine .wavs using different voicing structures (even with Detune set to 0).
    #6
    lawapa
    Max Output Level: -68 dBFS
    • Total Posts : 1144
    • Joined: 2005/01/09 19:14:51
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/10 22:53:05 (permalink)
    Well when I first read this I got to wondering, with any set of waveforms if the phase is set to a lfo/I do mean sample delay set to LFO would you get a pronounced effect? PWM is a very distinctive sound. And this trick is a most desireable addition to the ol tool box.
    #7
    techead
    Max Output Level: -31.5 dBFS
    • Total Posts : 4353
    • Joined: 2004/01/24 08:40:20
    • Location: Macomb, IL, USA
    • Status: offline
    RE: Secrets of Rapture: PWM 2006/06/11 09:48:05 (permalink)
    #8
    ChristopherM
    Max Output Level: -56 dBFS
    • Total Posts : 1921
    • Joined: 2006/08/18 14:31:42
    • Location: UK
    • Status: offline
    Re:Secrets of Rapture: PWM 2009/08/05 05:28:32 (permalink)
    This text is guaranteed to have some broken link.
    Better than that - they are all broken now.  But the post is three years old, which is a lot of ninety minutes.
    #9
    dmbaer
    Max Output Level: -49.5 dBFS
    • Total Posts : 2585
    • Joined: 2008/08/04 20:10:22
    • Location: Concord CA
    • Status: offline
    Re:Secrets of Rapture: PWM 2009/08/05 13:45:39 (permalink)
    which is a lot of ninety minutes

    Nevertheless, thanks for resurrecting this thread.  It originated way before my joining this forum and I never would have seen it otherwise.  It happens I was just wrestling with the problem of how to get a variable width (modulate-able) pulse wave in Rapture.  This is very cool.
    #10
    b rock
    Max Output Level: 0 dBFS
    • Total Posts : 8717
    • Joined: 2003/12/07 20:31:48
    • Location: Anytown (South of Miami), U.S.A.
    • Status: offline
    Re:Secrets of Rapture: PWM 2009/08/05 18:17:46 (permalink)
    they are all broken now 
    I suppose that it'd be best to put a link of mine here in this thread.
    Here's a zip file with four 'perfect' wavetables that will work in this tutorial.
     
    Perfect Wavetables
    #11
    ChristopherM
    Max Output Level: -56 dBFS
    • Total Posts : 1921
    • Joined: 2006/08/18 14:31:42
    • Location: UK
    • Status: offline
    Re:Secrets of Rapture: PWM 2009/08/05 19:03:31 (permalink)
    Thanks, Tom.
    #12
    dmbaer
    Max Output Level: -49.5 dBFS
    • Total Posts : 2585
    • Joined: 2008/08/04 20:10:22
    • Location: Concord CA
    • Status: offline
    Re:Secrets of Rapture: PWM 2009/08/06 13:30:46 (permalink)
    I suppose that it'd be best to put a link of mine here in this thread.
    B, you Rock!  Thanks.
    #13
    Jump to:
    © 2024 APG vNext Commercial Version 5.1