The Eat at Joe's Kawai K5000 Message Board Digest Pulse Width Modulation on the K5000 ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ clipping from CC list Friday, 21-Nov-97 14:51:19 Message: 192.86.155.91 writes: I'm reposting this message from: lerxst@wam.umd.edu (PhReEkY dEeK) It was sent on a cc email list that was going around before I set up this message board and I thought that it's useful for additive synthesis reference. It seems like you could almost simulate pulse width modulation with harmonic envelopes. A square wave is basically made up of a sine fundamental and odd numbered harmonics at a fixed ratio. The harmonic content is signified by a lack of the nth harmonics when the pulse width is 1/n. So, a 1/3 (33%) pulse wave would have every 3rd harmonic missing; a 10% would have close to every 10th harmonic missing. Kenji ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ PWM and the Knob Box Monday, 24-Nov-97 13:06:03 Message: 128.8.10.142 writes: Wow, I check out this list for the first time ever and the first thing I see is someone quoting me... I'm flattered! :) The idea of simulating PWM with harmonic envelopes is interesting. I mean, my Juno-60 does it, but only with VCF envelopes.On a synth like this... :) Does it seem feasible to modulate harmonics with other sources besides an envelope or LFO? I don't have SoundDiver and haven't really gotten too deep into this end of the programming, but if it is possible to control some aspect of harmonic content (besides filter cutoff) with something like a MIDI CC, then we don't even have to settle for plain old oscillator-modulated PWM. We can instead modulate with something like pitch bend, or aftertouch, which sounds like a neat prospect.... Question about the k5kr knob box: someone told me that it's a MIDI CC box, but aren't the parms that it controls sysex-based? Any info would be appreciated. - Ilya Or that it's lerxst@wam.umd.edu ------------------------------------------------------------------------------------------ Re: PWM and the Knob Box Monday, 24-Nov-97 19:01:04 199.86.47.47 writes: How would that work? How do you modulate between a 33% pulse and a 20% pulse (passing through 25%)? The knob box is definately CC's. leiter@skypoint.com ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ PWM again Friday, 28-Nov-97 08:22:03 Message: 193.96.226.61 writes: Hi all! I found an appoximate solution to the PWM problem. Imagine a pulse width modulated square wave as the following thing: Take a sawtooth wave and subtract a time-shifted version of it. That's all. Try it, draw the curves on a piece of paper! Adjust and modulate the time shift parameter according to the pulse width needed. Now take a look at what happens with the spectrum: It results from the spectrum of a sawtooth wave multiplied with the frequency response of a delay-and-subtract filter. This filter is nothing else than a flanger. Why not simply use the flanger in the effects unit? Because you might want to modulate the pulse width with an envelope, not with an LFO. And this is where it's getting exciting: The K5000 formant filter can do it! You have to program it as a so-called comb filter which has zeroes at odd multiples of a low frequency. Unfortunately, the formant filter has a logarithmic frequency scale and an unknown (or does anyone know???) amplitude scale, so I could not set it to precise values. Particularly, the high-frequency resolution is bad. But it turned out to be sufficient to get a flanger-like sound, though not as clean as 'original' PWM. But maybe some day someone calls this sound 'better-than-PWM', who knows? By the way - no one says that you have to use a sawtooth wave... I plan to provide an example patch, hopefully downloadable soon from Kenji's website. Greetings from Munich, Germany! Jens. Jens Groh ------------------------------------------------------------------------------------------ Re: PWM again Sunday, 30-Nov-97 22:27:05 199.86.47.106 writes: Yes! Good point. I'm trying a couple of ways to use that, nothing that works yet. One thing that brings up, to use on the analog: If you combine a saw with the same saw 180 degrees out of phase you get a saw one octave up, whereas if you invert the second saw you get a square. So, going the other way, if you combine a square with a saw one octave up they should add up to saw. What's the use? All the odd harmonics are in the square and all the evens are in the octave saw, so you can change the odd/even balance of a saw using an analog synth. leiter@panix.com ------------------------------------------------------------------------------------------ Re: PWM again Wednesday, 03-Dec-97 10:35:55 193.96.226.61 writes: Oops! My delay-and-subtract filter accidentally became a delay-and-add filter when I wrote: "...comb filter which has zeroes at odd multiples of a low frequency...". Please, don't be confused if you did not understand it: Omit the word "odd" and it's correct. Check out my pseudo-PWM example patch 'PSDOFLNG.KA1' on Kenji's patches page. Jens Groh ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ PWM again again Monday, 01-Dec-97 01:37:57 Message: 199.86.47.113 writes: I'm sending in a patch called PWMtail1, which does a limited emulation of PWM. The attack portion fades in as a square wave (rounded off a bit), then it tails off as an emulation of PWM going 50%->0%. I left it dry of effects. As Jens pointed out, a square is like a saw minus another saw offset 180 degrees. As you decrease the offset to 0 degrees, the difference between the two saws is a pulse that decreases in width from 50% to 0%. As the two saws move relative to each other, harmonics are alternately cancelled and reinforced. What happens to the harmonics is this: In the square, all of the odd harmonics are at full amplitude and all of the evens are at zero. As the pulse width falls to zero, the amplitude of the fudamental falls to zero as well. The amplitude of the third harmonic falls to zero three times as fast, then rises to full again, then falls to zero. Each odd harmonic goes through n/2 cycles of falling and rising. The even harmonics go through n/2 cycles of rising and falling; the 2d harmonic is at full amplitude at 25% and back to zero at 0%. I would say it simpler if I knew how. This patch uses the loop1 function on the envelope for each harmonic up to sixteen. The timing can't be set fine enough for this application, so you can't really go above 16 harmonics and even at that they don't stay in time for very long. Also, they increase and decrease linearly instead of sinusoidally. Also, the phase of the harmonics should change as you sweep from 50%->0%, but that's beyond the K5k (or anything else out there.) Bottom line is, for playing, keep an analog around for this kind of thing. (I still like the Waldorf Pulse with the K5k, great combination.) leiter@skypoint.com ------------------------------------------------------------------------------------------ Re: PWM again again Monday, 01-Dec-97 04:41:18 193.96.226.61 writes: You don't have to worry much about the phases of the harmonics. The more steady a sound is, the less audible the phases are. Thus, for reproducing attack sounds phases may be important, for PWM rather not. My 'pseudo-PWM' approach has completely wrong phases, too. Jens Groh ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ Re: Actual K5000 Waveforms Wednesday, 08-Jul-98 04:04:24 194.172.230.108 writes: Hey - the Saw3 PCM wave is almost a negative Saw2 PCM wave! Know what you can do with that? Pulse width modulation! Just mix them together. All other settings must be identical, except the fine pitch parameter. Jens Groh ------------------------------------------------------------------------------------------ Re: Re: Actual K5000 Waveforms Thursday, 09-Jul-98 10:35:05 192.28.2.16 writes: It works! In fact, it makes a similar effect with many PCM and ADD waveforms other than Saw 2. leiter ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------