Author: Snyxol (Alexander
Eslava)
Waveshaping can be described as an extension of overdrive, which can be used to alter a sound from subtle to extreme using only a few parameters. This synthesis method provides sounds ranging from "distorted through the roof" to smooth, fluid or even more complex soundscapes. The most flexible shaper within the µWave 2/XT/XTk/pc is the waveshaper-filter. Closely related to this is the Sin>LP-filter. The mixer before the filter in the signal path is capable of distorting the audio-signal in a couple of ways also. Furthermore the µWave provides us with an overdrive in the effects section.
Although it is up to each sound craftsman to create his sounds by continually trying, trying, trying....
there are certain cases, in which the slightest alteration of parameters may lead to radical results
and the waveshaper-filter is such a case. Thus being familiar with the behaviour of a waveshaper
is essential while attempting to create particular kinds of sounds.
So let's begin with the basics of waveshaping-synthesis and see what "mutilations" the shapers in the
µWave can do to the waves.
This will require some math, but don't be intimidated! It´s almost all high-school level!!
We will address detailed sound programming tips in the next workshop due to the size of this particular topic.
A shaper is a function f(x), which depends on only one variable x[n]. x[n] is the n-th sample of a control
or audio signal. Thus n is equivalent to the time, which in digital systems is quantisized by the sampling-rate.
Alternatively one can imagine a shaper as a table, which maps every input value x to an output value y=f(x).
Trivial special case: the linear* function f(x)=a*x with the constant a is an amplifier. It simply increases or decreases
the volume of the signal without changing the sound itself. Only the non-linear functions deserve the title "shaper".
Non-linear functions applied on audio-signals result in a distortion of the wave, which changes it's spectrum in a very weird and very difficult to describe way. Some overtones may be added or amplified while others are dampend, like in a very complex filter. So may we speak of a shaper as a filter?! Nope!
Filter: only the spectrum of the input wave is relevant. The waveform has no direct influence on the
sound color of the filter output. The phases of the harmonics might be deliberately shifted (which changes the
waveform, not the sound). It changes the spectrum distinctly (side-effect: the waveform changes, of course).
Furthermore it is just linear*. Which means:
1. if the input-amplitude is changed by the factor a, then only the output-amplitude is changed by a, as well. The
spectrum however remains the same.
2. It doesn't matter, whether two waves are first mixed and then filtered, or vice versa. One can't hear whether a
sound contains one voice, in which two detuned sawtooth of equal amplitude are filtered, or two detuned voices
in each of which only one sawtooth is filtered.
Waveshaper: only the waveform of the input wave is relevant. The spectrum of the input-wave has no direct
influence on the sound color of the waveshaper output. Thus the phases of the harmonics must not be shifted freely,
because this would bend the waveform itself and changing the tonal color. It distorts the waveform distinctly
which is followed by a complex change of the spectrum most of the time.
In general a shaper-function is non-linear:
1. if the input-amplitude is changed, then also the waveform and thus the spectrum.
(exception: f(x)=x²; f(a*x)=a²*x². the wave x² only changes it's amplitude while the form and the
spectrum remain constant; this is generally valid for exponential functions)
2. it is a relevant difference whether two waves are first added or distorted. If the sum of two equal,
detuned oscs is distorted, the result will be a periodic, wobbling changing of the sound, which may
sound more or less earthy and strange, depending on the shaper-function.
If a normal detune-hovering is required (as without distortion), there are two detuned voices to be used
per note and one shaped osc per voice (or even both shaped, but not detuned).
While FM distorts a wave horizontally (in time), wave-shaping distorts it vertically.
If a shaper is placed immediately after an oscillator, the result is a new constant waveform with a new harmonic
spectrum which can be deliberately filtered.
Even more fascinating is shaping placed after the filter. The most well-known type is probably the filter-overdrive, which
enriches a muffled low-pass-filtered sound with new, even different harmonics and thus modifies it from warm and dark
to crunchy and rough. This post-filter-distortion destroyes the prior work done by the LP-filter (dampening higher harmonics).
The filter is mainly abused for changing the waveform of the oscillator. Eventhough a filter-sweep sounds very smooth and
the spectrum morphs slowly, the filter modifies the output-wave quite heavily, even with slow cutoff frequency modulation
and mainly at great resonance-values.
Since, as is well known, the shaper reacts on waveform-changes, the shaper-output
morphs stunningly fast. The result is a wild, crazy and drastically changing sound.
Though there is snag: Aliasing. Even if the oscillator is band-limited (free of aliasing), the shaper function adds frequencies to the spectrum which are above half the sampling rate (Nyquist-frequency). Digital audio systems cannot handle those above-Nyquist-frequencies correctly, but mirrors their frequencies around half the sampling rate, which transforms those overtones into wrong ones ("alias" tones), sounding dissonant and metallic-like. This is not necessarily awful-sounding , it´s a matter of taste and sound category. E.g., aliasing can add a cool digital spice to aggressive distortion sounds.
a) Parabolic distortion: f(x)=x²
All input-samples are squared. A sawtooth-wave e.g. is distorted to an overtone-poorer parabolic wave.
(this can also be accomplished by Ringmodulation: multiply two sawtooth-waves of equal phases)
b) Exponentiator: f(x)=a*exp(b*x) with constants a,b
...is often used for controller-signals. Using this a synthesizer computes the frequency of it's oscillator deriving
from the note-number. In general all logarithmically scaled parameters like volume, lfo-rate and envelope-times are
transformed this way.
c) Hard-clipping: f(x)= {x, for |x|<1}
{+1, for x>+1}
{-1, for x<-1}
The signal x gets abruptly limited to the range of [-1;+1]. Dull waves are enriched with many harmonics. While using
as filter-overdrive, the result sounds harsh scratching, works great for biting agressive sounds.
d) Soft-clipping / saturation: e.g. f(x)=(arctan x)/pi
or
f(x)=(sign x) *(1-0,25/(|x|+0,25)) (build up of hyperbolics)
or
f(x)=1-(x-1)² , for 0<=x<1; |
f(x)=-1+(x+1)² , for -1
The signal x is smoothly limited to the range of [-1;+1]. Contrary to hard-clipping, the signal is not cut abruptly, but follows
the smooth transition to the saturation value. This enriches dull sounds with more low and middle than with high harmonics. There
are many possible functions for this same effect, but they all sound different.
Analog tapes creates a similar saturation-behaviour which provides a mix with a warm characteritic. (Because of this behviour many
producers prefer to work with old tape decks rather than using digital epuipment.)
This effect is also suitable for filter-overdrive: decreasing amplification before saturation results in a warm, smooth grunge.
Using extremely high pre-amplification ends up with a harshness equal to hard-clipping.
as described on page 46 in the manual.
The mixer of the oscillator section applies it´s own waveshaper (with 2 selectable functions) on the sum of the
input signals (ringmod + noise + wave1 + wave2), limiting the output to the range [-M;+M], with:
M: maximal mixer output amplitude
(though the ROM and RAM waves are stored in only 8 bit resolution (quantizing to 256 steps), the output of
each oscillator is a smooth interpolated 24 bit depth signal. the Motorola 56303 DSP inside the MW2
computes with 24 bit fixpoint numbers, providing 16.7 million equally big quantization steps.)
The "saturation" mode does hardclipping.
"Overflow" distortion mode: to samples of the mixer sum, which are in the
forbidden range of x>+M OR x<-M, the values -2M or +2M, respectively, are added. This simulates the numeric overflow of the µ-Wave1 and PPG Wave.
The harsh transitions generated by the overflow-clipping are equivalent to adding pulse-waves (with variable pulse width).
Another way to visualize overflow:
if the level of the mixer-sum is beyond legal range, some "magic" pulse-waves are mixed into it (see graphics).
Those pulse wides can be well-directed adjusted by modulating the amplitudes of the mixer-input-sources.
Overflow function: f(x)= {x, for |x|<=M}
{x-2M, for +M
(this formula is applicable only if wave1+2 and ringmod are chosen in the mixer. This way the sum never exceeds 3M.
If noise or the external input is engaged as well, any sum-sample may overflow even two times.)
...always beware of overflow introducing heavy aliasing.
Here is a sine-shaper inserted after the mixer and BEFORE a 12dB-LP-filter.
Because the mixer-output is always within the values of [-M ; +M], the definition range (possible x values) [-M ; +M]
is sufficient for the shaping function. At increasing amplitude the input-signal first
gets compressed softly at the upper and lower peaks. As the amplitude exceeds the M/2-threshold,
peaks get wrapped towards the zero axis.
Sinus-Shaper: f(x) = M * sin (p /M * x), -M <= x <= +M
... now let's engage this function to shape a triangle-wave of rising amplitude (without filtering):
Snyxol
Snyxol@web.de
A slightly different version of this workshop was originally published at Amazona.de