HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduletidal-1.9.5Haskell2010

Sound.Tidal.Params

  • 1302 values
  • Packagetidal-1.9.5
  • Exports1302
  • LanguageHaskell2010
  • LicenceGPL-3.0-only
  • SourceParams.hs

Param makers

11 declarations

Grouped params

10 declarations

grain' is a shortcut to join a begin and end

These are equivalent:

d1 $ slow 2 $ s "bev" # grain' "0.2:0.3" # legato 1
d1 $ slow 2 $ s "bev" # begin 0.2 # end 0.3 # legato 1

Generated params

1116 declarations

A pattern of numbers that speed up (or slow down) samples while they play.

In the following example, the sound starts at the original pitch and gets higher as it plays:

d1 $ s "arpy" # accelerate 2

You can use a negative number to make the sound get lower. In this example, a different acceleration is applied to each played note using state values:

d1 $ arp "up" $ note "c'maj'4" # s "arpy" # accelerateTake "susan" [0.2,1,-1]

Controls the amplitude (volume) of the sound. Like gain, but linear. Default value is 0.4.

d1 $ s "arpy" # amp "<0.4 0.8 0.2>"

begin receives a pattern of numbers from 0 to 1 and skips the beginning of each sample by the indicated proportion. I.e., 0 would play the sample from the start, 1 would skip the whole sample, and 0.25 would cut off the first quarter.

In this example, the first 3 ade samples are played on every cycle, but the start point from which they are played changes on each cycle:

d1 $ n "0 1 2" # s "ade" # begin "<0 0.25 0.5 0.75>" # legato 1

fake-resampling, a pattern of numbers for lowering the sample rate, i.e. 1 for original 2 for half, 3 for a third and so on.

A control pattern; setcps is the standalone function.

Patterns don’t (yet) have independent tempos though, if you change it on one pattern, it changes on all of them.

p "cpsfun" $ s "bd sd(3,8)" # cps (slow 8 $ 0.5 + saw)
valuecut :: Pattern Int -> ControlPattern
#

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.

Similar to begin, but cuts the end off samples, shortening them; e.g. 0.75 to cut off the last quarter of each sample.

d1 $ s "bev" >| begin 0.5 >| end "[0.65 0.55]"

The example above will play the sample two times for cycle, but the second time will play a shorter segment than the first time, creating a kind of canon effect.

Used to control the amplitude (volume) of the sound. Values less than 1 make the sound quieter and values greater than 1 make the sound louder.

gain uses a power function, so the volume change around 1 is subtle, but it gets more noticeable as it increases or decreases. Typical values for gain are between 0 and 1.5.

For the linear equivalent, see amp.

d1 $ s "arpy" # gain 0.8

This plays the first arpy sample at a quieter level than the default.

d1 $ s "ab*16" # gain (range 0.8 1.3 $ sine)

This plays a hihat sound, 16 times per cycle, with a gain moving from 0.8 to 1.3 following a sine wave.

A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle.

A pattern of numbers. Specifies whether the pitch of played samples should be tuned relative to their pitch metadata, if it exists. When set to 1, pitch metadata is applied. When set to 0, pitch metadata is ignored.

Nudges events into the future by the specified number of seconds. Negative numbers work up to a point as well (due to internal latency)

a pattern of numbers. An "orbit" is a global parameter context for patterns. Patterns with the same orbit will share hardware output bus offset and global effects, e.g. reverb and delay. The maximum number of orbits is specified in the superdirt startup, numbers higher than maximum will wrap around.

a pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)

a pattern of numbers between -1.0 and 1.0, which controls the relative position of the centre pan in a pair of adjacent speakers (multichannel only)

a pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)

a pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)

A pattern of numbers which changes the speed of sample playback which also changes pitch. Negative values will play the sample backwards.

d1 $ slow 5 $ s "sax:5" # legato 1 # speed 0.5

This will play the sax:5 sample at half its rate. As a result, the sample will last twice the normal time, and will be pitched a whole octave lower. This is equivalent to d1 $ slow 5 $ s "sax:5" # legato 1 |- note 12.

d1 $ fast 2 $ s "breaks125:1" # cps (125/60/4) # speed (-2)

In the above example, the break (which lasts for exactly one bar at 125 BPM), will be played backwards, and at double speed (so, we use fast 2 to fill the whole cycle).

A pattern of numbers that indicates the total duration of sample playback in seconds.

This sustain refers to the whole playback duration and is not to be confused with the sustain level of a typical ADSR envelope.

d1 $ fast 2 $ s "breaks125:1" # cps (120/60/4) # sustain 1

At 120 BPM, a cycle lasts for two seconds. In the above example, we cut the sample so it plays just for one second, and repeat this part two times, so we fill the whole cycle. Note that sample pitch isn’t modified.

d1 $ s "breaks125:2!3" # cps (120/60/4) # sustain "0.4 0.2 0.4" # begin "0 0 0.4"

Here, we take advantage that sustain receives a pattern to build a different break from the original sample.

timescale is the main function used to activate time-stretching, and usually the only one you need. It receives a single parameter which is the stretching rate to apply.

You can use any positive number as the ratio, but the particular method used is designed for ratios greater than 1, and work reasonably well for values between 0.1 and 3.

d1 $ slow 2 $ s "breaks152" # legato 1 # timescale (152/130) # cps (130/60/4)

In the example above, we set tempo at 130 beats per minute. But we want to play one of the breaks152 samples, which are, as indicated, at 152 BPM. So, the ratio we want is 152 over 130. This will slow down the sample to fit in our 130 BPM tempo.

Time stretch window size.

The algorithm used to time-stretch a sample divides a sample in many little parts, modifies them, and puts them all together again. It uses one particular parameter, called windowSize, which is the length of each sample part.

The windowSize value is automatically calculated, but can be changed with timescalewin. The windowSize value is multiplied by the number provided.

timescalewin can be used to improve the quality of time-stretching for some samples, or simply as an effect.

Consider the following two examples. In the first one, timescalewin 0.01 makes the window size a lot smaller, and the extreme chopping of the sample causes a rougher sound. In the second one, timescalewin 10 makes the chunks a lot bigger. The method used overlaps the treated chunks when recomposing the sample, and, with the bigger window size, this overlap is noticeable and causes a kind of delay effect.

d1 $ slow 2
   $ s "breaks152"
   # legato 1
   # timescale (152/130)
   # timescalewin 0.01
   # cps (130/60/4)
d1 $ slow 2
   $ s "breaks152"
   # legato 1
   # timescale (152/130)
   # timescalewin 10
   # cps (130/60/4)

Used in conjunction with speed. It 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.

In the following example, speed 2 means that samples will be stretched to fill half a cycle:

d1 $ stack [
  s "sax:5" # legato 1 # speed 2 # unit "c",
  s "bd*2"
]

Aliases

161 declarations