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.

Note that seeds for randomized sounds (see notes on audio generators) may differ between the audio for examples on these pages vs. rendered with the latest saugns version.

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 be handy as a way to add plain noise to a parameter. As mentioned on the language page, the result differs for using noise to do AM, FM, and PM. (Adding it to amplitude or phase usually sound fairly similar, while adding it to frequency changes the color of the noise in the direction of red/brown noise.) An example can be seen among the R soundscapes.

For adding plain noise, N supports many noise types of R (though somewhat different labels are used for N noise types compared to R modes), as well as plain red/brown noise.

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". It can also be used for 1D Perlin noise, as well as some other noise distributions and variations on waveforms (including a plain naive oscillator mode). 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 somewhat like a low-pass filtered white noise except more regular in waveform. The mode is the default mu (value noise based on uniform white noise).

WAV
Rcos t3
Waveform image

Test tone Perlin noise. This is the 1D Perlin noise variation on the above test tone rumble, sounding thinner. The peak in the frequency spectrum has also moved up to the 440 Hz frequency, instead of 440 Hz being where roll-off changes from gentle to steeper. Violet noise mode (using mv instead of mp) sounds somewhat similar, but a little darker and rougher for the same choice of frequency, more like high-pass filtered white noise based rumble in that way. Perlin and violet noise modes can also be used at the same time (mvp or mpv) for extra-thin Perlin noise.

WAV
Rcos mp t3
Waveform image

Various other waveform variations are possible, e.g. using Rlin for some added odd harmonics, mb for binary noise based waveforms with flat amplitude fluctuations, or mg for the opposite 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 an article series on such noise types (and modulation using them) on Joel's personal web site also 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.) Rsmo sounds similar to Rcos but creates a slightly brighter and more intense sound.

MP3
Wsin a0[g1 lexp t1/4] f-500.r+500[
        Rsmo r1.r10[
                'p Wsin p0/4.a1/2 f1/5
        ]
] t5 /5 a[g0 lexp] t1.5 @p f0

The use of self-PM in the innermost LFO modulator turns it into an envelope shape with a sharp attack and slower decay. This causes some phase drift though, adding to the need for a 1⁄4 second fade-in to accomodate the leading part. An older variation instead made a symmetriclly shaped "large fireball" sound (the innermost modulator looking like 'p Wsin p3/4 f1/5), with no fade-in.

Cat purr. A very different kind of richer rumble – imitating cat purring – is also possible with Rcos or something similar as a carrier. Rsmo sounds a little brighter and is used here. This is a little more intricate, and 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
Rsmo f50 p[
        Wean r1 a1/2
] a1/3[
        Rsmo 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
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
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
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

Vaguely speech-like soundscapes, which give the impression of a voice with an attitude while sounding very artificial, result from some simple combinations of a modulator and an R carrier. Here's three variations playing 8 seconds each.

MP3
Rcos f50 t8 p[
        Wtri r1 a12.5 t8; r1/3
]; f120 t8; mt f200 t8

Here the R mode mt for the last part gives a different electric sound to it, where the higher frequency otherwise fits less well.

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. It also offers modulation recpies for making other basic waveforms.

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.

R carrier "industrial" sound. A variation on the same script using R as a carrier can produce a rougher, richer bass sound. But most randomness modes sound bad for this – too rough! The best modes are the quasirandom t (ternary smooth) and a (additive recurrence), where for the latter the default setting of using ma.amet(1) gives a rich timbre; various other values for the m.a subparameter tend to sound darker or smoother, though not all. Every 5 seconds, this example alternates between testing modes t and a, switching line type after every pair for 4 × 2 variations.

MP3
$bpm?=120
$strength?=2
$pitch?=4
Rcos mt 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; ma; llin mt; ma; lsqe mt; ma; lnhl mt; ma

The pitch is set a notch higher in this version, as otherwise it sounds too dark – the spectrum extends down further anyway so it fits.

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.