This is the long list functions you can use! Remember that you don't need to remember all of those and that you can already make music with a small set of functions!
accelerate
A pattern of numbers that speed up (or slow down) samples while they play. Currently only supported by osc / superdirt.
Assumes a pattern of numbers. Adds the given number to each item in the pattern.
// Here, the triad 0, 2, 4 is shifted by different amounts
"0 2 4".add("<0 3 4 0>").scale('C major').note()
// Without add, the equivalent would be:
// "<[0 2 4] [3 5 7] [4 6 8] [0 2 4]>".scale('C major').note()
// You can also use add with notes:
"c3 e3 g3".add("<0 5 7 0>").note()
// Behind the scenes, the notes are converted to midi numbers:
// "48 52 55".add("<0 5 7 0>").note()
Shorthand for .sometimesBy(1, fn) (always calls fn)
s("hh*8").always(x=>x.speed("0.5"))
amp
Like {@link gain}, but linear.
s("bd*8").amp(".1*2 .5 .1*2 .5 .1 .5").osc()
appBoth
When this method is called on a pattern of functions, it matches its haps with those in the given pattern of values. A new pattern is returned, with each matching value applied to the corresponding function.
In this _appBoth variant, where timespans of the function and value haps are not the same but do intersect, the resulting hap has a timespan of the intersection. This applies to both the part and the whole timespan.
appLeft
As with {@link Pattern#appBoth}, but the whole timespan is not the intersection, but the timespan from the function of patterns that this method is called on. In practice, this means that the pattern structure, including onsets, are preserved from the pattern of functions (often referred to as the left hand or inner pattern).
As with {@link Pattern#appLeft}, but whole timespans are instead taken from the pattern of values, i.e. structure is preserved from the right hand/outer pattern.
appWhole
Assumes 'this' is a pattern of functions, and given a function to resolve wholes, applies a given pattern of values to that pattern of functions.
Allows to arrange multiple patterns together over multiple cycles. Takes a variable number of arrays with two elements specifying the number of cycles and the pattern to use.
arrange([4, "<c a f e>(3,8)"],[2, "<g a>(5,8)"]).note()
attack
Amplitude envelope attack time: Specifies how long it takes for the sound to reach its peak value, relative to the onset.
note("c3 e3").attack("<0 .1 .5>")
bank
Select the sound bank to use. To be used together with s. The bank name (+ "_") will be prepended to the value of s.
Sets the center frequency of the band-pass filter. When using mininotation, you can also optionally supply the 'bpq' parameter separated by ':'.
s("bd sd,hh*3").bpf("<1000 2000 4000 8000>")
bpq
Sets the band-pass q-factor (resonance).
s("bd sd").bpf(500).bpq("<0 1 2 3>")
brak
Returns a new pattern where every other cycle is played once, twice as fast, and offset in time by one quarter of a cycle. Creates a kind of breakbeat feel.
cat
Appends the given pattern(s) to the next cycle.
s("hh*2").cat(
note("c2(3,8)")
)
cat
The given items are concatenated, where each one takes one cycle.
Assumes a numerical pattern. Returns a new pattern with all values set to their mathematical ceiling. E.g. 3.2 replaced with 4, and -4.2 replaced with -4.
"42 42.1 42.5 43".ceil().note()
channel
choose the channel the pattern is sent to in superdirt
choose
Chooses randomly from the given list of elements.
choose
Chooses from the given list of values (or patterns of values), according to the pattern that the method is called on. The pattern should be in the range 0 .. 1.
choose2
As with choose, but the pattern that this method is called on should be in the range -1 .. 1
chooseCycles
Picks one of the elements at random each cycle.
chooseCycles("bd", "hh", "sd").s().fast(4)
"bd | hh | sd".s().fast(4)
chooseInWith
As with {chooseWith}, but the structure comes from the chosen values, rather than the pattern you're using to choose with.
chooseWith
Choose from the list of values (or patterns of values) using the given pattern of numbers, which should be in the range of 0..1
chop
Cuts each sample into the given number of parts, allowing you to explore a technique known as 'granular synthesis'. It turns a pattern of samples into a pattern of parts of samples.
Divides a pattern into a given number of parts, then cycles through those parts in turn, applying the given function to each part in turn (one part per cycle).
Multiplies the duration with the given number. Also cuts samples off at the end if they exceed the duration. In tidal, this would be done with legato, which has a complicated history in strudel. For now, if you're coming from tidal, just think clip = legato.
note("c a f e").s("piano").clip("<.5 1 2>")
coarse
fake-resampling for lowering the sample rate. Caution: This effect seems to only work in chromium based browsers
s("bd sd,hh*4").coarse("<1 4 8 16 32>")
compress
Compress each cycle into the given timespan, leaving a gap
Sends notes to Csound for rendering with MIDI semantics. The hap value is translated to these Csound pfields:
p1 -- Csound instrument either as a number (1-based, can be a fraction), or as a string name. p2 -- time in beats (usually seconds) from start of performance. p3 -- duration in beats (usually seconds). p4 -- MIDI key number (as a real number, not an integer but in [0, 127]. p5 -- MIDI velocity (as a real number, not an integer but in [0, 127]. p6 -- Strudel controls, as a string.
cut
In the style of classic drum-machines, cut will stop a playing sample as soon as another samples with in same cutgroup is to be played. An example would be an open hi-hat followed by a closed one, essentially muting the open.
s("rd*4").cut(1)
decay
Amplitude envelope decay time: the time it takes after the attack time to reach the sustain level. Note that the decay is only audible if the sustain value is lower than 1.
note("c3 e3").decay("<.1 .2 .3 .4>").sustain(0)
defragmentHaps
Combines adjacent haps with the same value and whole. Only intended for use in tests.
degrade
Randomly removes 50% of events from the pattern. Shorthand for .degradeBy(0.5)
s("hh*8").degrade()
s("[hh?]*8")
degradeBy
Randomly removes events from the pattern by a given amount. 0 = 0% chance of removal 1 = 100% chance of removal
s("hh*8").degradeBy(0.2)
s("[hh?0.2]*8")
delay
Sets the level of the delay signal.
When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter, separated by ':'.
s("bd").delay("<0 .25 .5 1>")
s("bd bd").delay("0.65:0.25:0.9 0.65:0.125:0.7")
delayfeedback
Sets the level of the signal that is fed back into the delay. Caution: Values >= 1 will result in a signal that gets louder and louder! Don't do it
Intended for a debugging, drawLine renders the pattern as a string, where each character represents the same time span. Should only be used with single characters as values, otherwise the character slots will be messed up. Character legend:
The same as .begin, but cuts off the end off each sample.
s("bd*2,oh*4").end("<.1 .2 .5 1>")
euclid
Changes the structure of the pattern to form an euclidean rhythm. Euclidian rhythms are rhythms obtained using the greatest common divisor of two numbers. They were described in 2004 by Godfried Toussaint, a canadian computer scientist. Euclidian rhythms are really useful for computer/algorithmic music because they can describe a large number of rhythms with a couple of numbers.
// The Cuban tresillo pattern.
note("c3").euclid(3,8)
euclidLegato
Similar to euclid, but each pulse is held until the next pulse, so there will be no gaps.
n("g2").decay(.1).sustain(.3).euclidLegato(3,8)
euclidRot
Like euclid, but has an additional parameter for 'rotating' the resulting sequence.
// A Samba rhythm necklace from Brazil
note("c3").euclidRot(3,16,14)
every
An alias for {@link firstOf}
note("c3 d3 e3 g3").every(4, x=>x.rev())
fast
Speed up a pattern by the given factor. Used by "*" in mini notation.
s("<bd sd> hh").fast(2) // s("[<bd sd> hh]*2")
fastGap
speeds up a pattern like fast, but rather than it playing multiple times as fast would it instead leaves a gap in the remaining space of the cycle. For example, the following will play the sound pattern "bd sn" only once but compressed into the first half of the cycle, i.e. twice as fast.
s("bd sd").fastGap(2)
filterHaps
Returns a new Pattern, which only returns haps that meet the given test.
filterValues
As with {@link Pattern#filterHaps}, but the function is applied to values inside haps.
firstCycle
Queries the pattern for the first cycle, returning Haps. Mainly of use when debugging a pattern.
firstCycleValues
Accessor for a list of values returned by querying the first cycle.
firstOf
Applies the given function every n cycles, starting from the first cycle.
note("c3 d3 e3 g3").firstOf(4, x=>x.rev())
floor
Assumes a numerical pattern. Returns a new pattern with all values set to their mathematical floor. E.g. 3.7 replaced with to 3, and -4.2 replaced with -5.
"42 42.1 42.5 43".floor().note()
fmap
see {@link Pattern#withValue}
focus
Similar to compress, but doesn't leave gaps, and the 'focus' can be bigger than a cycle
A continuous pattern of random integers, between 0 and n-1.
// randomly select scale notes from 0 - 7 (= C to C)
irand(8).struct("x(3,8)").scale('C minor').note()
iter
Divides a pattern into a given number of subdivisions, plays the subdivisions in order, but increments the starting subdivision each cycle. The pattern wraps to the first subdivision after the last subdivision is played.
note("0 1 2 3".scale('A minor')).iter(4)
iterBack
Like iter, but plays the subdivisions in reverse order. Known as iter' in tidalcycles
note("0 1 2 3".scale('A minor')).iterBack(4)
jux
The jux function creates strange stereo effects, by applying a function to a pattern, but only in the right-hand channel.
s("lt ht mt ht hh").jux(rev)
juxBy
Jux with adjustable stereo width. 0 = mono, 1 = full stereo.
s("lt ht mt ht hh").juxBy("<0 .5 1>/2", rev)
lastOf
Applies the given function every n cycles, starting from the last cycle.
note("c3 d3 e3 g3").lastOf(4, x=>x.rev())
late
Nudge a pattern to start later in time. Equivalent of Tidal's ~> operator
"bd ~".stack("hh ~".late(.1)).s()
layer
Layers the result of the given function(s). Like {@link Pattern.superimpose}, but without the original pattern:
Makes the sample fit the given number of cycles and cps value, by changing the speed. Please note that at some point cps will be given by a global clock and this function will be deprecated/removed.
note("c [eb,g] d [eb,g]").mask("<1 [0 1]>").slow(2)
mul
Multiplies each number by the given factor.
"1 1.5 [1.66, <2 2.33>]".mul(150).freq()
n
Selects the given index from the sample map. Numbers too high will wrap around. n can also be used to play midi numbers, but it is recommended to use note instead.
s("bd sd,hh*3").n("<0 1>")
never
Shorthand for .sometimesBy(0, fn) (never calls fn)
s("hh*8").never(x=>x.speed("0.5"))
note
Plays the given note name or midi number. A note name consists of
Superimposes the function result on top of the original pattern, delayed by the given time.
"c3 eb3 g3".off(1/8, x=>x.add(7)).note()
often
Shorthand for .sometimesBy(0.75, fn)
s("hh*8").often(x=>x.speed("0.5"))
onsetsOnly
Returns a new pattern, with all haps without onsets filtered out. A hap with an onset is one with a whole timespan that begins at the same time as its part timespan.
orbit
An orbit is a global parameter context for patterns. Patterns with the same orbit will share the same global effects.
Sends each hap as an OSC message, which can be picked up by SuperCollider or any other OSC-enabled software. For more info, read MIDI & OSC in the docs
Aligns one or more given sequences to the given number of steps per cycle.
polymeterSteps(2, ["c", "d", "e", "f", "g", "f", "e", "d"])
.note().stack(s("bd")) // 1 cycle = 1 bd = 2 notes
// note("{c d e f g f e d}%2").stack(s("bd"))
press
Syncopates a rhythm, by shifting each event halfway into its timespan.
Like press, but allows you to specify the amount by which each event is shifted. pressBy(0.5) is the same as press, while pressBy(1/3) shifts each event by a third of its timespan.
A continuous pattern of random numbers, between 0 and 1.
// randomly change the cutoff
s("bd sd,hh*4").cutoff(rand.range(500,2000))
rand2
A continuous pattern of random numbers, between -1 and 1
range
Assumes a numerical pattern, containing unipolar values in the range 0 .. 1. Returns a new pattern with values scaled to the given min/max range. Most useful in combination with continuous patterns.
Assumes a numerical pattern, containing unipolar values in the range 0 .. 1 Returns a new pattern with values scaled to the given min/max range, following an exponential curve.
Chops samples into the given number of slices, triggering those slices with a given pattern of slice numbers. Instead of a number, it also accepts a list of numbers from 0 to 1 to slice at specific points.
Slow down a pattern over the given number of cycles. Like the "/" operator in mini notation.
s("<bd sd> hh").slow(2) // s("[<bd sd> hh]/2")
slowcat
Concatenation: combines a list of patterns, switching between them successively, one per cycle:
synonyms: {@link cat}
slowcat(e5, b4, [d5, c5])
slowcatPrime
Concatenation: combines a list of patterns, switching between them successively, one per cycle. Unlike slowcat, this version will skip cycles.
someCycles
Shorthand for .someCyclesBy(0.5, fn)
s("hh(3,8)").someCycles(x=>x.speed("0.5"))
someCyclesBy
Randomly applies the given function by the given probability on a cycle by cycle basis. Similar to {@link Pattern#sometimesBy}
s("hh(3,8)").someCyclesBy(.3, x=>x.speed("0.5"))
sometimes
Applies the given function with a 50% chance
s("hh*4").sometimes(x=>x.speed("0.5"))
sometimesBy
Randomly applies the given function by the given probability. Similar to {@link Pattern#someCyclesBy}
s("hh(3,8)").sometimesBy(.4, x=>x.speed("0.5"))
sortHapsByPart
Returns a new pattern, which returns haps sorted in temporal order. Mainly of use when comparing two patterns for equality, in tests.
source
Define a custom webaudio node to use as a sound source.
speed
Changes the speed of sample playback, i.e. a cheap way of changing pitch.
s("bd").speed("<1 2 4 1 -2 -4>")
speed("1 1.5*2 [2 1.1]").s("piano").clip(1)
splitQueries
Returns a new pattern, with queries split at cycle boundaries. This makes some calculations easier to express, as all haps are then constrained to happen within a cycle.
Made by Calum Gunn. Reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter. The SuperCollider manual defines Squiz as:
"A simplistic pitch-raising algorithm. It's not meant to sound natural; its sound is reminiscent of some weird mixture of filter, ring-modulator and pitch-shifter, depending on the input. The algorithm works by cutting the signal into fragments (delimited by upwards-going zero-crossings) and squeezing those fragments in the time domain (i.e. simply playing them back faster than they came in), leaving silences inbetween. All the parameters apart from memlen can be modulated."
squiz("2 4/2 6 [8 16]").s("bd").osc()
stack
Stacks the given pattern(s) to the current pattern.
s("hh*2").stack(
note("c2(3,8)")
)
stack
The given items are played at the same time at the same length.
Assumes a numerical pattern, containing unipolar values in the range 0 ..
Returns a new pattern with values scaled to the bipolar range -1 .. 1
transpose
Change the pitch of each value by the given amount. Expects numbers or note strings as values. The amount can be given as a number of semitones or as a string in interval short notation. If you don't care about enharmonic correctness, just use numbers. Otherwise, pass the interval of the form: ST where S is the degree number and T the type of interval with
Inverse of {@link Pattern#degradeBy}: Randomly removes events from the pattern by a given amount. 0 = 100% chance of removal 1 = 0% chance of removal Events that would be removed by degradeBy are let through by undegradeBy and vice versa (see second example).
s("hh*8").undegradeBy(0.2)
unit
Used in conjunction with {@link speed}, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using unit "c" means speed will be interpreted in units of cycles, e.g. speed "1" means samples will be stretched to fill a cycle. Using unit "s" means the playback speed will be adjusted so that the duration is the number of seconds specified by speed.
speed("1 2 .5 3").s("bd").unit("c").osc()
velocity
Sets the velocity from 0 to 1. Is multiplied together with gain.
Turns chord symbols into voicings. You can use the following control params:
chord: Note, followed by chord symbol, e.g. C Am G7 Bb^7
dict: voicing dictionary to use, falls back to default dictionary
anchor: the note that is used to align the chord
mode: how the voicing is aligned to the anchor
below: top note <= anchor
duck: top note <= anchor, anchor excluded
above: bottom note >= anchor
offset: whole number that shifts the voicing up or down to the next voicing
n: if set, the voicing is played like a scale. Overshooting numbers will be octaved
All of the above controls are optional, except chord. If you pass a pattern of strings to voicing, they will be interpreted as chords.
voicing("<C Am F G>")
n("0 1 2 3 4 5 6 7").chord("<C Am F G>").voicing()
voicings
DEPRECATED: still works, but it is recommended you use .voicing instead (without s). Turns chord symbols into voicings, using the smoothest voice leading possible. Uses chord-voicings package.
note("c2 <eb2 <g2 g1>>").s('sawtooth')
.vowel("<a e i <o u>>")
when
Applies the given function whenever the given pattern is in a true state.
"c3 eb3 g3".when("<0 1>/2", x=>x.sub(5)).note()
withContext
Returns a new pattern with the given function applied to the context field of every hap.
withHap
As with {@link Pattern#withHaps}, but applies the function to every hap, rather than every list of haps.
withHaps
Returns a new pattern with the given function applied to the list of haps returned by every query.
withHapSpan
Similar to {@link Pattern#withQuerySpan}, but the function is applied to the timespans of all haps returned by pattern queries (both part timespans, and where present, whole timespans).
withHapTime
As with {@link Pattern#withHapSpan}, but the function is applied to both the begin and end time of the hap timespans.
withLoc
Returns a new pattern with the given location information added to the context of every hap.
withQuerySpan
Returns a new pattern, where the given function is applied to the query timespan before passing it to the original pattern.
withQueryTime
As with {@link Pattern#withQuerySpan}, but the function is applied to both the begin and end time of the query timespan.
withValue
Returns a new pattern, with the function applied to the value of each hap. It has the alias {@link Pattern#fmap}.
"0 1 2".withValue(v => v + 10).log()
zoom
Plays a portion of a pattern, specified by the beginning and end of a time span. The new resulting pattern is played over the time period of the original pattern: