Live

Sound

What a synth can do, in short, with links to the full pages. Everything here works on a line run again: the sound changes as it plays.

Grit and weight

synth(uid:fz, wave:saw, freq:[E1, B1, E2], fm:{ratio:1.41, index:6},
  fuzz:{starve:0.7, gain:40, tone:1800}, amp:0.2)
synth(uid:bass, wave:saw, freq:~A2, sub:{level:1, octave:2}, fuzz:0.6)
synth(uid:wall, wave:noise, crush:{bits:3, rate:2000}, comb:{freq:82, fb:0.97}, fuzz:0.8, amp:0.15)
synth(uid:grind, wave:square, freq:40, ring:follow(grind.level, 30, 900), clip:0.7, amp:0.1)

Noise sources: wave:noise (pink, brown), wave:dust (clicks, freq a second), wave:step (a random level held, freq times a second), and wave:in, the external audio input through the voice -- someone else's sound, mangled: synth(uid:them, wave:in, fuzz:0.8, crush:4).

synth(uid:fire, wave:dust, freq:sinOsc(0.1, 0, 20, 400), comb:{freq:110, fb:0.9}, fuzz:0.5, amp:0.2)
synth(uid:steps, wave:step, freq:Pwhite(20, 2000), dur:0.125, crush:{rate:4000}, amp:0.1)

The order in a voice: sub, drive, fuzz, fold, clip, ring, comb, crush, then the envelope. Any of their values can follow() a signal, drive: and fuzz: too. However loud it gets, the output stops at a ceiling just under full scale.

Reverb

reverb:{mix:0.3, time:2, damp:1800, pre:0.015}

A convolution room: time is how long the tail lasts, damp the Hz above which it dies four times as fast (600 a curtain, 8000 tiles), pre the gap before the room answers. A synth's room rings on after the sound stops (see Shaping). In the console, Tab after reverb: takes the whole {…} with its defaults.

Parameters that move by themselves

pan:sinOsc(0.4, rand(0, 1))                 swinging, each voice its own phase
filter:{type:lp, freq:sinOsc(0.1, 0, 200, 4000)}
amp:lfNoise(2, 0.02, 0.2)                   wandering
pan:triOsc(0.25)                            left, right, left -- smooth

sinOsc, triOsc, sawOsc, pulseOsc, lfNoise, lfStep -- (rate, phase, lo, hi). A saw jumps back at the end of each cycle; for a smooth sweep there and back, triOsc at half the rate. On a synth's pan, amp, freq, filter:{freq, q}; on an audio file's pan and amp.

Envelopes

env:{a, d, s, r} shapes the whole note; envPerStep:{a, d, s, r} strikes every step of a pattern with it.

Patterns

freq:Pwhite(40, 290)          anywhere in the range, each step
dur:Prand(0.25, 0.5, 1, inf)  one of these, each step
pan:Pwhite(-1, 1)             pan moves every step too
freq:Prand(60, 90, r, inf)    r is a rest

Arithmetic on values

synth(uid:a, freq:[110, 220.7, 330.4]/2)          the chord an octave down: [55, 110.35, 165.2]
synth(uid:b, degree:Pseq(0, 3, 5, inf)+2)          every step two degrees up
synth(uid:c, freq:Pwhite(30, 300)*4)               the range: 120 to 1200 Hz
synth(uid:d, amp:rand(0.1, 0.2)*0.5, dur:1/3)      the bounds halved; a third of a beat

An operator (*, /, +, -) and a number after a value -- a number, a list or chord, a pattern, rand() / choose() -- is worked out on it: element by element on a list, step by step on a pattern, on both ends of a Pwhite or Pexprand range, on a random call's bounds. Several are worked out left to right (440*1.5+1 is 661). A value that starts with an operator is something else: freq:*1.5 is relative to what is playing now. follow() keeps its own range: follow(bass.level, 200, 2000).

One room for several sounds

fx(room, reverb:{mix:0.5, time:4})           a bus with a reverb
fx(room, [pad, a1, a2])                      these go through it, together
synth(uid:bass, ..., bus:room)               ... or a sound says so itself
fx(room, reverb:{mix:follow(beat.phase, 0.2, 0.9)})
level(room, 0, 8)                            everything in it, faded

See fx().

Several at once

group(pads, [p1, p2, p3])                    one name for three
synth(uid:pads, amp:*0.9)                    each 10% quieter than it is
synth(uid:pads, freq:*2)                     every pad up an octave
level(pads, *0.5, 4)                         each fader halved, over 4 beats
pan:+=0.2 / pan:-=0.2                        nudged from where it is

See group().

Speech

say("bro what")                              a voice on this machine (Piper)
say(v1, "no shot", reverb:0.4, rate:1.3)     named, with a room, quicker
say("ts", trig:every(4, beat.hit))                    on every bar
text(uid:w, pick:["BRO", ["NO", "SHOT"]], dur:0.1, trig:every(4, beat.hit), say:1)
                                             each word flashed, spoken, up until it is said

See say() -- and how to install the voice once.

Microtones

freq:E1+10       10 cents sharp
freq:~E1-30      30 cents flat -- the ~ is needed going down
freq:m28.1       a MIDI number, fractions are microtones

E1-30 without the ~ could be a name (ids have hyphens), so cents down on a natural or flat take the tilde; cents up (+) and sharps (C#3+25) need none.

Keeping a lucky roll

A line with rand(), irand(), birand() or choose() in it shows, under it in the output, the line as it ran with the numbers rolled:

synth(uid:t, wave:pink, pan:rand(-1,1), filter:{type:bp, freq:rand(30, 740)})
= synth(uid:t, wave:pink, pan:-0.4006, filter:{type:bp, freq:649.2516})

Click it to copy; run it to hear the same again. (A pattern's values change every step, so they are not in it.)

Tip: use ← → or ↑ ↓ to navigate the docs