http://dl.dropbox.com/u/254701/blog/testengine.swf (WARNING: It's LOUD!)
I've been working off and on to get this going. Tonight I made some breakthroughs and got it sounding more-or-less like the Casio CZ series does. While simple, it's not a super-well documented technique, and I'm still learning DSP, so I'm way happy it works now
.
Play with it by drawing around in the top envelope window. Drawing at the top area (representing values down to 0) slows and smooths the waveform; the low area(values going up to 2) make it oscillate more. The most interesting timbres seem to be with mostly 0 or near-0 values - that is, at the top of the envelope. High values in the middle or bottom will mostly produce variations on resonant sounds.
How it works: (
with more pictures)
1. Start from a sine wave running at the desired frequency.
2. Modify the phase of the sine wave according to the drawn envelope, which runs at some other frequency(in this test, modulated by an LFO so you can hear the sweep effects).
What it looks like. The CZ synths contain built-in wavetables that reproduce "analog-like" waveforms - I like the flexibility of drawing though.
3.
Hard-sync the resulting waveform. This allows the timbre to change with the phase modulator's frequency, producing all the cool resonant filter effects, without affecting the base frequency. (in DX-type FM synthesis, there's no sync; wavelengths with "nice-sounding" ratios(2:1 4:1 etc.) are generally used instead to preserve a musically useful timbre)
4. Apply a triangular downsloping volume envelope to the resulting waveform, also hard-sync'd. That is, volume starts at maximum at the outset of the sine, and drops linearly to 0. Between this and the use of a sine wave as the basic oscillator, most sources of aliasing are removed, since the discontinuities are naturally smoothed out. The test shows a single cycle, which clearly shows the envelope. I might try playing with this envelope's character at some point and see if it's worth modulating for additional timbres.
Why it's awesome:
It's computationally cheap and thus potentially suitable for use even in real-time web-games. Everything is done in the time-domain, yet it sounds good and can get "sort of" analog results, or near-identical-to-FM ones, depending on what you're doing. And it's quite easy to program sounds for, unlike the DX-type FM, which is theory-heavy and tends to explode into chaos easily.
I'm thinking that if I develop this further with dual oscillators, more modulation options, etc., and pair it with a basic sampler, I'll have a totally jawsome sound engine on my hands.
Some examples of Casio CZ patches:
3