Limut live coding

Level:  

Beat: :

Audio: Visual: Limiter:

Examples

Copy and paste an example into the editor window, then hit the play ▶ button:

d1 play x-o-
p1 dsaw 0534, add=(0,2,4), dur=4
Ba dbass 0, dur=1/4, add=[0:2]r*2, lpf={[3:12]r*100,q:8}, att=0
d dsaw 4[32]<10>___.., phaser=1/3, envelope=simple, rel=this.dur*2, amp=3, room={2,mix:1/4}
ARP dsaw 02479742, dur=1/4, lpf={100*[3,30]l6.8,q:8}, Oct=(3,5), echo=3/8, att=0
Bass prophet -2210, dur=4, Oct=(2,3), amp=1.7
set bpm=125
set * swing=61
p play [X-]-(X*)<---[--^]>, high=4, pan=[-1/4:1/4]r
s tri 00[...0][.0..], dur=1, sus=1/6, att=0.05, room, oct=3, fold, phaser=1/16, amp=2/3, pan=[-1/2:1/2]l4@f+[-1/4:1/4]r, add=(0,2,4,6)
b dbass ...[02]...[0246], room=0.1, lpf={this.freq*[3:12]l11@f,q:15}, pan=[-1/4:1/4]r
d play x.h[.x]x[x.]h., room={0.1,mix:1/3}, amp=3/2
set chords=[0,2,4,3]t[16,8,4,4]
be bell 0[.......2], dur=8, add=chords
gl glock 024797.., dur=1/4, add=chords
Perc play lstig, dur=[1,3,2], amp=[1/6:1/2]l16, echo=1/8, pan=[-1:1]r
Amb ambi 0[21]., dur=4, release=8, room=2, pan=(-1,1)
Bass dbass 0, dur=8, att=2, rel=4, lpf=100*[3,30]l16@f
set Prog=[2,5,4,0]t8
Ba piano 0__2, add=prog, amp=4, Oct=2
Ch piano 0, dur=8, Sus=12, add=(prog+(0,2,4))%7, amp=2, Oct=3
Le piano 0_.[.0]2343, amp=3, add=prog, Oct=4
set scale=minor
Ba dbass 0.4[21], dur=4, amp=2, room=1.2, att=0.01, lpf=this.freq*[30,24,4]e1, phaser=1/8
Kd play V[.V]V., dur=2, room=1.1, echo=1/16, amp=2
Sn play .(xO), dur=2, room=1.1, echo=1/16
set bpm=120
set * swing=58
set scale=minor
k play Xv, room=1/4, amp=3/2
h play s-, dur=1/4, amp=1/2
ba saw 020.00.0.040.00., dur=1/4, oct=2, sus=1/6, amp=2, lpf={this.freq*[[4:25]l7,2]e,q:15}, room={1,mix:1/5}
set bpm=65
pad dsaw (024)(025)(035)(026), envelope=pad, dur=4, lpf=[600:3000]s21, oct=3, amp=[1.2:2.0]s70
padf ethereal follow pad, oct=4
pi ping 0, dur=[3,3,2]/20, amp=[0.5:1.2]n*[2:0]s96, oct=[3,4,5,6]t1/4, add=[0,5,3,4]t4+[0,[1:3]n32,4,[6:10]n37]r, sus=2, addc=[-.15:.15]n
v kal 0, tunnel, scroll={x:time/8}, monochrome, fore=rainbow, mid=white
b dbass [(04v).], dur=8, noisify=1/8, drive=2/8, fold=1, phaser=1/8, room=2, add=[2,3,1,0]t8, addc=wow, pan=[-1/2:1/2]r, chorus=2, att=1/2, rel=5
set bpm=145
set scale=minor
v streetlight 0
kd play (xv):, lpf=1000
hh play -, dur=1/4, amp=[0.2:1.2]n
kk play ::[::][::][::]::., lpf=[600:900]l40, rate=[0.8:1.2]n
ba dbass 0, dur=1/4, att=0, lpf=[1000:100]e, hpf=[0:500]n
pi ping [010], add=[-5:5]l18/4, amp=[0:[0:1]t96]n, echo=1/2, oct=6, scale=minorpentatonic
pad dsaw (-303), dur=16, envelope=pad, amp=[0:3/2]s64@f, room=0.5, lpf=[1000:3000]s32@f, oct=3, addc=[2,2,0,0]s[62,4,62,0]@f
set bpm=90
n noise 00, dur=[9,7], envelope=simple, bpf=523*[[1:5]e,[1:1/5]e]*[1:[1.1,1.25]]n1, amp=3/2, att=[2,1/4], rel=[9,7], pan=[-1,1]l8@f
p dsaw 0., dur=[3,1,5,3,3,4], addc=[1:3]r+[2,0]e, envelope=simple, att=0.1, rel=[0.4:0.6]r, oct=6, pan=[-1:1]n8, amp=[0.3:1.1]n8, room=1
s supersaw 0, dur=[1/4:1]l8, scale=penta, add=[-10:10]r1/2, room=2, lpf={[300,3000,300]e,q:11}, amp=2, phaser=1/4
v kal 0, mirror={100,fan:[7:12]s32@f/10}, zoom=3, mid=random, contrast
ld dsaw 0^.70-7.70, dur=1/4, scale=minor, add=[0,2,4]r+[0,2,3,0]t4, lpf={this.freq*[3/2,2,3,5]t4,q:25}, room, delay=(0,[1/4,1/2,3/4,5/4]r), echo=7/8, addc=wow
v kal 1, buffer=vb1, contrast=3, blend=max, zoom=2, scroll=1
vb1 buffer 0, feedback={zoom:1.01,ripple:1/32,contrast:0.005}
include 'preset/house.limut'
set bpm=127
b tb303 `0a2u2b0d 0u0a2d3 00u0a0d 0da4ua5a6u`, cutoff=[1/4:1]n3, resonance=0.8, accent=1  

More examples: https://github.com/sdclibbery/limut/blob/master/examples.txt

Glossary

Chord: multiple simultaneous events

Command: One programming instruction to tell limut what to do

Event: One event to be played; either an audio note/sample or a visual display

Expression: Code that evaluates to a value

Global Var: A variable; something whose value can be set by a command, and then read in an expression

Indicator: Visual display on the limut screen to help with composition or production

Map: Value containing multiple values indexed by keys

Modifier: Additional data thats changes the value of an expression, eg by modifying the current time it sees, or by providing a random seed

Param: A named parameter expression that controls the output produced by a synth

Pattern: A sequence defining the notes or control values to be played by a synth

Player: An player uses a synth to play events in a pattern, controlled by params

Subparam: An additional parameter provided extra info on how a param should control the output of a synth

Synth: An audio or visual synthesizer that can produce sound output or visual display.

Timevar: An expression whose value varies over time

Value: A primitive value to control synths

Indicators

Level VU meter for current output signal level. Use this when adjusting the output level, using either set main amp or the level slider, so it is just touching the red at its loudest. Only one active channel is shown if the mix is fully mono.

Beat Current audio system beat count, followed by beat counts out of 12, 16 and 32 beats (useful for synchronising changes to various size musical bars and progressions)

Audio Audio lag; green when the browser audio system is keeping up; turns red when the system is struggling, which may lead to audio glitching

Visual Visual lag; green when the framerate is keeping up to 60 fps; turns red when the system is struggling, which may lead to visual glitching

Limiter Audio limiter: turns red when the internal Limut limiter is active, implying the combined audio sources are too loud. Note this limiter is before the main amp control and vu meter, it makes sure the levels from individual synths do not go so loud as to distort. So if it is lighting up, lower the amp on individual synths, and if necessary, raise the main amp level to compensate.

Syntax Principles for Expressions

() Round brackets define chords in both patterns and expressions; that is, mutltiple events or values at the same time. Chord indexers and aggregators can be used to extract various values from chords.

[] Square brackets define sequences in both patterns and expressions; that is, multiple events or values one after another over time (sequences/timevars)

<> Angle brackets define higher level sequences in patterns; that is, a sequence where the next event is selected when the entire pattern repeats next.

{} Curly brackets in an expression supply extra information to a param (subparams), value (modifiers) or function call (arguments)

@ Defines the interval for an expression; that is, how often the expression should be evaluated within the event. Note, the interval applies directly to the nearest value. So for example, with this.foo@e the per-event @e interval will apply to the foo only. To force the overall this.foo lookup to be evaluated per event, you could use (this.foo)@e.

Basic Syntax

Limut is case insensitive; piano, Piano, and PIANO are all treated the same; [1:4]t4 is the same as [1:4]T4 etc.

Comments

Anything after // on a line is ignored

Commands

A command defines a player or preset, or sets player overrides, or sets global variables, or includes a limut source file. Commands may span multiple lines; a new command is started whenever the beginning of a command is recognised at the start of a new line. So any line that begins with set keyword for setting vars or overrides, or with the id type pattern syntax for defining a player, will begin a new command.

Example:

    include 'preset/synthwave.limut' // Command that includes a limut source file from a URL
    preset mysynth ping, amp=3       // Command that creates a preset synth based on the 'ping' synth, but overriding the amp value
    set bpm=130                      // Command that sets the global bpm (beats per minute) var to 130bpm.
    kick play x., amp=2,             // Start of a command that defines the player called 'kick', of type `play`, with an amp (volume) of 2
      drive=1/2                      // Continuation of the kick player definition, setting its drive param to 1/2
    set kick drive=0                 // New command defining an override for the kick player, setting its drive param to zero. Overrides like this take precedence over params set on the player itself.
  

Defining a player

Basic structure: id synth pattern, params

A player command begins when something matching id synth pattern begins a new line. The params may follow on subsequent lines.

id Identifier for the player, so it can be referred to from other players etc. Must contain only alphanumeric characters from the basic Latin alphabet or underscore, and must not start with a digit. No player can be named set or preset as those are reserved keywords.

synth Name of the audio or visual synth to use; eg piano

pattern Pattern of notes to play. Specifies the notes or sounds to play, and when to play them

params Comma separated list of params (eg amp=1/2) that affect how the player plays; see 'Value Syntax' and 'Params' sections below

Overriding player params:

Basic structure: set id params

A set overrides command begins when set begins a new line. The id and params may follow on subsequent lines.

id Player identifier; the override params will be apllied to this player. Can also be a list of multiple players to apply the params to; eg set (kd,sd) amp=0. Can include wildcards, so set p* ... will apply the overrides to every player whose name starts with 'p'. set * ... will apply to all players. set !p ... will apply to all players _except_ 'p'.

params Comma separated list of params (eg amp=1/2) that affect how the player plays; see 'Value Syntax' and 'Params' sections below

modification overrides params can be defined using operators to modify existing values rather than override them; eg add+=2 will increase the add parameter by an additional 2 on top of what it was already set to.

Setting global vars:

Basic structure: set var = value

A set global var command begins when set begins a new line. The var and value may follow on subsequent lines.

var variable to set; either a predefined var (see 'Predefined Vars' section below) or a user defined var which can be referenced from params on any player(s)

value expression value to set; see 'Value Syntax'

Creating a synth preset:

Basic structure: preset name synth, params

A preset global var command begins when preset begins a new line. The params may follow on subsequent lines.

name The name for the preset. The preset can be used by players by referring to this name as the player type. Must contain only alphanumeric characters from the basic Latin alphabet or underscore, and must not start with a digit.

synth The existing synth (or preset) to base this preset on

params Series of param overrides to apply for players that use this preset

Including a limut source file:

Basic structure: include 'url'

Include a limut source file. The file will be downloaded from the given URL and then executed as limut code. The file will only be downloaded once, but will be executed every time the code is updated.

url The URL of the limut source file to include. Must be in single quotes as a limut string. Include standard limut libraries from eg 'preset/synthwave.limut'. Include limut source from anywhere on the web (CORS permitting) using the full URL; eg 'https://sdclibbery.github.io/limut/preset/synthwave.limut'

Patterns

x-o- Sequence of events, each with duration given by the player's dur param, for use with play

0123 Sequence of events, each with duration given by the player's dur param, for use with tonal synths. Numbers are scale degrees

`01 23` Pattern literal; inside backticks, pattern elements can be separated by whitespace which will be ignored. Backticks force the contents to be treated as a literal, so for example `01 loop 1` is treated as the literal 01loop1 and the loop operator is ignored.

0-1-2-3 Negative scale degrees allow tones below the synth root pitch

x. Use a dot for a rest

0# # following numeric event makes it sharp

0b b following numeric event makes it flat

0= = following numeric event extends the duration by 50%

0! ! following numeric event shortens the duration by 33%

0^ ^ following numeric event makes it 50% louder

0v v following numeric event makes it 33% quieter

0a Other characters following numeric event become params; for example t tri 01g23, glide=this.g/2

x^ ^ following non-numeric event makes it 50% louder (for use with play synth)

0_[_1] Continuation: use underscore to extend the previous note duration. Currently continuations are not valid within chords () or supersequences <>

0[123] Subsequence: square brackets to fit multiple events into one dur (triplet shown)

0(135) Chord: Round brackets to play multiple events together

0<12> Supersequence: angle brackets to play events in sequence as the pattern repeats. Eg 0<12> is exactly equivalent to 0102

01 loop 2 Restrict the number of times the pattern can loop. In the example, the pattern 01 will play twice and then stop. The player will not reset until it gets recreated or changed. So if a player with a loop pattern has finished its repeats, it will not start playing again until it is commented out/in, or playback stopped and restarted, or the pattern string is changed and updated.

0123 crop 2 Crop a pattern to a given number of steps. For example, 0123 crop 2 is equivalent to 01. Crop will repeat the pattern if necessary, eg 01 crop 5 is equivalent to 01010

1 + 2 Concatenate two patterns; the first pattern plays then the second. For example, 12 + 34 is the same as 1234

1 * 2 Repeat a pattern; the first pattern plays a given number of times. For example, 12 * 2 is the same as 1212

now 01 Play the pattern starting on the next beat, rather than as if it had been playing from beat 0. In the example, the pattern 0123 will play starting from the 0 whatever beat the player is started on.

follow p1 Use follow to follow another player (named 'p1' in the example) pattern

Values

Basic structure value{modifiers}@interval

value Actual value (which may include subparameters); see below

{modifiers} Map of modifiers and/or arguments. Modifiers may modify the time passed to the value expression, or the value it returns, or provide additional data for a parameter. For example, [1,2,3]t1{0:0,per:8} will give a sequence that repeats every 8 beats, forced to the value 0 at the start of each repeat. In other words, the repeating sequence: 0,2,3,1,2,3,1,2. See "Modifiers" below.

@interval Intervals specify how often the value should be evaluated, for example once per event (then the same value through the event), or continuously varying. See "Intervals" below.

Values:

1 Single, constant numeric value

0dB Numeric values can be expressed in dB. These are immediately (at parse time) converted to gain numbers, so 0dB is a gain of 1, +20dB is a gain of 10 etc. Values can be specified in dB for any numeric values, however it may not make sense in all cases. amp=6dB is basically equivalent to amp=2; it doubles the output level of a player. But while scroll=6dB is still the same as scroll=2, it doesn't make much sense to write it way (especially since it is impossible to express negative numbers with dB: Eg -20dB is the same as 1/2. Note that because dB is a relative scale, it must be multiplied. Eg to add +3dB to an amp, multiplication must still be used: amp*=3db

1# 1b For use with the audio add param, sharpen or flatten the value. This is parsed into {1,#:1} or {1,b:1}

No value: for a param, missing a value is the same as setting the param to 1. Eg monochrome is the same as monochrome=1

(1,2) A 'chord' or chord. Multiple values, all played together

[1,2] Sequence of values, one per event in the pattern, ignoring rests. For single length patterns only, all values will be expanded, so p ping 0, add=[0,1,2] will cycle through all three values.

[1,2]t3 Timed sequence, each value lasts for 3 beats

[1,2]t[12,4] Timed sequence with one timing per value. At present the timings must be const numbers, they cannot be expressions.

[0:3]t1 Timed sequence, expanded. The example is equivalent to [0,1,2,3]t1

[1,2]l3 Timed linear interpolated sequence, each value takes 3 beats to change into the next

[1,2]l[14,2] Timed linear interpolated sequence, one timing per value. At present the timings must be const numbers, they cannot be expressions.

[1,2]s3 Timed smooth interpolated sequence, each value takes 3 beats to change into the next, using an 's' shaped ease in/out curve

[1,2]s[14,2] Timed smooth interpolated sequence, one timing per value. At present the timings must be const numbers, they cannot be expressions.

[1,2]e Timed smooth interpolated sequence, each value is evenly spaced from beginning to end of the current event

[1,2]e1 Timed smooth interpolated sequence starting at the beginning of the event, each value takes 1 beat to change to the next

[1,2,3]e[1,2] Timed smooth interpolated sequence starting at the beginning of the event, one timing per value. The timing for the last value is ignored and is effectively infinite. At present the timings must be const numbers, they cannot be expressions.

[]r Select a different value every time, chosen randomly between 0 and 1

[1,4,7]r Select a different value every time, chosen randomly from the numbers 1, 4 and 7

[:9]r Select a different random float every time, between 0 and 9

[0:9]r Select a different random float every time, between 0 and 9. Note if this will be rounded to to an integer (eg for oct, add or sample params), then the upper limit is exclusive. eg oct=[2:3]r will give a float value between 2 and 2.9999...., so since oct rounds down to the nearest integer, it will always get oct=2

[0,1:7]r Select a different random float every time, either 0 or 1. The 1 is 7 times more likely than the 0.

[1,2]r4 Select a different value and hold for 4 beats, chosen randomly from the numbers 1, 2. The hold time must be a const number, it cannot be an expression.

[1:3]r{seed:1,per:4} Select a different determninistic random float every time, between 1 and 3; seed determines the random sequence; the sequence repeats every per beats. seed is also in beats, so adding 1 to seed pushes the sequence by 1 beat.

[]n Smoothly varying noise, moving between 0 and 1

[1:2]n Smoothly varying noise, moving between 1 and 2

[1:2]n4 Smoothly varying noise, moving between 1 and 2, taking 4 beats to progress from one value to another. The timing must be a const number, it cannot be an expression.

[]n{seed:1,per:4} Smoothly varying deterministic noise, moving between 0 and 1; seed and per work the same as for []r

[ v1:i1t1, v2:i2t2, ... ]{p} Piecewise series. Allows interpolating between a set of values, specifying the interpolation and 'travel' between each pair of values, and allowing a custom parameter to control the interpolation. For example, [0:_1,1:\]{time*2} is controlled by double-speed time, starts at 0, stays constant at zero for 1 unit of double-speed time, then jumps to 1 and linearly falls back down to 0 for 1 unit of double-speed time.

v1 etc Expressions giving the values to interpolate between

i1 etc Interpolation operator

t1 etc The amount of parameter p travel between this value and the next; note the sequence wraps round

p Parameter expression giving the current point of travel through the piecewise series

+ Add values together; eg [2,3]+4 is equivalent to [6,7]

- Subtract values; eg [2,3]-1 is equivalent to [1,2]

- Unary minus operator; eg -[1,2] is equivalent to [-1,-2]

/ Divide values; eg 1/2

* Multiply values; eg lpf=[1,2,3]*1000

% Take remainder; eg (0,4,7,9)%7 is equivalent to (0,4,0,2)

^ Raise to the power; eg 2^3 is 8. Imaginary results return 0; eg -1^1/2 returns 0.

| Concatenate chords; eg 1|2 is the same as (1,2), and (1,2)|(3,4) is (1,2,3,4)

? Get a default if a value is missing. Eg this.foo?5 will give the value of this.foo if present, or 5 if not.

. Lookup values in a player (with a param name), a chord (with an index or aggregator) or a map (with a field name). See Lookup Examples section below.

{x:0,y:1} Map, containing keys and values

{2,y:1} Map, containing keys and values, with a 'default' value of 2. The default value is used for some parameters; eg chop={2,wave:triangle} is the same as chop=2, but also supplies an additional 'wave' subparameter.

{r:1,g:0,b:0,a:1} RGBA colour; component range is 0 - 1.

{h:1,s:1,v:1,a:1} HSV + alpha colour; component range is 0 - 1, including hue. Note RGB components can also be specified as overrides; eg {h:1,b:1,a:1} will be magenta not red.

{labh:1,c:1,l:1,a:1} LabLCH + alpha colour; component range is 0 - 1, including hue. Note RGB components can also be specified as overrides; eg {labh:1,b:1,a:1} will be magenta not red.

#0369 Hex colour value which becomes the colour map {r:0,g:0.2,b:0.4,a:0.6}

#036 Hex colour value which becomes the colour map {r:0,g:0.2,b:0.4,a:1}

#00336699 Hex colour value which becomes the colour map {r:0,g:0.2,b:0.4,a:0.6}

#003366 Hex colour value which becomes the colour map {r:0,g:0.2,b:0.4,a:1}

'abc' String value. Strings must be defined on a single line; multiline strings are not supported. However, line breaks can be inserted with \n

foo Lookup a global var named foo. If there is no var, predefined var, or var function named foo, then the string 'foo' will be returned instead. If there is a var named foo, but no arguments are provided, then the string 'foo' will be returned instead.

foo{x:2} Lookup a global var named foo, and call it as a function passing in named parameters.

Modifiers:

{per:8} Repeat a sequence [1,2,3]t1{per:8} will give a sequence that repeats every 8 beats.

{per:8,0:7,2:3} Force the value to evaluate to 7 at the start of each repeat, and 3 on the second beat of every repeat. Note this only works if per is used to make a repeating sequence.

{step:2} Advance time in discrete steps only [1,4]l4{per:1/2}@f will give a sequence that changes value only every 1/2 beat.

Intervals:

@e Use @e to evaluate this value once per event

@f Use @f to evaluate once per frame (60 times a second). For example lpf=[300:3000]l8@f will update the lpf cutoff frequency continuously, while lpf=[300:3000]l8 will be evaluated only once for each event played.

Lookup examples

p1.amp Lookup the value of param amp from player p1. Returns a chord of values from all currently playing events.

p1.amp.0 Lookup the value of param amp from player p1, and if it contains a chord, extract the first element only from it.

p1.pulse.max Lookup the value of the pulse from player p1, and if it contains a chord, extract the largest element only from it. The pulse param gives a smoothed approximate envelope shaped value between 0 and 1 for each event.

this.value Get param value from the current event. Returns a single value (not generally a chord) from the event the expression is being evaluated on.

([0,1]t1@f).accum Smoothly accumulate 1 every other beat

{foo:2}.foo Returns a field in a map (returns 2 in this example)

(3,1,2).0 Returns the nth element in a chord (returns 3 in the example)

(3,1,2).3 Returns the nth element in a chord, wrapping around (returns 3 in the example)

(3,1,2).(0,2) Returns multiple elements in a chord (returns (3,2) in the example)

(3,1,2).first Returns the first element in a chord (returns 3 in the example)

(3,1,2).last Returns the last element in a chord (returns 2 in the example)

(3,1,2).rand Returns a random element from a chord (returns 1, 2 or 3 at random in this example)

(3,1,2).min Returns the smallest element in a chord (returns 1 in the example)

(3,1,2).max Returns the largest element in a chord (returns 3 in the example)

(3,1,2).count Returns the number of elements in a chord (returns 3 in the example)

(3,1,2).sum Returns the sum of all elements in a chord (returns 6 in the example)

(3,1,2).avg Returns the mean average of all elements in a chord (returns 2 in the example)

Audio Synths

! / stop / none

play Play samples. Use letters, symbols and digits 1-4 in the pattern to choose the sample (see below for full list). Note duration defaults to 1/2.

perc Play sampled percussion. Similar to the play synth, and uses the same pattern values and samples, but defaults to 1/4 beat duration, and each player has a choke group.

pitchedperc Synthesised pitched percussion for kick drums, snare, toms etc. Note that as this synth is not sample based, it only accepts digits in the player pattern, unlike the play synth. The sound is made up of click, hit, body and rattle components. The synth has a number of unique params:

click={1} The click is the initial impact sound. The main param is the loudness of the click. The default values are shown.

hit={0,sample:'^',index:1,rate:3/2} The hit is a sample to be played with the initial impact sound. The main param is the loudness of the hit. Sample, index and rate control the sample playback (similar to the play synth). The default values are shown.

body={1,units:'ms',att:5,dec:400,freq:55,boost:150,pitchatt:0,pitchdec:50,wave:'sine',saturation:0} The body is the resonant, pitched body of the sound. The main param is the loudness of the body. units is the time units for the various envelope attack and decay values. att is the attack time. dec is the decay time. freq is the base frequency in Hz, boost is the initial frequency boost in Hz. pitchatt is the attack time for the pitch sweep. pitchdec is the decay time for the pitch sweep. wave is the waveform to use. saturation is the gain for a tanh saturator applied to the body oscillator. The default values are shown.

body2={0,units:'ms',att:5,dec:400,freq:55,boost:150,pitchatt:0,pitchdec:50,wave:'sine',saturation:0} Second body tone. May be useful for snares and toms etc.

rattle={1,units:'ms',att:0,dec:30,rate:1,filter:'lowpass',freq:55,boost:205,pitchatt:0,pitchdec:50,q:18} The rattle is a noisy component of the sound. The main param is the loudness of the rattle. units is the time units for the various envelope attack and decay values. att is the attack time. dec is the decay time. Rate is the sample playback rate of the noise sample; adjusting this can provide some additional filtering. freq is the base filter frequency in Hz, boost is the initial filter frequency boost in Hz, pitchatt is the attack time for the filter sweep. pitchdec is the decay time for the filter sweep. Q sets the filter resonance. The default values are shown.

bd Preset based on pitchedperc. Provides a basic synthesized kick drum. Note that as this synth is not sample based, it only accepts digits in the player pattern, unlike the play synth. Use sus or dec params to control the duration of the kick. Uses some unique params:

accent=0 Positive values accent the kick making it louder and stronger. Negative values diminish the kick. Default value is derived from the player pattern value and 'add' param.

tone=0 Tone control for the kick. Larger values will open the filters.

tune=55 Base frequency for the kick in Hz. Usually this should be between about 45 and 65 Hz. The pitch{} function can be used to calculate specific frequencies for tuning the kick to the current key; for example tune=pitch{0,oct:2}

io808 TR-808 simulation based on IO-808. Eg p io808 0.9, type='bd' plays a pattern with two bass drum hits, one unaccented then one with maximum accent. Event duration is 1/4 beat (16th note) to correspond to 808 sequencer.

type='bd' type of 808 sound: 'bd', 'sd', 'oh', 'ch', 'cb', 'cp', 'ma', 'ht', 'mt', 'lt', 'hc', 'mc', 'lc', 'cl', 'rs', 'cy'. The value from the pattern determines the level of accent placed on each event.

level=1 Output level. Used on all types.

tone=1/2 Tone control; used on bd, sd, and cy.

decay=1/2 Decay time; used on bd, cy, and oh.

snappy=1/2 Snappy control for sd.

tuning=1/2 Tuning control for toms and congas ht, mt, lt, hc, mc, and lc.

impulse Play an atonal impulse; that is a single pulse of millisecond duration.

sample Pitched sample player. Use the 'sample' param, and then use it as a piched synth. Use the start param to specify the playback start time within the original sample in seconds. Note: if the rate param is set, then this sets the sample playback rate and overrides the value and add params, which are ignored.

saw Sawtooth wave preset

sine Sine wave preset

square Square wave preset

tri Triangle wave preset

pulse Pulse wave preset

wave Synthesizer using a waveform specified by the wave param. Possible values saw, square, sine, triangle, pulse

dwave Synthesizer preset using multiple detuned waveforms specified by the wave param. Possible values saw, square, sine, triangle, pulse

dsaw Detuned saw preset - multiple sawtooth waves slightly out of tune for a fuller sound

dsquare Detuned square preset - multiple square waves slightly out of tune for a fuller sound

dsine Detuned sine pad preset - multiple sine waves slightly out of tune for a fuller sound

dtri Detuned tri preset - multiple triangle waves slightly out of tune for a fuller sound

dbass Detuned saw bass preset - multiple sawtooth waves slightly out of tune for a fuller sound

fmbass Funky FM bass preset

ping Sine wave ping preset

swell Swell pad - triangle wave

fm FM base synth; allows configuration of FM operators and envelopes. Each of up to 6 operators is specified using params op1 to op6:

op1={ratio:5.19,target:3,wave:'saw',depth:0.8,att:0.01,rel:0.1} ratio: frequency ratio for this operator relative to base event frequency. target: the number of the operator that this one should modulate (eg `1` to target `op1`); use 'out' to send this operator output to the synth output. wave: the waveform to use for this operator. Depth: the amount of modulation this operator should apply to the target (note this will be scaled by the note frequency). att/rel simple envelope attack and release for this operator.

bell FM generated bell preset

glock FM generated glockenspiel preset

glass FM glass synth with a chiming sound preset

xylo FM xylophone preset

piano Sampled piano

ambi Ambient drone preset; multiple sines with varying detunes

ethereal FM Ethereal pad preset

noise Noise pad. Note pattern value is not used; white noise is produced for all values (uses AudioWorklet so may use more audio render capacity than other synth types).

prophet Prophet style preset: pulse wave with lfo controlled pulse-width (uses AudioWorklet so may use more audio render capacity than other synth types)

pwm Pulse width modulation synth. A pulse wave with variable pulse width, from pulse to square. Note: uses AudioWorklet so may use more audio render capacity than other synth types. Also note there may be aliasing, so you may want to apply some filtering to cut harsh high frequencies.

pwm=1/2 Set the pulse width from 0 to 1. The default is 1/2, a square wave (50% duty cycle). values very close to 0 and 1 will produce no sound since the actual pulse width will become vanishingly small.

supersaw supersaw lead synth preset; 7 detuned saws

external take audio from microphone or line in. Use the track param to specify the track within the stream. If the input signal appears on only one stereo channel (or you only want the signal from one stereo channel), use the channel param to select the channel and force it to mono.

track=1 Select which audio track to use from the input.

channel=1 Select a single audio channel to use from the input.

multiwave Synthesizer providing multiple waveform oscillators which can have their amp and detune controlled individually and dynamically. The waves are specified using params wave1, wave2 etc:

wave1={'saw',amp:[0:1]n,detune:wow} The main value is a string giving the waveform to use. amp is a per frame amplitude control. detune is a per frame detune control in semitones.

crackle Crackly crackle sounds.

noisefloor Provide a slowly varying noise floor.

bus Audio mix bus. Plays continuously, can take a pattern but the pattern is ignored. As a result, all bus param values are evaluated per frame. Chords and []e are not valid for bus players. Audio players can use the bus param to choose which bus to mix into (by id). A bus player does not have pitch effects (addc, vib etc), but does have wave effects (compress, drive, fold etc). There is an implicit bus called main that exists at all times, and provides the final mix for all other players and buses. Overrides can be used to set params on the main bus; eg set main echo=1/2

Visual Synths

! / stop / none

blank Blank: sets every pixel to the back colour.

clouds Moving clouds

kal Changing kaleidoscope pattern

swirl Psychedelic swirl

julia Julia set fractal

lines Twisting lines

blob Morphing 3D blob

streetlight Looking up at the passing streetlights on a night drive

grid Square grid

glow Additive glow for lights, sparks etc

stars Exploding stars for fireworks etc

bits Bitwise operations giving fractal patterns

xor Bitwise xor with mod, giving changing pixellated patterns

gradient Simple gradient in the y direction

shadertoy Display a shadertoy synth. Use the id param to specify which shader. Only shaders published with the 'public+api' option are available, others will give error 'Shader not found'. At present, shaders that use textures or multiple channels will also not work.

image Display an online image. Use the url param to specify the image url. The image must be served using CORS. by default the image back is transparent.

webcam Display video feed from the attached webcam (if present). The browser will ask permission before allowing access to the webcam.

text Draw and display text. Use the text param; eg text='Hello'. Use \n to split to multiple lines: text='Hello\nWorld'. Use subparams to control the text rendering, eg: text={'Hello',font:'times',size:'144',linesize:0.7,y:1/4,x:2/3,style:'bold italic'}. Text is evaluated only per event, not per frame.

buffer Maintain a render target, which other synths can render into. The render target is then drawn to the screen by this synth. Use the buffer param on another synth to direct its output to a buffer synth. Use the rez param on the buffer synth to set the render target texture resolution scale. Use the feedback param to provide video feedback by rendering this buffer on top of itself every frame. The subparams will modify the feedback render.

scope Display the current audio waveform

scopefft Display the frequency spectrum of the current audio waveform

readout Display the current value as a digital display

Common Event Params

dur Event time in beats. Timevars, random vars and index vars can be used to give variation in duration. Chords cannot be used with the dur param.

delay Event start time offset in beats

delay={1/2,add:2} subparams on delay will be used to override the event values. In the example given, the add param of the delayed event will be set to 2, but any params can be overridden this way. This is most useful with chords of delay values, as it allows individual delayed events to change their properties.

stutter Split each event into multiple events spaced evenly within the same time period. Eg with stutter=2, an event starting at time 0 with a duration of 1 will be split into two events of duration 1/2, starting at 0 and 1/2. Stutter of 0 or 1 has no effect and is the default. Stutter is rounded down to the nearest integer value.

swing Amount to swing alternating 1/4 beats, as a Linn LM-1 style percentage from 50 (no swing) to 66 (perfect triplet swing) to 75 (maximum dotted note swing). You can set swing for all players at once using (eg) set * swing=60

swing={66,period:1/2} The period to apply the swing. Defaults to 1/4 of a beat (suitable for house music).

amp Player amplitude control

sus Sustain time in beats. Note the 'sustain' in an ADSR envelope sets the sustain level, however this param sets the sustain time. The default is time required after attack and decay to take the note to the end of the duration.

rate Playback rate for 'play' samples, animation rate for visuals

voice READ ONLY param. This param is set to the voice index of an individual event within a chord. So for example: p ping 0, add=(0,2). Here, there are two events within the chord, with add values of 0 and 2. The voice values for these events will be 0 and 1, since the voice increments. This can be used to change other values based on the voice index within the chord.

time READ ONLY param. The current time in beats this event has been playing for.

idx READ ONLY param. The pattern index of this event. The pattern index counts through the pattern, then resets when the pattern repeats.

exists READ ONLY param. One if the player is defined, even if its not currently playing any event.

playing READ ONLY param. One if the player exists and is currently playing one or more events.

player READ ONLY param. The name of the player currently playing. For a follow player, will be the name of the follow player (not the player it's following).

Audio Params

add Amount to add onto event scale degree, in degrees. Evaluated per event only.

add={0,#:1} Sharpen the scale degree (add a given number of semitones)

add={0,b:1} Flatten the scale degree (subtract a given number of semitones)

addc Amount to add onto event pitch, in semitones. Evaluated per frame, and accepts fractional values, so addc=[0:12]e will slide the note from the starting pitch smoothly up a whole octave over the course of the note.

oct Octave; middle C is in octave 4

envelope Specify the envelope type to use: 'full' (ADSR), 'simple' (ADR), 'organ' (ASR full volume while on like an organ), 'pad' (uses a cosine roll on/off so consecutive notes maintain constant volume), 'linpad' (uses a linear roll on/off, a better crossfade when the source is identical (including phase) between events), 'percussion' (R - instant attack)

att Attack time in beats

dec Decay time in beats

sus Sustain time in beats. Note the 'sustain' in an ADSR envelope sets the sustain level, however this param sets the sustain time. The default is time required after attack and decay to take the note to the end of the duration.

sus={level:1/6} Set the amplitude level for sustain. Note the 'sustain' in an ADSR envelope is the level, so it is this value not the main 'sus' value (which is actually the sustain time). Default: 0.8.

rel Release time in beats

wave For audio synths that use a waveform, specify which waveform to use, from this list: sine, square, sawtooth (can also use saw for convenience), triangle (can also use tri for convenience), pulse, ah, bah, bass, 'bass-amp360', 'bass-fuzz', 'bass-fuzz-2', 'bass-sub-dub', 'bass-sub-dub-2', brass, 'brit-blues', 'brit-blues-driven', buzzy, 'buzzy-2', celeste, 'chorus-strings', 'dissonant-1', 'dissonant-2', 'dissonant-piano', 'dropped-saw', 'dropped-square', 'dyna-ep-bright', 'dyna-ep-med', ee, ethnic, full, 'full-2', 'guitar-fuzz', harsh, 'mkl-hard', noise, o, ooh, organ, 'organ-2', piano, 'pop-ahhh', pulse, 'putney-wavering', tb303, throaty, trombone, 'twelve-optines', 'twelve-string-guitar', 'warm-saw', 'warm-square', 'warm-triangle', wurlitzer, 'wurlitzer-2' Note that values with hyphens must be enclosed in quotes. In addition, there may be a performance problem with using dynamic (per frame) pitch sweeps using these waveforms. This penalty does not apply to the basic waveforms (sine, sawtooth, triangle, square).

detune Amount of detune in semitones

lpf Low pass filter frequency in Hertz

lpf={400,q:20} Low pass filter resonance. 10 is approximately the transition where resonance starts to kick in. Default: 5.

lpf={400,poles:4} Filter poles. Default is a 2 pole filter giving 12 dB/octave. Alternatively, specify 4 for a Moog-like 4 pole filter giving 24 dB/octave.

hpf High pass filter frequency in Hertz

hpf={400,q:20} High pass filter resonance. Default: 5.

hpf={400,poles:4} Filter poles. Default is a 2 pole filter giving 12 dB/octave. Alternatively, specify 4 for a Moog-like 4 pole filter giving 24 dB/octave.

bpf Band pass filter frequency in Hertz.

bpf={400,q:20} Band pass filter resonance. Default: 1.

bpf={400,poles:4} Filter poles. Default is a 2 pole filter giving 12 dB/octave. Alternatively, specify 4 for a Moog-like 4 pole filter giving 24 dB/octave.

bpf1 Multiple, parallel bandpass filters are available using params bpf1, bpf2 etc.

nf Notch filter frequency in Hertz

nf={400,q:20} Notch filter resonance. Default: 1.

apf1 All pass filter frequency in Hertz. Multiple allpass filters can be specified with params apf1, apf2 etc. They will operate in parallel so their outputs sum, allowing phase cancellation.

apf={400,q:2} Allpass filter resonance. Default: 1.

psf Phaser stage filter consisting of two allpass filters in parallel. Multiple phaserstage filters can be specified with params psf1, psf2 etc. The phaserstages will operate in series, allowing more complex phasers to be built up with multiple peaks and troughs in the frequency spectrum.

psf={f1:300,f2:2300,q:0.7} f1 and f2 are the frequencies in Hertz of the two allpass filters. Sweep these dynamically for the swirling phaser effect. q is filter resonance. Default: 1.

low Low shelf gain. Eg low=-6dB will act like a gain of 1/2 for the low frequencies. Must specify the value with the dB unit, or use a relative gain value instead.

low={-8db,freq:400} Low shelf cutoff frequency in Hz. Default: 200Hz

mid Mid gain. Eg mid=-6dB will act like a gain of 1/2 for the mid frequencies. Must specify the value with the dB unit, or use a relative gain value instead.

mid={-8db,freq:400} Mid cutoff frequency in Hz. Default: 600Hz

mid={-8db,q:10} Mid q defines the width of the mid frequency band; low q is wide. Default: 5

high High shelf gain. Eg high=-6dB will act like a gain of 1/2 for the high frequencies. Must specify the value with the dB unit, or use a relative gain value instead.

high={-8db,freq:400} High shelf cutoff frequency in Hz. Default: 1100Hz

chop Chop the signal into a number of parts per beat, eg chop=2 chops the signal twice per beat.

chop={2,wave:triangle} chops twice per beat with a triangle waveform. The default waveform is sine; the options are sine, square, triangle, saw.

chop={4,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

ring Apply ring modulation at the given frequency in Hertz, eg ring=32 apply ring modulation at 32Hz.

ring={32,wave:saw} 32Hz ring modulation with a sawtooth waveform. The default waveform is triangle; the options are sine, square, triangle, saw.

ring={32,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

sample With 'play' synth: number: choose which sample set to use. With 'sample' synth: string: url of online audio file to play (note: server must support cross origin requests for the file)

sample={32,pitch:261.6} Specify the original pitch of the sample in Hz (eg default is 261.6 Hz for C4)

start For the 'sample' synth, specify the playback start time in seconds within the sample.

compress Compression ratio, or the reduction in volume for signals above the compression threshold. A ratio of zero disables compression.

compress={12,gain:2} Input gain; gain amp to apply to the signal before compression is applied

compress={12,threshold:-40dB} Threshold at which the compression ratio kicks in. Default is -50dB

compress={12,knee:10dB} the 'knee' is a softening of the compression curve, so that there is no sudden changeover at the threshold. A value of 0dB disables the knee and gives a sudden changeover. Other values are the range over which the knee should apply. Default is 40dB.

compress={12,att:0.1} Compressor attack time in seconds. The attack time is the time it takes for compression to 'kick in' once a signal crosses the threshold. Default is 0.01 (or 10ms).

compress={12,rel:0.2} Compressor release time in seconds. The release time is the time it takes for compression to 'go away' once a signal falls back below the threshold. Default is 0.25.

noisify noisify: distort the signal into noise

noisify={12,gain:2} Input gain; gain amp to apply to the signal before noisify is applied

noisify={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

fold distort the signal by boosting then folding the overdriven part of the waveform

fold={12,gain:2} Input gain; gain amp to apply to the signal before fold is applied

fold={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

clip boost the signal then apply hard clipping

clip={12,gain:2} Input gain; gain amp to apply to the signal before clip is applied

clip={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

drive overdrive by boosting the signal then applying soft clipping. Low values (eg 1/32, 1/16) give a gentle overdrive. Mid values (eg 1/8, 1/4) give a distortion effect. Higher values (eg 1/2, 1) give a full on fuzz.

drive={12,gain:2} Input gain; gain amp to apply to the signal before drive is applied

drive={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

bits bit crush effect; value is number of bits. 1 bit is very distorted to (eg) 32 bits is relatively clean. 0 disables the effect.

bits={12,gain:2} Input gain; gain amp to apply to the signal before bits is applied

bits={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

suck suck smaller amplitudes even smaller, but leave large amplitudes alone; value is a limit amplitude: when the waveform is within this limit, it is scaled down. This can provide an unusual form of distortion, or for samples with a long tail, can give a 'gated' effect.

suck={12,gain:2} Input gain; gain amp to apply to the signal before suck is applied

suck={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

scale override scale for this player; set to one of these strings: chromatic, major, majorpentatonic, pentatonic, penta, minor, aeolian, minorpentatonic, minorpenta, mixolydian, melodicminor, melodicmajor, harmonicminor, harmonicmajor, dorian, dorian2, diminished, egyptian, yu, zhi, phrygian, prometheus, indian, locrian, locrianmajor, lydian, lydianminor, hungarianminor, romanianminor, chinese, wholetone, halfwhole, wholehalf, bebopmaj, bebopdorian, bebopdom, bebopmelmin, blues, minmaj, susb9, lydianaug, lydiandom, melmin5th, halfdim, altered,

vib vibrato frequency in cycles per beat

vib={2,depth:1} vibrato depth in semitones (default 0.4)

vib={2,delay:1} delay before vibrato starts in beats (default 1/2)

glide Glide from one note to the next (portamento). When a note plays with glide set, if there is a previous note playing on the same player in the same voice, then both notes will glide in pitch from the old note's pitch to the new. The value is in beats, so glide=1/3 means it takes 1/3 of a beat to glide from the old note to the new. Default value is 0 (no glide).

glide={1/3,curve:4} glide curve. Zero means no curve, or a linear frequency change. Positive curve means the frequency moves quickly to the target, then slows down as it approaches. Default is 1.

pan pan from -1 (left) to 1 (right). default: 0

mono Force a signal to mono: the input signal appears equally in both left and right channels

choke Set a choke group. Notes played with a choke group will cut off other notes that are already playing if they have the same choke group. The choke group can be a string, and can apply across multiple players.

echo Echo time delay in beats

echo={1,feedback:0.8} Echo feedback gain, 0 to 1, default 0.35. Higher value means the echo persists for longer.

echo={1,max:2} Echo max time delay. Only valid for bus echo. The bus echo time can be varied, but cannot be larger than this. Defaults to either 1 beat, or the initial value of the delay time, whichever is larger.

chorus Strength of lfo-delay based stereo chorus effect.

chorus={1,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

phaser LFO frequency for phaser effect, in phase sweep cycles per beat.

phaser={1/3,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

flanger LFO frequency for flanger effect, in cycles per beat.

flanger={1/3,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1

room freeverb room size.

room={2,hpf:300} HPF subparam Sets the cutoff frequency in Hz for a high pass filter placed before the freeverb. 0 disables the highpass filter altogether. default: 0

room={2,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1/2

reverb Convolution reverb duration. The value is a time in beats that the reverb tail will last for.

reverb={2,curve:3} Decay curve power of the reverb tail. 1 is a linear decay, larger values make the tail decay faster. default: 5

reverb={2,hpf:300} HPF subparam Sets the cutoff frequency in Hz for a high pass filter placed before the reverb. 0 disables the highpass filter altogether. default: 0

reverb={2,mix:1/4} Mix subparam controls dry/wet mix. 0 for dry only, 1 for wet only. default: 1/2

freq READ ONLY param. This param is set by all tonal synths, to the frequency in Hz of the note being played. This value can then be read for other purposes; eg lpf=this.freq*2 will set the low pass cutoff frequency to double the note frequency.

bus id of the bus that this player should mix to. If the sepcified player does not exist, this player will be silent. If the bus param is not specified, this player will be mixed to the global main bus.

Visual Params

add Amount to add onto pattern value

zorder order in which to draw visual synths; defaults to the 1/1000th of the source code line number for the player, so that visuals draw strictly in the order they appear in the source code; however, this param can be used to override this and force specific visuals to the front or rear of the draw order.

fade brightness/transparent fadeout

time time value to use in the shader. If this is set, the rate and sway params have no effect

rate the rate that time should progress in the shader. If the time param is set, this has no effect

pulse extent to which the audio signal affects the value passed to visual synths

sway extent to which the audio signal affects the time passed to visual synths

loc position and size. The visual coordinate system runs from (-1,-1) in the bottom left of the screen to (1,1) in the top right. x and y define the centre of the visual, and w and h are the full width and height; eg {x:0,y:0,w:2,h:2} covers the full screen.

window display the only part of the shader image appropriate to the location of the tile on the screen. This way, a tile moved around the screen will act like a window onto the overall shader image.

scroll scroll the shader; default: {x:0,y:0}

repeat repeat a section of the shader image in both directions. Value is the size of the area to be repeated.

repeat={1/2,x:0.1,y:-0.05} x/y offsets to apply to the area of the shader image being repeated.

zoom zoom the shader; default: {x:1,y:1}

rotate rotate the shader; angle in full rotations so 1/2 is 180 degrees; default: 0

mirror mirror the shader; number of mirror planes to apply; default: 0

mirror={10,rotate:1/4} Rotation offset (0-1) to apply to the mirror planes. Defaults to 0.

mirror={10,fan:1} fan out angle to apply to mirror segments, so each segment is taken from an incrementing portion of the original image. A fan of 1 moves each next segment by the size of one segment. Defaults to 0.

fore foreground colour; eg {r:0,g:1,b:0,a:1} for green or #fa0f for orange.

mid middleground colour; eg {r:0,g:1,b:0,a:1} for green or #fa0f for orange. If not specified, defaults to midway between fore and back.

back background colour; eg {r:0,g:1,b:0,a:1} for green or #00ff for orange.

pixellate number of pixels to pixellate to in x direction, or 0 to disable pixellation

pixellate={10,y:20} number of pixels to pixellate to in y direction, or same as x if not present.

perspective perspective warp to apply to shader (negative to invert), or 0 to disable

perspective={-1,shade:1/2} amount of darkening shade to apply to the part of the image 'in the distance'.

tunnel tunnel warp to apply to shader, or 0 to disable. Applies a slitscan type warp, where scrolling in the x direction will scroll the original shader through the tunnel.

ripple Apply a ripple warp to the shader, to give the effect of waves of image distortion rippling out from the centre of the shader.

ripple={1,scale:1/4} scale (size) of ripples. Defaults to 1.

additive add this shaders output to those beneath instead of blending

blend set the blend mode which defines how this shaders output interacts with the color already present underneath. Possible values: additive subtractive average multiply invert min max

monochrome make the shader output monochrome; 0 for normal, 1 for monochrome

vignette fade out the visual around the edges. The value controls the shape.

vignette={1/2,aspect:4/3} aspect ratio of vignette effect. Defaults to 1.

vignette={1,cutoff:0.95} cutoff for vignette; lower values provide a more gradual fade around the edges. Defaults to 0.9.

vhs Apply a VHS tape effect, including colour modification, horizontal bars, wobble, and noise.

recol recolour the shader. Set to oil for oil film colours, hue for a hue spectrum, fire for a flame effect, sunset for dusk colours, neon for neon megenta and cyan, titanium for titanium anodisation colours

contrast apply a power based contrast curve. Default is zero meaning no contrast curve applied.

buffer send the output of this synth to a buffer player. For example, buffer=vb makes this synth render to the synth with id vb, which must be a synth of type buffer. The buffer synth can then render itself to the screen to display the output.

rez only for a buffer synth: sets the render target resolution scaling. For example, a rez of 1 will make a render target texture that is identical width and height to the display screen canvas. Default value is 1/2.

feedback only for a buffer synth: use video feedback by rednering the buffer onto itself every frame. The subparams control that rendering. Any visual params can be used as feedback subparams. For example feedback={zoom:1.01} will render the feedback slightly zoomed, giving a classic video feedback effect.

Main Vars

Main vars can be set, but not read.

bpm Beats per minute. Value resets unless set every time the code is updated.

beat.readouts Set the beat counts to use for the readouts; eg beat.readouts=(3,12) will show two beat counters, one that counts in 3's (for a waltz), and another that counts to 12 (for 4 bars of a waltz). There cannot be more than 3 readouts. The default is (12,16,32)

scale Scale eg minor, major, chromatic, majorpentatonic, lydian etc etc. Value resets unless set every time the code is updated.

root Main root pitch offset; default 0 roots the pitches on middle c; 1 pitches up by one semitone etc. This is fractional, so can be used to 'nudge' the tuning to match other instruments; eg root=0.135

Predefined Vars

Predefined vars are predefined values that may be useful as shortcuts when live coding.

time Time, counted in beats (including fractions of a beat)

drop6_2 Predefined time var: equivalent to [1,0]t[6.2]. These are all the predefined drops: drop6_2, drop7_1, drop12_4, drop14_2, drop15_1, drop24_8, drop28_4, drop30_2, drop31_1, drop56_8, drop60_4, drop62_2, drop63_1

tile_full For loc visual param. Predefined loc param map to cover the full screen: equivalent to {x:0,y:0,w:1,h:1}. Other predefined locations: tile_tl/tr/bl/br/m, tile_h1/2/3/4/5, tile_v1/2/3/4/5

fullscreen For loc visual param. Tile covering the full screen

tile_random For loc visual param. Tile in a random location

tile_rand For loc visual param. Tile in a random location

sparkle For loc visual param. Small tile in a random location

droplet For loc visual param. Small tile in a random location, then falling down the screen

spark For loc visual param. Small tile flying outwards

gravity For loc visual param. Accelrating motion downwards. Best combined with other values; eg spark+gravity

firefly For loc visual param. Random motion like a flying insect

transparent For colour visual params. Predefined colour. Others: black, darkgray, gray, lightgray, white, red, orange, yellow, green, blue, indigo, violet, neonpink, neongreen

random For colour visual params. Random colour

rainbow For colour visual params. Colour changing through the rainbow

wow Predefined time var: Randomly but smoothly varying signal, good for simulating analog 'wow' pitch distortion; eg addc=wow

Controls

slider{} Create a new slider control on the page, which can be used for live control of live coded expressions. The value dynamically updates to reflect the current position of the slider control.

slider{0.1} Initial value for the slider control when it is first created. Default is 0.

slider{name:'Foo'} Name to display with the slider. The name uniquely identifies the slider. Multiple slider usages in the source code with the same name will be treated as all referencing the same slider. Default is a name constructed from the player and param names.

slider{min:-5, max:5} Minimum and maximum values when the slider is at the ends of its travel. Defaults are min:0 max:1.

slider{curve:2} Curve to apply to the values. Positive values give greater change in value towards the lower end of travel. Default is 0.

Functions

pitch{1} Calculate a frequency in Hz for a given scale degree.

pitch{4#} Calculate a frequency in Hz for a given scale degree with sharpening (#) or flattening.

pitch{0,oct:3} Calculate a frequency in Hz for a given scale degree on a given octave. Default octave is 4.

pitch{0,scale:minor} Calculate a frequency in Hz for a given scale degree using a given scale. Default scale is the current global var scale

floor{1.5} Returns the rounded down value (returns 1 in the example)

floor{1.7,to:1/2} Precision to round to, so the example rounds 1.7 down to the nearest 1/2, which is 1.5. Defaults to 1, which rounds down to the nearest integer below.

ceil{1.5} Returns the rounded up value (returns 2 in the example)

ceil{1.2,to:1/2} Precision to round to, so the example rounds 1.2 up to the nearest 1/2, which is 1.5. Defaults to 1, which rounds up to the nearest integer above.

round{1.5} Returns the rounded value (returns 2 in the example)

round{1.7,to:1/2} Precision to round to, so the example rounds 1.7 to the nearest 1/2, which is 1.5. Defaults to 1, which rounds to the nearest integer.

accum{1} Accumulates a value over time. In the example, the result will be 1 after the first beat, 2 after the second etc, 3 after the third etc. Note that negative values are ignored; the accum value will only ever rise over time.

smooth{1} Smooths a value over time. In the example, the result will rise towards 1.

smooth{1,att:4} Smoothing attack rate; higher rate means the value will converge to the target faster when the target is above the current value. Default is 8.

smooth{1,dec:4} Smoothing decay rate; higher rate means the value will converge to the target faster when the target is below the current value. Default is 4.

rate{[0:1]l1@f} Calculate a rate of change of a value over time, in units per beat. In the example, the expression [0:1]l1@f rises from 0 to 1 over the course of the first beat, so the rate will be approximately 1 for the first beat. It then falls so the rate will be approximately -1. The rates will have jitter due to measurement inaccuracies, so it can be useful to smooth{} the result.

first{3,1,2} Returns the first argument (3 in the example)

last{3,1,2} Returns the last argument (2 in the example)

min{3,1,2} Returns the smallest argument (1 in the example)

max{3,1,2} Returns the largest argument (3 in the example)

count{3,1,2} Returns the number of arguments (3 in the example)

sum{3,1,2} Returns the sum of all arguments (6 in the example)

avg{3,1,2} Returns the mean average of all arguments (2 in the example)

rand{3,1,2} Returns one of the arguments at random

euclid{3,from:8} Euclidean rhythm generator. The example will evenly spread 3 events between 8 beats. For example p ping 0, dur=euclid{3,from:8} will make 3 notes of durations 3,2 and 3. Note this uses a Bresenham type algorithm to spread the events, rather than a classic Euclidean algorithm. This it may produce a slightly different ordering ("3 from 8" would give a 3,3,2 pattern in a classic Euclidean algorithm, but the Bresenham gives a 3,2,3 pattern. The offset subparam can be used to 'fix' this.

euclid{3,from:8,offset:1} Offset rotates the pattern. The example will give a 3,3,2 pattern which is the default 3,2,3 pattern but rotated by one.

envelope{} Return a value that changes over the course of each event like an envelope generator.

envelope{units:'s'} Specify the units the a, d etc values are in. Valid values are 's', 'ms', and 'beats'. The default is 'ms'.

envelope{shape:'lin'} Specify the shaping applied to envelope segments. Valid values 'exp' for an exponential trend to the new value, or 'lin' for linear'. The default is 'exp'.

envelope{a:1} Attack time for the envelope, in the units specified by 'units' with the shaping of 'shape'.

envelope{d:1} Decay time for the envelope, in the units specified by 'units' with the shaping of 'shape'.

rand Returns a pseudo random number between zero and one. Uses time-based hashing to provide consistent values. rand@e will provide a number that is different on each pattern event, but constant within each event. rand{seed:0} sets a specific seed for the randoms. Because the value comes from time-hashing, time based modifiers such as step and per are respected.

time Returns the current time in beats. Time modifiers such as step and per are respected.

Play Samples

a Gameboy hihat
A Gameboy kick drum
b Noisy beep
B Short saw
c Voice/string
C Choral
d Woodblock
D Dirty snare
e Electronic Cowbell
E Ringing percussion
f Pops
F Trumpet stabs
g Ominous
G Ambient stabs
h Finger snaps
H Clap
i Jungle snare
I Rock snare
j Whines
J Ambient stabs
k Wood shaker
K Percussive hits
l Robot noise
L Noisy percussive hits
m 808 toms
M Acoustic toms
n Noise
N Gameboy SFX
o Snare drum
O Heavy snare
p Tabla
P Tabla long
q Ambient stabs
Q Electronic stabs
r Metal
R Metallic
s Shaker
S Tamborine
t Rimshot
T Cowbell
u Soft snare
U Misc. Fx
v Soft kick
V Hard kick
w Dub hits
W Distorted
x Bass drum
X Heavy kick
y Percussive hits
Y High buzz
z Scratch
Z Loud stabs
- Hi hat closed
| Hangdrum
= Hi hat open
/ Reverse sounds
* Clap
\ Lazer
~ Ride cymbal
% Noise bursts
$ Beatbox
# Crash
! Yeah!
+ Clicks
& Chime
@ Gameboy noise
: Hi-hats
1 Vocals (One)
2 Vocals (Two)
3 Vocals (Three)
4 Vocals (Four)

Synthwave Library

Synthwave library: include 'preset/synthwave.limut'
Visual

neongrid Visual preset of a pink neon perspective grid scrolling towards the viewer, in the lower half of the frame. Shader loaded from shadertoy.com

neonbars Visual preset of neon perspective bars scrolling towards the viewer, in the lower half of the frame

neonbits Visual preset of bit patterns, in the lower half of the frame

neonlines Visual preset of wavy neon lines, in the lower half of the frame

neonsine Visual preset of neon sine waves with a VHS TV effect. Shader loaded from shadertoy.com

neonheart Visual preset of a neon heart with a VHS TV effect. Shader loaded from shadertoy.com

neonshapes Visual preset of prismatic neon shapes with a VHS TV effect. Shader loaded from shadertoy.com

skybars Visual preset of horizontal bars across the sky

sun Visual preset of a setting sun. Shader loaded from shadertoy.com

sunsetsky Visual preset of a sunset gradient sky in the top half of the frame

vhsbuffer Visual preset of a buffer that displays like a VHS tape on a CRT TV

Audio

basspluck plucked synth bass preset

blade Wobbly sawtooth lead preset in the style of the Blade Runner opening titles. Eg l blade 0v___1v-2__-3___....

blips random computer blips preset

bloom Big detuned saw bass pad

blues Sawtooth lead preset in the style of Blade Runner blues

chime Synth chime preset

chiparp Chip style preset that plays a simple arpeggio from the given note

cybass Cyberpunk bass preset

cydist Cyberpunk distorted preset

cyborg Wobbly synth lead preset

hiss Noise hiss synth preset; can be used for percussion

laserharp PWM preset vaguely in the style of the Elka Synthex laser harp sound. Eg l laserharp [98]_7_____[6#6]_5_____

lushpad 80s style string pad preset

moroder Moroder bass preset with a 1/16 note delay echo with stereo pan, broadly in the style of the I Feel Love bass. Eg b moroder 00-3-1b

oxy Attempt at the Solina strings from an Eminent organ, with a phaser and delay effect. Eg o oxy -7-3-50-3264, dur=1/2, sus=1/4

play80s Percussion preset with a punch 80s style

softpad Soft swirly pad preset with phaser

space Spacey vibrato lead preset

stringpad String pad preset

synbass Synth bass preset based on a sawtooth

synlead Synth lead preset with glide (pitch slide betwen notes)

synpluck Synth pluck preset

vambi PWM ambient preset in the style of Vangelis.

808 Library

808 library: include 'preset/808.limut'

bd808 Simulated 808 bd kick. Based on io808.

sd808 Simulated 808 sd snare. Based on io808.

oh808 Simulated 808 oh open hat. Based on io808.

ch808 Simulated 808 ch closed hat. Based on io808.

cb808 Simulated 808 cb cowbell. Based on io808.

cp808 Simulated 808 cp clap. Based on io808.

ma808 Simulated 808 ma maraca. Based on io808.

ht808 Simulated 808 ht high tom. Based on io808.

mt808 Simulated 808 mt mid tom. Based on io808.

lt808 Simulated 808 lt low tom. Based on io808.

hc808 Simulated 808 hc high conga. Based on io808.

mc808 Simulated 808 mc mid conga. Based on io808.

lc808 Simulated 808 lc low conga. Based on io808.

cl808 Simulated 808 cl clave. Based on io808.

rs808 Simulated 808 rs rimshot. Based on io808.

cy808 Simulated 808 cy cymbal. Based on io808.

t808 Combined 808 toms. Use 'h' and 'l' pattern flags to specify high and low toms; medium tom is default. Eg p t808 .0h00l.

c808 Combined 808 congas. Use 'h' and 'l' pattern flags to specify high and low congas; medium conga is default. Eg p c808 .0h00l.

h808 Combined 808 hihat. Use 'o' pattern flag to specify open hihat; closed is the default. Eg p h808 000o0.

tr808 Combined 808, all in one. Here pattern value does not specify accent, it specifies which 808 sound to play (similar to the play synth. For example, p tr808 xo plays 808 'bd' then 'sd'. Use the '^' pattern flag for accent. For example ss^ plays a 'ma', then an accented 'ma'. The following pattern values are supported (everything else defaults to closed hihat):
x v : bd
o i u : sd
h * : cp
- : a : ch
= : oh
~ : cy
k : cl
m : mt
t : rs
s : ma
p : mc
e : cb

303 Library

303 library: include 'preset/303.limut'
Audio

tb303 Simulated 303 (acid) bass. The following custom control params are available, corresponding to the main control knobs on a 303:
wave 303 waveform. set to 'saw' or 'square'. The default is 'saw'.
cutoff 303 cutoff control 0 to 1; default 1/2. Set the filter cutoff. Higher values give a brighter sound with more harmonics.
resonance 303 resonance control 0 to 1; default 1/2. Set the filter resonance. Higher values give a squelchy acid sound.
envmod 303 envmod control 0 to 1; default 1/2. Set the depth of envelope modulation. Higher values change the filter cutoff more over the course of a single note.
decay 303 decay control 0 to 1; default 1/2. Set the envelope decay time. Set the envelope decay time for filter envelope. Higher values take longer to decay.
accent 303 accent control 0 to 1; default 1/2. Set how much effect accented notes have.
The following pattern flags can be used:
a accent flag. Makes the preceding note accented, making it louder and brighter.
u up octave. Makes the preceding note an octave higher.
d down octave. Makes the preceding note an octave lower.
s slide. This does not (yet) work the same as the 303 slide, which would slide the _next_ note from this one, and not retrigger the envelope for it. However currently in the limut 303, it slides the _current_ note, and the envelope still retriggers (no legato).
For exampple b tb303 0u0d0ua0 plays a pattern of four notes, one up an octave, the next down an octave, one up an octave and accented, then one without any flags.

909 Library

909 library: include 'preset/909.limut'

bd909 Simulated 909 kick. The value of the event gives the accent. Control params:
level Volume level from 0 to 1, default 1/2.
tune BD tune from 0 to 1, default 1/2. Changes the pitch sweep decay time rather than the actual pitch
attack Attack level from 0 to 1, default 1/2. Changes the level of initial click and noise hit rather than the actual attack.
decay Decay from 0 to 1, default 1/2.

h909 Simulated 909 hihats. The value of the event gives the accent. Use an o pattern flag for an open hihat. A choke group is used so an open hihat will be cutoff by subsequent hihat hits. Control params:
level Volume level from 0 to 1, default 1/2.
chdecay Closed hihat decay from 0 to 1, default 1/2.
ohdecay Open hihat decay from 0 to 1, default 1/2.

cp909 Simulated 909 handclap. The value of the event gives the accent. Control params:
level Volume level from 0 to 1, default 1/2.

cc909 Simulated 909 crash cymbal. The value of the event gives the accent. Control params:
level Volume level from 0 to 1, default 1/2.
tune Tune from 0 to 1, default 1/2.

rc909 Simulated 909 ride cymbal. The value of the event gives the accent. Control params:
level Volume level from 0 to 1, default 1/2.
tune Tune from 0 to 1, default 1/2.

sd909 Simulated 909 snare drum. The value of the event gives the accent. Control params:
level Volume level from 0 to 1, default 1/2.
tune Tune from 0 to 1, default 1/2.
tone Tone from 0 to 1, default 1/2.
snappy Snappy from 0 to 1, default 1/2.

t909 Simulated 909 toms. The value of the event gives the accent. Use an l pattern flag for a low tom. Use an h pattern flag for a high tom. Control params:
level Volume level from 0 to 1, default 1/2.
tune Tune from 0 to 1, default 1/2.
decay Decay from 0 to 1, default 1/2.

rs909 Simulated 909 rimshot. The value of the event gives the accent. Control params:
level Volume level from 0 to 1, default 1/2.

There is also a sampled version of the 909 which does not sound quite as good, and is not as controllable, but which uses less processing power:

bds909 Sampled 909 kick.

hs909 Sampled 909 hihats.

cps909 Sampled 909 handclap.

ccs909 Sampled 909 crash cymbal.

rcs909 Sampled 909 ride cymbal.

sds909 Sampled 909 snare drum.

ts909 Sampled 909 toms.

rss909 Sampled 909 rimshot.

Trance Library

Trance library: include 'preset/trance.limut'
Audio

trance Classic supersaw trance lead. Note by default, the add param has a small chord setup for a fatter sound: add=(0,2). The following custom control params are available:
cutoff Cutoff control 0 to 1; defaults to an LFO sweep. Set the filter cutoff. Higher values give a brighter sound.
decay Decay control 0 to 1; defaults to an LFO sweep. Set the filter envelope decay time. Higher values take longer to decay.
detune Detune control 0 to 1; default 1/2. Set the amount of detune between the saw voices.

Techno Library

Techno library: include 'preset/techno.limut'
Audio

The Techno library also includes the 909, 303 and trance libraries.

hollow Hollow sounding pad

tinbass Flanged bass

sweep Slow saw bass with a filter sweep.

robot Metallic saw with a talk-y filter.

techbass Saw bass with a pluck filter envelope. The following custom control params are available:
cutoff Cutoff control 0 to 1; defaults to an LFO sweep. Set the filter cutoff. Higher values give a brighter sound.
decay Decay control 0 to 1; defaults to an LFO sweep. Set the filter envelope decay time. Higher values take longer to decay.

House Library

House library: include 'preset/house.limut'
Audio

The House library also includes the 909, 303 and trance libraries.

m1organ Simulated M1 Organ sound. The following custom control params are available:
cutoff Cutoff control 0 to 1; defaults to 1/2. Set the filter cutoff. Higher values give a brighter sound.

didgeridoo Didgeridoo drone synth.

reese Reese bass with detuned saws. The following custom control params are available:
cutoff Cutoff control 0 to 1; defaults to 1/2. Set the filter cutoff. Higher values give a brighter sound.
detune Detune level 0 to 1; defaults to 1/2. Set the detune between the saws. Higher values give a more unstable sound.


Please report bugs, problems, issues and suggestions on https://github.com/sdclibbery/limut/issues

Latest release notes including breaking changes: https://github.com/sdclibbery/limut/releases/tag/v0.17.0-alpha