Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sounds

Every sound in claudius is real audio: synthesized in code (drum voices, the synth engine) or recorded (sampled instruments and drum machines from the sample packs, Apple Loops, your own files). There is no General MIDI and no neural audio. A sound name appears in two places:

  • the words of an s() pattern: s("bd*4, [~ cp]*2");
  • .s(name) on a note(), n(), chord() or seq() pattern: note("a1 c2").s("upright_bass").

claudius sounds renders every drum voice, synth preset and transition effect into out/sounds/ so you can hear them; claudius-packs aliases lists every sampled-instrument name your installed packs answer to.

How a name is resolved

A number after the last colon is a variation (bd:3, tr808:sd:2); the rest is the name, colons included (tr808:sd, vsco2:violins). When a track is made, each name is looked up in this order, and the first match wins:

  1. With .bank() set, the name is looked up in that bank only.
  2. Drum names play the synthesized drum voices.
  3. Synth presets play the synth engine.
  4. The sample packs: sampled instruments (rhodes, vsco2:violins) and kit sounds (tr808:sd).
  5. Files: a name containing / or ending in .wav, .mp3, .aif, .aiff, .flac, .caf, .m4a, .aac, .ogg or .opus.

Anything else is an error that lists what exists:

blank("house");
track("x", s("bdd*4"));
Error: Runtime error: track 'x': unknown sound 'bdd' (drums: bd kick sd snare cp clap hh ch hat oh ohat rd ride cr crash lt mt ht tom rim rs sh shaker cb cowbell snap perc; synths: sub_bass 808 reese acid saw_bass pluck_bass organ_bass wobble log_drum pluck supersaw pad warm_pad stab epiano keys bell organ strings square_lead chip fm_bass rubber_bass moog_bass dist_bass deep_bass saw_lead pwm_lead whistle soft_lead glide_lead brass_lead fm_lead vox_lead solina glass_pad pwm_pad air_pad vowel_pad swell_pad tine_piano clav house_piano brass_stab rock_organ fm_marimba fm_kalimba harp_pluck mallet cowbell_lead; sampled: piano upright rhodes wurlitzer hammond string_ensemble violins cellos pizzicato brass trumpet flute harp marimba vibes kalimba upright_bass guitar choir sax ... (claudius-packs aliases)) (line 2, position 1)

Because drum names and synth presets come first, a few names play synthesis even when a recording by that name exists. Ask for the recording by another name, or exactly as pack:instrument (claudius-packs instruments lists them):

nameplaysfor the recording, write
epianothe FM electric piano synthrhodes, wurlitzer
keysthe FM keys synthpiano, upright
organthe drawbar organ synthhammond, church_organ
stringsthe string-machine synthstring_ensemble, violins
pad, warm_padthe synth padssynth_pad, new_age_pad, bowed_pad
shaker, cowbellthe synthesized drum voicesvcsl:shaker, tr808:sh, tr808:cb

lead is not a synth preset: it plays the sampled FreePats square lead. The synth leads are square_lead, supersaw and the other synth presets.

Drum names

These names play the synthesized drum voices. Each one also decides the mixing role of its track, wherever it appears in the name: bd:3 and tr909:bd are kicks, tr808:sd is a snare, vcsl:shaker a shaker.

namesvoicerole
bd, kickkickkick
sd, snaresnaresnare
cp, clapclapclap
hh, ch, hatclosed hi-hathat
oh, ohatopen hi-hatohat
rd, riderideride
cr, crashcrashcrash
lt, mt, ht, tomtom (low 90 Hz, mid 130 Hz, high 180 Hz; tom is the default tuning)tom
rim, rsrim shotperc
sh, shakershakershaker
cb, cowbellcowbellperc
snapfinger snapperc
perca tuned percussion hitperc

Synth presets

The synth engine has polyBLEP oscillators with unison and analog drift, state-variable and ladder filters, FM, glide and drive. These are its factory presets; the role is what role_of assumes for a pattern track.

presetsoundmonoassumed role
sub_bassa sine sub with a little driveyes, tied notesbass
808a sine with a pitch drop, long decay and heavy drive; glidesyesbass
reesetwo detuned saws and a saw an octave down, a slowly moving ladder filter; glidesyesbass
acidone saw into a resonant ladder filter with a snappy envelope; velocity opens it; glidesyesbass
saw_bassdetuned saws and a square an octave down, filter envelopeyesbass
pluck_basssquare and saw with a short filter pluckyesbass
organ_bassthree sine drawbars (fundamental, octave, two octaves)yesbass
wobbledetuned saws and a square, ladder filter swept by a tempo-synced LFOyes, tied notesbass
log_druma sine knocked into its note, a pitch drop and a woody FM click, dying away; glides a littleyesbass, when named (amapiano’s)
pluckthree detuned saws and a square an octave up, fast filter decaynoby pitch
supersawseven detuned saws plus three an octave down, delayed vibratonoby pitch
padfive saws and a triangle, slow attack, long release, slow filter driftnoby pitch
warm_padtriangles and a pulse, slower and darker than padnoby pitch
stabdetuned saws and a square, short with a filter snapnoby pitch
epianoFM tine electric pianonoby pitch
keysbrighter FM keys with a shorter decaynoby pitch
bellFM bell, long decaynoby pitch
organfive sine drawbars, sustainednoby pitch
stringsfive detuned saws, slow attack, delayed vibratonoby pitch
square_leadsquare and saw an octave up, vibrato; glidesyesby pitch
chipa 25 % pulse, shortnoby pitch
fm_bassa sine whose FM brightness falls away fast, over a subyesbass
rubber_bassa square and a sub through a resonant low-pass; glidesyes, tied notesbass
moog_basstwo saws and a square an octave down into a ladder filter; glidesyes, tied notesbass
dist_bassdetuned saws and a square, driven hardyesbass
deep_bassa triangle with a quiet octave and a sub, soft and roundyes, tied notesbass
saw_leadthree detuned saws and one an octave down, delayed vibrato; glidesyes, tied notesby pitch
pwm_leadtwo pulses of different widths, beating; glidesyes, tied notesby pitch
whistlea sine with a breath of noise and a wide vibrato; glidesyes, tied notesby pitch
soft_leada sine and a quiet triangle an octave up through a soft low-pass, slow to speak, a late vibrato; glidesyes, tied notesby pitch
glide_leadthe whine of G-funk: a sine and a quiet saw through a ladder filter, gliding a long way from note to note, a slow vibratoyes, tied notesby pitch
brass_leadsaws whose filter swells open, as brass doesnoby pitch
fm_leadan FM lead that keeps some brightness as it holds; glidesyes, tied notesby pitch
vox_leadsaws through a drifting band-pass, like a vowel; glidesyes, tied notesby pitch
solinaa string machine: six saws and three an octave up, slow attacknoby pitch
glass_padFM with a slow attack and a long release, bright and glassynoby pitch
pwm_paddetuned pulses with a slow filter driftnoby pitch
air_padtriangles and noise, very slow, breathynoby pitch
vowel_padsoft waves through a resonant low-pass, an “ah”noby pitch
swell_padsaws under a filter that sweeps slowly up and downnoby pitch
tine_pianothe bright FM electric piano of the 80snoby pitch
clava narrow pulse through a band-pass, short and funkynoby pitch
house_pianoa bright FM piano with a short decaynoby pitch
brass_stabdetuned saws with a quick filter snap, shortnoby pitch
rock_organdrawbars through an overdriven amp, with a speaker’s wobblenoby pitch
fm_marimbaan FM bar, quick decaynoby pitch
fm_kalimbaan FM tine, pluckednoby pitch
harp_plucka triangle and a little saw, plucked with a filter decaynoby pitch
malletsoft sines, a struck bar ringing outnoby pitch
cowbell_leadthe 808’s cowbell made to play a tune: two squares a little under a fifth apart through a band-pass, struck and dying fastnoby pitch

“By pitch” means a pattern track gets the role chords when it is a chord() pattern, bass when its median note is below E3, and lead otherwise. Mono presets play one note at a time; with glide, overlapping notes slide (see legato()).

Sampled instruments

With the default packs installed (claudius-packs install --defaults), these names play multi-sampled recordings with velocity layers and round robins. Most have several aliases; claudius-packs aliases prints them all.

familynames
pianos and keyspiano (Salamander grand), upright, rhodes, wurlitzer, cp80, pianet, fm_piano
organshammond, church_organ
stringsstring_ensemble, violins, violas, cellos, contrabass, pizzicato, spiccato, solo_cello, solo_cello_pizz, erhu, erhu_short, erhu_sul_tasto, bowed_psaltery
brass and windsbrass, brass_stabs, trumpet, horn, trombone, tuba, woodwinds, flute, oboe, clarinet, bassoon, piccolo, sax, harmonica, ocarina
mallets and bellsharp, marimba, vibes, bowed_vibraphone, xylophone, glock, bells, hand_chimes, kalimba, balafon, steel_pan, hang, water_glasses, wine_glasses, timpani
bass and guitarupright_bass, bass (electric), pick_bass, synth_bass, guitar (nylon), electric_guitar, jazz_guitar, dan_tranh, dan_tranh_tremolo
voiceschoir, voice
synths, recordedsynth_pad, new_age_pad, bowed_pad, choir_pad, synth_strings, synth_brass, lead, clavisynth (Yamaha TX81Z)
percussionbongo, conga, cajon, darbuka, frame_drum, slit_drum, tambourine, cabasa, claves, woodblock, agogo, guiro, triangle, sleigh_bells, vibraslap, mark_tree, claps, gong, suspended_cymbal, anvil, brake_drum, finger_cymbals, bell_tree, didgeridoo, tabla, stomp, chest, belly, heel
electronic one-shotselec, glitch, mehackit, glitch_kit, glitch_kit_2, Sonic Pi’s names (elec_blip, bd_haus, hat_snap)
effects and texturesambi (drones), vinyl, loop, tbd (pads), ocean_drum, flexatone, ratchet, siren, aliens, zaps, sirens, metal_hits, glass_breaks, cymbal_gongs, chains, bubbles, vibra_rings, nepalese_bells, glock_gliss

pack:instrument names one exactly, in .s() or in an s() pattern: note("c4 e4").s("vsco2:violins"), s("vcsl:shaker*8"). A name that is also a drum name plays the synthesized drum; name the pack for the recording: s("snap clap").bank("body"), or s("body:snap").

The groups of one-shots (elec, zaps, glitch_kit …) hold their sounds as variations: s("zaps:3"), s("glitch_kit").n("<0 5 12>"). Sonic Pi’s sounds also answer to their own names, s("vinyl_scratch") being s("vinyl:3"). The hang plays only its own notes (A3 C4 D4 E4 F4 G4 A4 Bb4 C5 D5): the others ring along with each one, so pitching it would put them in another scale.

Every recorded instrument has a playable range; notes outside it are pitched from the nearest sample, which sounds stretched far from home. Songs that play instruments from packs whose licences ask for credit get a credits.txt in their folder.

A sampled instrument name used without its pack installed is an unknown sound, and the error ends with sampled instruments need packs: claudius-packs install --defaults. A session started with --synth-only (make, evolve, serve, studio and mcp take it) plays no recordings at all: a sampled name ends its error with sampled instruments are off in this session (--synth-only), and .bank("tr909") raises bank 'tr909' plays sample packs, which are off in this session (--synth-only).

blank("lofi");
key("D minor");
track("keys", chord("<Dm9 Gm9>").voicing(50, 72).s("rhodes"));
track("bass", note("<d2 g1>").struct("x ~ ~ x ~ x ~ ~").s("upright_bass"));
track("bongos", s("~ bongo [~ bongo] bongo:2").gain(0.6));

Sampled percussion from the packs gets the perc role by itself.

Drum machines and kits

.bank(name) plays the drum names of an s() pattern on a recorded drum machine or kit from the sample packs:

bankaliaseswhat
tr909909Roland TR-909
tr808808Roland TR-808
tr707707Roland TR-707
muldjordacoustic, acoustic_kit, rock_kita recorded acoustic kit
uzuthe uzu drum kit
synthdrumssynth_drumsdrums made on synthesizers after vintage analog kits
sonicpisonic_piSonic Pi’s kicks (bd), snares (sn), hats (hat) and rides, and its other groups
bodybody_percussionbody percussion: stomp, clap, snap, chest, belly, heel, cheek …

Each kit has a subset of bd sd cp hh oh rd cr lt mt ht rim cb sh (the 909 has no shaker, the acoustic kit no clap); names like kick and snare map to them. A name the bank does not have is an error:

blank("house");
track("drums", s("bd*4, bongo*2").bank("tr909"));
Error: Runtime error: track 'drums': no 'bongo' in bank 'tr909' (installed packs: salamander epianos jrhodes vsco2 vcsl tr808 tr909 tr707 uzu muldjord freepats doublebass growlybass voice sonicpi solocello erhu steelpan synthdrums body zamenhof miscellania; kits: tr909 tr808 tr707 acoustic uzu synthdrums sonicpi body) (line 2, position 1)

The bank applies to every word of the pattern. To mix kits, or a kit and a sampled instrument, in one pattern, name each kit sound with its bank instead: s("tr909:bd*4, tr808:cp*2, bongo*2"). Strudel bank names (RolandTR909) work as aliases, and Strudel sample maps added with claudius-packs add-map become banks too.

.bank("apple") cuts drum one-shots from installed Apple Loops (GarageBand or Logic content) instead. On a machine without Apple Loops it falls back to the synthesized voices, without an error.

blank("house");
track("drums", s("bd*4, [~ cp]*2, [~ hh]*4").bank("tr909"));

Variations

A number after the last colon (bd:3, tr808:sd:2) or .n(n) picks variation n of a sound (0 is the default):

  • on a kit, the recording numbered n: the 909 has 126 kicks, the 808 has 25;
  • on a synthesized drum, the same voice moved a few steps through its parameters (tuning, decay, tone …), the same way every time;
  • a variation a recording does not have is an error (no 'bd:200' in bank 'tr909').
blank("techno");
track("kick", s("bd*4").bank("tr909").n("<0 0 0 7>"));

Your own files

.s(path) plays an audio file as a sampler, on any note(), n() or chord() pattern:

track("vox", note("c4 ~ c4 [c4 c4]").s("/Users/me/Samples/vox.wav"));
  • c4 plays the file as recorded; other notes play it faster or slower, like a sampler without time-stretch.
  • On a track whose role is not a drum role, each note is cut at its length plus 50 ms, so legato() shapes it.
  • Paths cannot go inside a pattern string, so a file is set with .s(), or with drum_sound() for a drum lane of a generated song.
  • A missing file is an error: track 'vox': /Users/me/Samples/vox.wav does not exist.
  • When claudius is shared beyond your computer (a server reached by others), it reads files only from its own folders (saved songs, its caches, the sample packs, Apple Loops) and refuses others with ... is outside the folders this claudius may read.

To use a song or a loop as material, claudius chop cuts bar loops and drum one-shots from it into the user library, and claudius make --sample <file> flips a recording into a new song. See Remaking a song from audio.

Layered sounds

A bass in a modern track is rarely one sound. It is a rack of several playing the same notes, each doing one job: a clean sine underneath for the weight, a distorted mid on top for the growl you hear on a phone, and a bright top for the edge. Each is filtered to its own band of frequencies so they do not fight, compressed and distorted on its own, and often only the sub ducks under the kick while the rest holds. rack() builds a track that way:

rack("bass", [
  #{ sound: "sub_bass", band: [0, 100], duck: 0.8 },
  #{ sound: "reese", band: [100, 1000], level: -2, fx: [#{ fx: "saturate", kind: "hard", drive_db: 12 }] },
  #{ sound: "saw_lead", band: [1000, 0], level: -9, transpose: 12, fx: [#{ fx: "tremolo", beats: 0.25, depth: 0.7 }] },
]);
  • Each layer plays the track’s notes with its sound: a synth preset, a drum sound, a sampled instrument or a file, as drum_sound() and a part’s preset name one (with bank for a kit).
  • band: [low, high] keeps only those frequencies, in Hz, 0 for no edge on that side. The edges are crossovers that let bands meeting at an edge add up to the whole again, without a bump or a dip there.
  • level is in dB against the other layers. Each is first made as loud as the rest over its band, so a sound’s own loudness does not set the balance: -9 is a top nine decibels under the sub, as you hear it.
  • pan (-1 to 1) and transpose (semitones: 12 is an octave up) are the layer’s own.
  • fold: [lowest, highest] (MIDI notes, an octave apart at least) plays each of the track’s notes moved by whole octaves into them: fold: [28, 40] keeps a sub between E1 and E2, 41 to 82 Hz, wherever the line above it goes.
  • duck (0 to 1) ducks that layer alone under the kick: the sub makes room for it while the growl holds.
  • fx is the layer’s own chain, after its band. A tremolo or a gate there pulses that band alone, as a bass whose top flutters in sixteenths over a steady sub.

The bass-heavy genres stack their bass this way themselves. A trap, UK drill, phonk or hip hop song plays its 808 twice: once clean, and once through tape saturation kept to 300 Hz to 4.5 kHz, under a chorus that spreads it wide. That grit is what headphones and a phone hear of a bass, and the clean 808 under it keeps its weight on a subwoofer. Jungle, UK garage and grime give their bass the same grit from a tube saturator, and drum and bass a quieter one, since its reese is gritty already. Future bass puts a clean sine sub under its bass, an octave down because that bass sits high, ducking under the kick. Any other genre’s synth bass that has nothing under its note (an organ bass, a pluck bass, a distorted bass, a wobble) and plays above E2 gets a sine sub under it, folded into the sub octave (fold: [28, 40]) below 90 Hz and the bass above, the sub ducking half again as much as the bass: so the bass is felt on a subwoofer and heard on a phone. A sine bass played that high is folded down itself. A bass with a sub of its own (a deep bass, an FM, rubber or Moog bass, a reese), a recorded one and an 808 in the sub octave already play as they are. The song’s script shows the rack, to change like any other.

The rack sums its layers before the track’s own effects (fx()) and its mix, so the track is still one track: one row in the arrangement, one fader. It works on a part, a drum lane (a snare made of a snare, a clap and a noise burst) or a pattern track’s sound, named by its label when the pattern plays several:

drum("snare", "....x.......x...");
rack("snare", [
  #{ sound: "sd", band: [150, 6000] },
  #{ sound: "cp", level: -4, pan: 0.2 },
  #{ sound: "hh", band: [5000, 0], level: -10, fx: [#{ fx: "reverb", decay: 0.8, mix: 0.4 }] },
]);

One sound treated band by band works too, without layers: the band effect in a parallel effect’s chains splits a track into bands to process each on its own:

fx("bass", [#{ fx: "parallel", dry: 0, chains: [
  #{ amount: 1, fx: [#{ fx: "band", low_hz: 0, high_hz: 120 }] },
  #{ amount: 1, fx: [#{ fx: "band", low_hz: 120, high_hz: 0 }, #{ fx: "saturate", kind: "fold", drive_db: 15 }] },
] }]);

Sounds you cannot set from a script

A script names sounds; it does not edit them. The synth presets’ parameters and the tuning and decay of a generated song’s drum voices are set by the generator and changed by evolution. A script can swap them for other sounds: drum_sound() for a drum lane, part() for a generated part’s preset. Pattern tracks can add filters, a bitcrusher and saturation (see Track settings).