W
-oscillator wave type collectionHere's a list of wave types with rendered audio for the W
oscillator. Apart from the built-in types, there's also recipes for making various wave types using modulation techniques.
Each instance of W
can use any one wave type in the built-in set – available to listen to below, these waveforms are also described in the wave type table on the language page. This built-in set is meant to make the most useful static waveforms easy to reach for. Of course, further types of waves can be made by combining several W
instances, adding waves of different type, frequency, phase, polarity, etc. – or modulating them.
The WAV files for the types have been produced with an extra-high sample rate and downsampled; this makes particularly the saw
wave cleaner, but the difference with simpler rendering is otherwise difficult to hear.
Sine.
Wsin t3
Triangle. Mellow – upper harmonics decrease fast.
Wtri t3
Square root of sine. Medium-bright – upper harmonics decrease moderately fast.
Wsrs t3
Square. Bright – upper harmonics decrease slowly.
Wsqr t3
Evenangle. Mellow – upper harmonics decrease fast.
Wean t3
Catear. Medium-bright – upper harmonics decrease moderately fast.
Wcat t3
Eventooth. Bright – upper harmonics decrease slowly.
Weto t3
Parabola. Mellow – upper harmonics decrease fast.
Wpar t3
Mellowtooth. Medium-bright – upper harmonics decrease moderately fast.
Wmto t3
Sawtooth. Bright – upper harmonics decrease slowly.
Wsaw t3
Half-rectified sine. Mellow (louder harmonics) – upper harmonics decrease fast.
Whsi t3
Sine parabola. Mellow (quieter harmonics) – upper harmonics decrease fast.
Wspa t3
Using AM options allows combining waveforms using multiplication of amplitudes (with different shifting and scaling). Apart from more complex sounds and uses, some simple waveform recipes give familiar results.
Below examples use the long-form syntax for value range modulation. Where it says a0..1.r
the same thing could instead be written in the short way as a0.r1
. (In fact everything can be written equally well in either way here, as at most one endpoint has modulators of its own. The mental arithmetic is pretty easy too here, with the key amplitude values for modulators just -1, 0, and +1.)
Simple variations on sines include the Yamaha OPL2 & OPL3 waveforms, used in those FM synth chips and a number of chiptunes. All of these waveforms except type 0 (just a sine), type 6 (a square wave), and type 7 (the "logarithmic sawtooth" a.k.a. "derived square" wave) can be produced using a sine wave and AM which adds one or two Wsqr
square wave modulators, flipping amplitude polarity for and/or muting segments of the sine waveform.
Sine. Waveform 0. Nothing to be done.
W
Half-sine. Waveform 1. Needs one square wave, with the same frequency, for 100% depth classic AM. (Amplitude drops to 0 when the square wave is low.)
W a0..1.r[Wsqr r1]
Abs-sine. Waveform 2. Needs one square wave, with the same frequency, for ring modulation (RM). (Amplitude flips polarity when the ± 1.0 square wave is low.) Note that the base frequency doubles as a result.
W a0[Wsqr r1]
Pulse-sine, a.k.a. pseudo-sawtooth. Waveform 3 (1⁄4 sine alternating with 1⁄4 silence). Needs two square waves, one with the same frequency (for amplitude polarity-flipping to make both halves the same) and one with the double (to cut amplitude to 0 every other quarter of the waveform). Note that the base frequency doubles as a result.
W a0..0[Wsqr r1].r[Wsqr r2]
It would work equally well to write this using a0[Wsqr r1 a0..1.r[Wsqr r2]]
, which unlike the above can also be written using the short-form syntax (using a0.r1
and not a..1.r
).
Sine – every other cycle only. Waveform 4. Needs one square wave, of half the frequency, to cut amplitude to 0 every other cycle. Note that the base frequency halves as a result.
W a0..1.r[Wsqr r1/2]
Abs-sine – every other cycle only – a.k.a. camel sine. Waveform 5. Needs two square waves, one with the same frequency (for amplitude polarity-flipping to make both halves the same) and one with the half (to cut amplitude to 0 every every other cycle). Note that the base frequency halves as a result.
W a0..0[Wsqr r1].r[Wsqr r1/2]