Pulse Width Modulation

Official support for: u-he.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Okay, this may well be a dumb question, but I'm a guitar player, so please bear with me (and be grateful I'm not a drummer ... :P ).

Zebra has inspired me to expand what so far has been my rudimentary synth programming ability. (I learned what little I know on a Juno 106!!! :shock: ) To do that, I've gone back to basics -- I'm working my way through Sound on Sound's "Synth Secrets" (which is available online, for those that don't know). But, as is true for many guitar players, I'm an instant gratification kind of guy, and one of the things I'd really like to figure out how to do in Zebra is some basic PWM. I'm at a complete loss. :help:

I seem to recall a thread some months ago on this subject, but I'll be damned if I can find it now. Can anybody point me to a patch in the factory bank that provides an example of a typical PWM implementation in Zebra so I can study it? Thanks!

:D
"Enough Spyro Gyra and you're hoping you'll be killed in a knife fight."
-- Chris in the morning

Post

Offhand I don't know of any great patches to show it off... but here is the technique. It's really simple. Load a basic saw OSC and go to the Phase tab. Switch "inv" to ON. Set the phase knob so it's pointing at 12:00 (a value of about 52). Then, assign the knob to the right of that (the modulator) to LFO2. Increase this knob's value to about 12-13. There you go, PWM! I usually prefer setting the LFO to a triangle waveform and decreasing its rate.

Another way to do PWM, which is slightly more complicated (but IMO sounds better) involves drawing two waveforms by hand. Start with a new patch, then open up OSC1's "More Osc" tab. Using geomorph, draw wave 1 and wave 16 to look like this:

http://www.soundtempest.net/z2wave.PNG

Now, click on Wave 1. Hold alt, then left click on Wave 16. This will create a smooth transition between the two waves. Increase the osc's "Resolution" knob to maximum. Then left click on Wave 8. This will be your basic square wave.

To actually modulate it, go to Osc 1's normal controls (the ones that appear in the "gear" rack on the left) and right click on the knob to the LEFT of "Wave". Set it to LFO2, increase the value slightly, and now you have PWM again.
Shreddage 3 Stratus: Next generation Kontakt Player guitar, now available!

Impact Soundworks - Cinematic sounds, world instruments, electric guitars, synths, percussion, plugins + more!

Post

zircon wrote:.... Now, click on Wave 1. Hold alt, then left click on Wave 16. This will create a smooth transition between the two waves.
Aha! This is some of the stuff I haven't been able to suss out about how to use Zebra -- in particular the geomorph/spectromorph stuff, which I've found confusing. (It always seemed to me that there should be a mode for phat sounds called "endomorph". :P ) I'll give this a try. Maybe I should read through the manual again, too....

In your first example -- does that result in true PWM, or is it just something akin to it using a saw?

Thanks a bunch, zircon.
"Enough Spyro Gyra and you're hoping you'll be killed in a knife fight."
-- Chris in the morning

Post

tboulette wrote:In your first example -- does that result in true PWM, or is it just something akin to it using a saw?
This is true PWM - with a twist.

The difference between both methods is:

The graphical approach does what analogue PWM does, it has a variing dc offset while the overall volume is lower at shorter pulsewidths. The center position (square wave) is relatively loud. The dc-offset will naturally be high-passed out. Because only one high-low transition is moved, modulating the pulsewidth also introduces vibrato!

The sawtooth approach mixes a sawtooth and its upside-down (inverted) counterpart (one saw ramping up, the other saw ramping down). Both are offset to the right and left side respectively. The amount of offset varies the pulsewidth of the resulting waveform. The advantage of this approach is, the overall volume/energy is preserved, no dc offset occurrs and no vibrato. As it's more clean, this is my preferred method of pwm. Best of all, it's not limited to sawtooth -> pulse, you can use any waveform to create a similar effect.

Cheers,

;) Urs

Post

For those of you who want to play along at home and don't want to create the patches as described above, snag the file:

http://www.sharebigfile.com/file/116833 ... 1-zip.html

The two presets are:
Zircon PWM Analog-ish.h2p - uses the drawn waveforms
Zircon PWM Clean.h2p - uses saw inversion

It's a handy addition to anyone's Zebra tutorial patches :)


On a side note, can anyone explain to me exactly what oscillator inversion does? I've run Zebra through s(m)exoscope to see if I could tell a difference but it only left me stumped. I'm very new to music and synthesis and learning as I go from the experts here.

Thanks!

Post

Urs wrote:The graphical approach does what analogue PWM does, it has a variing dc offset while the overall volume is lower at shorter pulsewidths. The center position (square wave) is relatively loud. The dc-offset will naturally be high-passed out. Because only one high-low transition is moved, modulating the pulsewidth also introduces vibrato!
To remove PWM-vibrato completely: Set Wave-1 to a (6-point) narrow Pulse in the centre of the window and Wave-16 to 50% width, also symmetrical around the centre. Interpolate. Set resolution to maximum for best results.

To set PWM-vibrato to intermediate levels: Do the above, but don't centre both the extreme waves - shift one of them (preferably the narrow one, because that gives you the most flexibility) to one side or the other. Interpolate again :)

To remove energy differences between narrow and wide pulses: Experiment with Normalize - I find that 20.00 is about right.
Last edited by Howard on Tue Mar 20, 2007 9:20 pm, edited 2 times in total.

Post

bmrzycki wrote:On a side note, can anyone explain to me exactly what oscillator inversion does? I've run Zebra through s(m)exoscope to see if I could tell a difference but it only left me stumped.
Inversion flips the wave on its head (so that e.g. a falling saw "\|\|" becomes a rising saw "/|/|"). You can't see just the inverted wave on your oscilloscope because it is always mixed 50-50 with the original. However, you can certainly see what changing the Phase does to the mixture! :)

Post

Inversion flips the wave on its head (so that e.g. a falling saw "\|\|" becomes a rising saw "/|/|"). You can't see just the inverted wave on your oscilloscope because it is always mixed 50-50 with the original. However, you can certainly see what changing the Phase does to the mixture! :)
Ah! That explains why when I enable inversion on a saw I get almost no sound as an output. So when I add phase shift to the osc does that shift over the original wave or the inverted one?

Thanks for the help Howard!

Post

If I'm understanding correctly, just phase shift one osc while keeping the other one steady. When both oscs are exactly in phase (but inverted), the inverted saw cancels the other one out. At ever other phase you get some interesting wave addition (or here, subtraction). Draw out a few on paper and see! It's not quite the PWM I'm familiar with, but it's certainly akin to it.
Last edited by tboulette on Tue Mar 20, 2007 10:18 pm, edited 1 time in total.
"Enough Spyro Gyra and you're hoping you'll be killed in a knife fight."
-- Chris in the morning

Post

bmrzycki wrote:
Inversion flips the wave on its head (so that e.g. a falling saw "\|\|" becomes a rising saw "/|/|"). You can't see just the inverted wave on your oscilloscope because it is always mixed 50-50 with the original. However, you can certainly see what changing the Phase does to the mixture! :)
Ah! That explains why when I enable inversion on a saw I get almost no sound as an output. So when I add phase shift to the osc does that shift over the original wave or the inverted one?
It shifts over both, in opposite direction :)

Post

tboulette wrote:Draw out a few on paper and see! It's not quite the PWM I'm familiar with, but it's certainly akin to it.
Save yourself the hassle and use an output plugin like
http://bram.smartelectronix.com/plugins.php?id=4

It really helps me visualize what certain knobs do.

Post Reply

Return to “u-he”