SAU examples with rendered audio

Example scripts for the SAU language, and audio files rendered from them using the saugns program. For short files that produce wave or noise types, etc., these are uncompressed WAV files so that the signal can be accurately viewed in an audio editor. For longer and other kinds of examples, MP3 files are provided; the uncompressed originals can be retrieved by re-rendering audio from the scripts.

These are not all the available examples; a somewhat different collection is included with the saugns program. Even more can be found in the extra-scripts git repository. Rather, this page gives how-to pointers for designing sounds using main SAU features, beyond what's on the main language page. It also showcases some sounds for all visitors.

If you want to hear more of a script which here has a shorter duration, often it's possible to just copy it, adjust the t-number part(s) – for example, if it says t30, make it t10*60 for 10 minutes – and then re-render the audio. (Some scripts have no timed substeps, other scripts have timed parameter value changes or sweeps; the sound of tweaking t-values may differ depending on where and how they're used.) You can also try out tweaking scripts to add, change, or remove sweeps, and the use of LFOs, in addition to simpler parameter changes.

Contents

Subpages

N (Noise generator) examples

See also the simple test signal examples on the usage page.

The N noise generator isn't so musically interesting in itself – but for modulation purposes, N can sometimes be handy as a way to add some plain noise to a parameter. An example can be seen among the R soundscapes.

For adding plain noise, N has a superset of the noise types of R (though somewhat different labels are used for N noise types compared to R modes).

R (Rumble/random line segments oscillator) examples

The R rumble/random line segments oscillator was invented for the SAU language, combining the value noise generator and through-zero "FM operator". (R can also be used in a mode which turns it into a plain naive oscillator.) It is easily used for noisy sounds with a rumbly character, or to introduce some pseudo-random variation to timbre, tone, etc. by modulating things with it. It has many modes, and sounds from it can be sharp and noisy or mellow and rumbly, but it can require extra processing to get something in-between those extremes out of R.

Examples below demonstrate some of its features and basic uses. It's often used together with W – the wave oscillator – but not always; in carrier-and-modulator chains, both R and W can play either role (carrier or modulator) in any combination.

Rumbles & blasts using R

Test tone rumble. This is to the R oscillator what a 440 Hz test tone is to the ordinary W oscillator. The base frequency is likewise the default 440 Hz – bright for a rumble, and similar to low-pass filtered white noise.

WAV
Rcos t3
Waveform image

Various other waveform variations are possible, e.g. using Rlin for some added odd harmonics, mv for a less bassy sound, or mg for a more Gaussian amplitude fluctuation pattern. With all the line types and modes, there's many combinations – too many for a full table of them all to be useful (unlike the simpler wave type palette for the W oscillator). However, more are described in a blog article on such noise types (and modulation using them) giving a more technical desription of the R oscillator.

Deep rumble. Using Rcos with a low frequency (here 50 Hz) creates a deep rumble, suitable as an ambient sound (and similar to some differently-sourced rumbles in ambient tracks). Note that to hear this, you'll need speakers or headphones that can reproduce low frequencies.

MP3
Rcos f50 t15

There's however also other ways to make rumble, like using a Wsin carrier and then using Rcos as an FM modulator. Some variations on that theme – simply tweaking the parameter values – can make for thunder-like, explosion-like, and other sounds.

Explosion. Here's a "large explosion" blast which also includes a nice exponential fade-out at the end. A detail for the fade-out part (though its absence would have been hidden quite well by the fade-out) is that the pitch of the main modulator is frozen at the same time as the fade-out sweep begins. (The pitch is determined by the sub-modulator 'p', and its frequency is set to 0 Hz, freezing its output.)

MP3
Wsin f-500.r+500[
        Rcos r1.r10[
                'p Wsin p3/4 f1/5
        ]
] t5 /5 a[g0 lexp] t1.5 @p f0

Cat purr. A very different kind of richer rumble – imitating cat purring – is also possible with Rcos as a carrier, but a little more intricate. This uses a combination of AM (to shape the amplitude envelope, and brighten the sound), and a little PM (to make a somewhat richer sound). However, it sounds a little too dull compared to real cat purring.

MP3
Rcos f50 p[
        Wean r1 a1/2
] a1/3[
        Wsin r1 a0[
                Wspa f1 a1/3
        ]
        Wspa f1 a1/3
] t30

Drumming using R

See the R drum collection for more.

There's several ways to use R instances for drumming, but the main possibilities come from using it for modulation. In particular, using an Rxpe PM modulator to make a carrier "beat" like a drum is a key ingredient in a range of simple recipes; apart from that modulator, the sound greatly depends on the choice of carrier. A more polished sound also usually depends on adding modulation of the amplitude to the carrier – for example using another R instance.

Looking first at the Rxpe PM modulator, intensity and pace of drumming can be constant or be psuedo-randomly varied, by tweaking its mode, frequecy, and amplitude. For a fixed-pace drumbeat, fixed cycle mode mf or ternary smooth mode mt can be used – otherwise it will be pseudo-random drumming, which can be given a variety of simple patterns (varying the brightness or intensity, the timing, or both). More variations are also possible by using several PM modulators with different settings for the same drum.

Technically, these drum sounds contain two different types of drum beat events which sound the same or similar. The PM modulator may rise (sharply at first), or it may fall (sharply at first) – and both will brighten the carrier's sound in the same way. If a W wave oscillator is used as the carrier, with its frequency set to 0 Hz, it will sound the same – but with an R oscillator as the carrier, it will normally sound a bit different, because R is pseudo-periodic and each part of its signal makes for a somewhat different drum hit.

For a start, here's a simple drum script with named variables for quantities like bpm and for "strength" (intensity and brightness) of the drum sound. The carrier has a very low frequency, rather than a frequency of 0 Hz – this helps vary the sound a little over time, instead of making it alternate between the exact same back-and-forth beats all the time. Otherwise, the f$bpm/(60*2) could be moved in to the modulator, with f0 added to the carrier. (A somewhat higher carrier frequency can also be used to produce a background hum or bassy noise which alternates with the drumbeats. For example, reusing the 'strength' variable, as in f$strength.)

MP3
$bpm=240
$strength=100
Rlin f$bpm/120 p[
        Rxpe mf a$strength*(120/$bpm)
] t30

It's a start, but without more it sounds a little rough in several ways. The subjective audio quality can be improved, among possibly other and much larger changes, by tweaking the carrier. Even then, without also adding amplitude modulation, such drum sounds have flat peak amplitude, the sense of intensity change coming from frequency change only – which usually sounds too soft or flat to be musically nice.

Soundscapes and pseudo-melodies

Using R can easily create pseudo-melodies and (to a lesser extent) pseudo-rhythms, that is pseudo-random melodies and rhythms which simply keep going and developing until the time runs out. These will have relatively simple patterns and won't stick to the norms of harmonic composition, but can be nice enough as background sound. (Note that the simplest R randomized "synth instruments" trick of using an R carrier with a very low, single-digit Hz frequency, and then modulating it into making a bright synth soundscape, usually results in plenty of infrasonic frequencies remaining in the signal – a rumbly quality may or may not be audible.)

The unusual "ternary smooth random" mode (mt) makes for a more harmonically pure and steady signal than other modes, apart from the fixed cycle mode f. This can make R oscillators usable as more deeply nested modulators, for producing a sharp and crisp sound, when even a small amount of noise in such a role otherwise leads to a more diffuse result, overpowered or at least diluted by noise. The following soundscape is a simple example; here, the Gaussian mode mg is also used for the R carrier instead of the uniform random default, as a simple way to get more loudness fluctuation to the sound.

MP3
$f=10/3
Rcos mg f$f t60 p[
	Wsin r10 a4 p[Wsin r-2.r+2[Rlin mt p0/4 f20*$f]]
]

More harmonically rich line and wave types, like using Rlin and/or modulating with Wtri, can also sometimes result in pleasant sounds.

Use with N. The following script goes a step further, and uses Nwh to noisily stretch out the frequencies of the wave oscillator in the middle of the modulation chain to a larger range; why pick one frequency, or another, when each makes the sound a bit fuller in some way, when you can instead use noise to select all of them? For "real FM" as done here, this colors the sound with brown noise, not white noise, as a result of integration taking place inside the middle oscillator – so the result isn't harsh.

MP3
$seed=2
Rlin f3 t60 p[Wtri r8.r32[Nwh] a2]

Randomized "notes". While the above example has a random mixture of sounds in a range of them, it also stays quite flat in that it seems to stick to the same note. For a better pseudo-random "melody", R can be used instead of N as an inner FM modulator. But while it may seem intuitive to use Rsah to vary the frequency – resulting in squarish jumps between different frequencies – doing so sounds rather stiff. By contrast, Ruwh is a noisy line type (described further below), adding varying amounts of white noise to the squarish steps, which sounds more organic or "fluid" in how frequency varies.

MP3
$seed=0
Rlin f3 t60 p[Wtri r8.r32[Ruwh f1] a2]

This sounds quite soft, and for simple scripts like this, much in the sound will change with tweaks to line and/or wave type selection in carrier or outer modulator, and how they modulate. Here's a different sound, a preudo-random bass melody.

MP3
$seed=1
Rlin f2 t60 p[Wmto r8.r64[Ruwh f1] a2]

Note that the non-quantized random values used to vary the frequency makes it hit notes outside the customary 12-tone scale. Simple scripts for this kind of pseudo-melody always end up microtonal.

Noise-on-noise

There's a simple way to produce more intricate, very bright and noisy sounds. While the usual line types result in a less bright spectrum above the f or r frequency used for an R instance, there is also a special noise line type – uwh (uniform white noise) – which fills the half-cycles with noise. The result also depends a lot on the R mode selection, which determines the differences in amplitude and DC offset between each noise chunk generated – the default mode gives such variation, others lessen or alter it in various ways.

Modulation is key to making the resulting sounds more intricate – but adding one wave oscillator is enough to produce a variety of noise-scapes, be they static, morphing, or with some pseudo-melody (in large part depending on the carrier frequency). Such sounds with the uwh line are much brighter than similar sounds made using normal line types for the R carrier – but generally too rough-sounding for many musical uses, like pleasant synth sounds, at least without some filtering afterwards. Here's a somewhat melodious one-liner.

MP3
Ruwh t60 f2 p[Whsi f30 p1/12 a2]

Switching the modulator to the saw wave type, and reducing the carrier frequency to a fraction would produce something else, sounding a bit more like low-fi electronics acting up.

Noise from Ruwh can also be used to modulate another signal – and if FM rather than PM is used, the result is more mild. Pseudo-melody examples above use it as it's less stiff-sounding than using the pure squarish Rsah to flip between frequencies.

Noisy sound effects, softer and harder

Apart from the full-on noise line type uwh, there's also two milder line-with-noise line types, which sound like the lin line type combined with a less intense white noise. This lesser noise is also limited in its bassiness, as it fades in and out over the line length.

The middling noise line type is nhl – "noise hump" line – which adds a noise that grows in intensity towards the middle of the line. The mildest variation is ncl – the "noise camel" line, named after the two softer noise bulges it has – which also sounds a little smoother and less bassy.

Here's a script using each of the 3 types for 5 seconds, from softer to harder – making a lot of little "blasts" which sound like something that may fit a 90s-style video game. (Some other related sound effects result if the modulator amplitude is changed, e.g. doubled.)

MP3
Rncl t15 f20 p[Wspa f30 a2] /5 lnhl /5 luwh

Other sounds using R

Metallic babbling

Using a wave oscillator to modulate an R carrier can produce a variety of audio textures – including vaguely sci-fi "metallic babble" or chattering. This example uses a triangle wave modulator (Wtri) – the frequency of the carrier, and in turn also the modulator, swept from a grim-sounding lower end to a more comical higher end.

MP3
Rcos ms f100[g300 lcos] p[
        Wtri r1/3 a12.5
] t15

Here the R mode ms produces deeper amplitude fluctuation, which sounds a little more "babbly".

W (Wave oscillator) examples

The oldest core feature is W – the wave oscillator – which can be put to a great many uses through modulation. This section focuses mainly on W use, while other kinds of examples highlight features of other generators or effects (even if they're used together).

The W wave types subpage covers the basic waveforms of this oscillator, with audio for each.

Self-PM bass sounds

Phase self-modulation (a.k.a. "feedback FM") can among other things be used to create a range of bass sounds, which sound somewhat like subtractive synthesizer sounds. In the following example, the strength of self-PM is modulated so that it's stronger at the peak of a sound and fades as the sound fades, making the sound mellower (less sawtooth-like).

This script has variables for varying bpm, pitch, and timbre brightness or "strength". For modulating the strength of self-PM applied, in place of using a downward sawtooth ramp, Rsqe mfh is used, as this gives a squared downward ramp, decaying faster.) For the amplitude, however, a gentler, more linear downward ramp is used – and to provide a smooth "attack" and "release" envelope rather than an instant rise, self-PM is used again to make the amplitude modulator rise fast and decay slowly (p.a0.5 giving it a pretty sharp rounded sawtooth without ripple).

MP3
$bpm?=120
$strength?=2
$pitch?=3
Wean f$pitch*30 p.a$strength/8[
        Rsqe mfh f$bpm/60 a$strength/8
] a1/8.r1[
        Wtri p.a.5 f$bpm/60
] t5; wspa; wtri; wsin

This script has 4 × 5 second parts, switching wave type for the carrier: first ean, then spa, then tri, and finally sin. Each gives a distinct sound; the ean type in this context sounds similar to sin, except that it gives a somewhat fuller sound and (unintuitively, as a result of how the carrier and modulation combine psychoacoustically) an illusion of a faint reverb like the other non-sine wavetypes.

Licensing of examples

CC0 To the extent possible under law, Joel K. Pettersson has waived all copyright and related or neighboring rights to the example SAU scripts and rendered audio files provided on this page and the examples subpages. This work is published from: Sweden.

To try to make that really clear, a script on this page appears as follows (assuming your web browser makes it stand out in any way)...

/* Script contents go here. */

Also, it would be interesting to hear if you make good use of this stuff in some work – and feel free to point people here, though it's not required.