!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                             /Helper functions not directly specific to TidalSafeenumerate a list of thingsenumerate ["foo","bar","baz"]![(1,"foo"), (2,"bar"), (3,"baz")]apply f to the first element of a tuple=apply function to the first value of each tuple in given listapply f! to the second element of a tuple>apply function to the second value of each tuple in given listsplit given list of a by given single a, e.g.wordsBy (== ':') "bd:3" ["bd", "3"]%shorthand for first element of triple&shorthand for second element of triple %shorthand for third element of triple apply f! to the first element of a triple apply f" to the second element of a triple apply f! to the third element of a triple ?apply function to the second value of each triple in given list?apply function to the second value of each triple in given list>apply function to the third value of each triple in given listmap f over a given list of arcs'combines two lists by interleaving themmergelists [1,2,3] [9,8,7] [1,9,2,8,3,7]like  selects n1th element from xs, but wraps over at the end of xs!map ((!!!) [1,3,5]) [0,1,2,3,4,5] [1,3,5,1,3,5]    NDefines core data types and functions for handling tidal's concept of time in s & sSafeFAn Event is a value that occurs during the period given by the first ArcF. The second one indicates the event's "domain of influence". These will often be the same, but many temporal transformations, such as rotation and scaling time, may result in arcs being split or truncated. In such cases, the first arc is preserved, but the second arc reflects the portion of the event which is relevant. (s,e) :: Arc9 represents a time interval with a start and end value.  { t : s <= t && t < e } Time is represented by a rational number. Each natural number represents both the start of the next rhythmic cycle, and the end of the previous one. Rational numbers are used so that subdivisions of each cycle can be accurately represented.xThe starting point of the current cycle. A cycle occurs from each natural number to the next, so this is equivalent to floor.IThe end point of the current cycle (and starting point of the next cycle)@The position of a time value relative to the start of its cycle.isIn a t is True if t# is inside the arc represented by a.Splits the given Arc into a list of Arcs, at cycle boundaries.Splits the given Arc into a list of ArcDs, at cycle boundaries, but wrapping the arcs within the same cycle. subArc i j( is the arc that is the intersection of i and j.3Map the given function over both the start and end Time values of the given Arc. Similar to mapArcJ but time is relative to the cycle (i.e. the sam of the start of the arc)!Returns the `mirror image' of an Arc , used by Sound.Tidal.Pattern.rev. The start time of the given Event! The original onset of the given Event"!The original offset of the given Event#The arc of the given Event$The midpoint of an Arc% if an 's first and second 's start times match& if an 's first and second 's end times match' if an 's starts is within given ( if an 's ends is within given  !"#$%&'( !"#$%&'( !"#$%&'( !"#$%&'(NoneT()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP&)*+,-.0/123456789:;<=>?@ABCDEFGHIJKLMN(,-./012+)*3PO456789:;<=>?@ABCDEFGHIJKLMN!)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPSafe<QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~SafeNone0r-The pattern datatype, a function from a time Arc to Event values. For discrete patterns, this returns the events which are active during that time. For continuous patterns, events with values for the midpoint of the given Arc is returned.2converts a ratio into human readable string, e.g. 1/35converts a time arc into human readable string, e.g. 13 343converts an event into human readable string, e.g. ("bd" 14 23)atom is a synonym for pure.silence" returns a pattern with no events.withQueryArc f p returns a new Pattern with function f applied to the Arc values passed to the original Pattern p.withQueryTime f p returns a new Pattern with function f( applied to the both the start and end Time of the Arc passed to Pattern p.withResultArc f p returns a new Pattern with function f applied to the Arc2 values in the events returned from the original Pattern p.withResultTime f p returns a new Pattern with function f( applied to the both the start and end Time of the Arc2 values in the events returned from the original Pattern p. withEvent f p returns a new Pattern# with events mapped over function f. timedValues p returns a new Pattern) where values are turned into tuples of Arc and value.overlay combines two Patternls into a new pattern, so that their events are combined over time. This is the same as the infix operator .stack combines a list of PatternCs into a new pattern, so that their events are combined over time.append combines two patterns Patterns into a new pattern, so that the events of the second pattern are appended to those of the first pattern, within a single cycleappend' does the same as appendN, but over two cycles, so that the cycles alternate between the two patterns.catz returns a new pattern which interlaces the cycles of the given patterns, within a single cycle. It's the equivalent of append, but with a list of patterns.slowcat does the same as catR, but maintaining the duration of the original patterns. It is the equivalent of append', but with a list of patterns. listToPatM turns the given list of values to a Pattern, which cycles through the list.maybeListToPat is similar to  listToPat., but allows values to be optional using the Maybe type, so that Nothing! results in gaps in the pattern.run n8 returns a pattern representing a cycle of numbers from 0 to n-1.density@ returns the given pattern with density increased by the given Time factor. Therefore  density 2 p3 will return a pattern that is twice as fast, and density (1/3) p& will return one three times as slow. densityGap is similar to density3 but maintains its cyclic alignment. For example, densityGap 2 p% would squash the events in pattern pK into the first half of each cycle (and the second halves would be empty).slow does the opposite of density, i.e. slow 2 p/ will return a pattern that is half the speed.The <~Y operator shifts (or rotates) a pattern to the left (or counter-clockwise) by the given Time value. For example  (1%16) <~ pR will return a pattern with all the events moved one 16th of a cycle to the left.The ~> operator does the same as <~H but shifts events to the right (or clockwise) rather than to the left.(The above means that I is a function from patterns of any type, to a pattern of the same type.)+Make a pattern sound a bit like a breakbeatExample: d1 $ sound (brak "bd sn kurt") 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.Example: "d1 $ iter 4 $ sound "bd hh sn cp" 1This will produce the following over four cycles: 0bd hh sn cp hh sn cp bd sn cp bd hh cp bd hh sn There is also 5, which shifts the pattern in the opposite direction.iter' is the same as iterF, but decrements the starting subdivision instead of incrementing it.rev p returns p@ with the event positions in each cycle reversed (or mirrored). palindrome p applies rev to pS every other cycle, so that the pattern alternates between forwards and backwards.Only ! the given test function returns r the given pattern transformation is applied. The test function will be called with the current cycle as a number. d1 $ when ((elem '4'().show) (striate 4) $ sound "hh hc" The above will only apply `striate 4` to the pattern if the current cycle number contains the number 4. So the fourth cycle will be striated and the fourteenth and so on. Expect lots of striates after cycle number 399. The function seqPw allows you to define when a sound within a list starts and ends. The code below contains three separate patterns in a , but each has different start times (zero cycles, eight cycles, and sixteen cycles, respectively). All patterns stop after 128 cycles: d1 $ seqP [ (0, 128, sound "bd bd*2"), (8, 128, sound "hh*2 [sn cp] cp future*4"), (16, 128, sound (samples "arpy*8" (run 16))) ]  every n f p applies the function f to p, but only affects every n cycles. every n o f' is like  every n f with an offset of o cyclesfoldEvery ns f p applies the function f to p$, and is applied for each cycle in ns.sig f< takes a function from time to values, and turns it into a Pattern.sinewave returns a Pattern of continuous DoubleV values following a sinewave with frequency of one cycle, and amplitude from -1 to 1.sine is a synonym for sinewave.sinerat is equivalent to sinewave for Rational values, suitable for use as Time offsets.ratsine is a synonym for sinerat. sinewave1 is equivalent to sinewave!, but with amplitude from 0 to 1.sine1 is a synonym for  sinewave1.sinerat1 is equivalent to sinerat!, but with amplitude from 0 to 1. sineAmp1 d returns  sinewave1 with its amplitude offset by d.sawwave is the equivalent of sinewave for (ascending) sawtooth waves.saw is a synonym for sawwave.sawrat is the same as sawwave but returns Rational values suitable for use as Time offsets.sawwave1 is the equivalent of  sinewave1 for (ascending) sawtooth waves.saw1 is a synonym for sawwave1.sawrat1 is the same as sawwave1 but returns Rational values suitable for use as Time offsets.triwave is the equivalent of sinewave for triangular waves.tri is a synonym for triwave.trirat is the same as triwave but returns Rational values suitable for use as Time offsets.triwave1 is the equivalent of  sinewave1 for triangular waves.tri1 is a synonym for triwave1.trirat1 is the same as triwave1 but returns Rational values suitable for use as Time offsets. squarewave1 is the equivalent of  sinewave1 for square waves.square1 is a synonym for  squarewave1. squarewave is the equivalent of sinewave for square waves.square is a synonym for  squarewave.envL is a Pattern of continuous Double values, representing a linear interpolation between 0 and 1 during the first cycle, then staying constant at 1 for all following cycles. Possibly only useful if you're using something like the retrig function defined in tidal.el.o(The above is difficult to describe, if you don't understand Haskell, just read the description and examples..)The W function allows you to take a pattern transformation which takes a parameter, such as O, and provide several parameters which are switched between. In other words it spreads" a function across several values.,Taking a simple high hat loop as an example: d1 $ sound "ho ho:2 ho:3 hc" <We can slow it down by different amounts, such as by a half: &d1 $ slow 2 $ sound "ho ho:2 ho:3 hc" 3Or by four thirds (i.e. speeding it up by a third; `4%3` means four over three): *d1 $ slow (4%3) $ sound "ho ho:2 ho:3 hc" But if we use @, we can make a pattern which alternates between the two speeds: 3d1 $ spread slow [2,4%3] $ sound "ho ho:2 ho:3 hc" zNote that if you pass ($) as the function to spread values over, you can put functions as the list of values. For example: {d1 $ spread ($) [density 2, rev, slow 2, striate 3, (# speed "0.8")] $ sound "[bd*2 [~ bd]] [sn future]*2 cp jvbass*4" VAbove, the pattern will have these transforms applied to it, one at a time, per cycle:5cycle 1: `density 2` - pattern will increase in speed cycle 2:  - pattern will be reversed2cycle 3: `slow 2` - pattern will decrease in speed2cycle 4: `striate 3` - pattern will be granualizedLcycle 5: `(# speed "0.8")` - pattern samples will be played back more slowlySAfter `(# speed "0.8")`, the transforms will repeat and start at `density 2` again. fastspread works the same as spreadM, but the result is squashed into a single cycle. If you gave four values to spreadP, then the result would seem to speed up by a factor of four. Compare these two:7d1 $ spread chop [4,64,32,16] $ sound "ho ho:2 ho:3 hc";d1 $ fastspread chop [4,64,32,16] $ sound "ho ho:2 ho:3 hc"There is also  slowspread, which is an alias of spread.$There's a version of this function, W (pronounced "spread prime"), which takes a *pattern* of parameters, instead of a list: 4d1 $ spread' slow "2 4%3" $ sound "ho ho:2 ho:3 hc" This is quite a messy area of Tidal - due to a slight difference of implementation this sounds completely different! One advantage of using < though is that you can provide polyphonic parameters, e.g.: 9d1 $ spread' slow "[2 4%3, 3]" $ sound "ho ho:2 ho:3 hc" $`spreadChoose f xs p` is similar to  but picks values from xsN at random, rather than cycling through them in order. It has a shorter alias .Decide whether to apply one or another function depending on the result of a test function that is passed the current cycle as a number. Td1 $ ifp ((== 0).(flip mod 2)) (striate 4) (# coarse "24 48") $ sound "hh hc" _This will apply `striate 4` for every _even_ cycle and aply `# coarse "24 48"` for every _odd_.JDetail: As you can see the test function is arbitrary and does not rely on anything tidal specific. In fact it uses only plain haskell functionality, that is: it calculates the modulo of 2 of the current cycle which is either 0 (for even cycles) or 1. It then compares this value against 0 and returns the result, which is either  or . This is what the k signature's first part signifies `(Int -> Bool)`, a function that takes a whole number and returns either  or .S generates a continuous pattern of (pseudo-)random, floating point numbers between `0` and `1`. d1 $ sound "bd*8" # pan rand pans bass drums randomly $d1 $ sound "sn sn ~ sn" # gain rand *makes the snares' randomly loud and quiet.Numbers coming from this pattern are random, but dependent on time. So if you reset time via `cps (-1)` the random pattern will emit the exact same _random_ numbers again.In cases where you need two different random patterns, you can shift one of them around to change the time from which the _random_ pattern is read, note the difference: :d1 $ jux (|+| gain rand) $ sound "sn sn ~ sn" # gain rand =and with the juxed version shifted backwards for 1024 cycles: Hd1 $ jux (|+| ((1024 <~) $ gain rand)) $ sound "sn sn ~ sn" # gain rand  Just like U but for integers, `irand n` generates a pattern of (pseudo-)random integers between `0` to `n-1`@ inclusive. Notably used to pick a random samples from a folder: (d1 $ sound (samples "drum*4" (irand 5)) -Randomly picks an element from the given list Cd1 $ sound (samples "xx(3,8)" (tom $ choose ["a", "e", "g", "c"])) Jplays a melody randomly choosing one of the four notes "a", "e", "g", "c". Similar to  p allows you to control the percentage of events that are removed. For example, to remove events 90% of the time: qd1 $ slow 2 $ degradeBy 0.9 $ sound "[[[feel:5*8,feel*3] feel:3*8], feel*4]" # accelerate "-6" # speed "2" Use  sometimesBy to apply a given function "sometimes". For example, the following code results in `density 2` being applied about 25% of the time: 1d1 $ sometimesBy 0.25 (density 2) $ sound "bd*8" There are some aliases as well: sometimes = sometimesBy 0.5 often = sometimesBy 0.75 rarely = sometimesBy 0.25 almostNever = sometimesBy 0.1 almostAlways = sometimesBy 0.9  sometimes! is an alias for sometimesBy 0.5.often" is an alias for sometimesBy 0.75.rarely" is an alias for sometimesBy 0.25. almostNever is an alias for sometimesBy 0.1 almostAlways is an alias for sometimesBy 0.9 someCyclesBy is a cycle-by-cycle version of  sometimesBy1. It has a `someCycles = someCyclesBy 0.5` alias 8 randomly removes events from a pattern 50% of the time: kd1 $ slow 2 $ degrade $ sound "[[[feel:5*8,feel*3] feel:3*8], feel*4]" # accelerate "-6" # speed "2" The shorthand syntax for  is a question mark: ?. Using ?F will allow you to randomly remove events from a portion of a pattern: 2d1 $ slow 2 $ sound "bd ~ sn bd ~ bd? [sn bd?] ~" You can also use ?4 to randomly remove events from entire sub-patterns: >d1 $ slow 2 $ sound "[[[feel:5*8,feel*3] feel:3*8]?, feel*4]"  wedge t p p' combines patterns p and p' by squashing the p) into the portion of each cycle given by t, and p'" into the remainer of each cycle.whenmod$ has a similar form and behavior to , but requires an additional number. Applies the function to the pattern, when the remainder of the current loop number divided by the first parameter, is greater or equal than the second parameter.OFor example the following makes every other block of four loops twice as dense: 2d1 $ whenmod 8 4 (density 2) (sound "bd sn kurt")  !superimpose f p = stack [p, f p]  plays a modified version of a pattern at the same time as the original pattern, resulting in two patterns being played at the same time. |d1 $ superimpose (density 2) $ sound "bd sn [cp ht] hh" d1 $ superimpose ((# speed "2") . (0.125 <~)) $ sound "bd sn cp hh" splitQueries p wraps p to ensure that it does not get queries that span arcs. For example `arc p (0.5, 1.5)` would be turned into two queries, `(0.5,1)` and `(1,1.5)`, and the results combined. Being able to assume queries don't span cycles often makes transformations easier to specify.Truncates a pattern so that only a fraction of the pattern is played. The following example plays only the first three quarters of the pattern: <d1 $ trunc 0.75 $ sound "bd sn*2 cp hh*4 arpy bd*2 cp bd*2" Plays a portion of a pattern, specified by a beginning and end arc of time. The new resulting pattern is played over the time period of the original pattern: :d1 $ zoom (0.25, 0.75) $ sound "bd*2 hh*3 [sn bd]*2 drum" In the pattern above, G is used with an arc from 25% to 75%. It is equivalent to this pattern: d1 $ sound "hh*3 [sn bd]*2" Use x to apply a function to only a part of a pattern. For example, to apply `density 2` to only the first half of a pattern: Ed1 $ within (0, 0.5) (density 2) $ sound "bd*2 sn lt mt hh hh hh hh" DOr, to apply `(# speed "0.5") to only the last quarter of a pattern: Jd1 $ within (0.75, 1) (# speed "0.5") $ sound "bd*2 sn lt mt hh hh hh hh"  You can use the eu function to apply a Euclidean algorithm over a complex pattern, although the structure of that pattern will be lost: "d1 $ e 3 8 $ sound "bd*2 [sn cp]" In the above, three sounds are picked from the pattern on the right according to the structure given by the `e 3 8`. It ends up picking two bd sounds, a cp and missing the sn entirely.These types of sequences use "Bjorklund's algorithm", which wasn't made for music but for an application in nuclear physics, which is exciting. More exciting still is that it is very similar in structure to the one of the first known algorithms written in Euclid's book of elements in 300 BC. You can read more about this in the paper [The Euclidean Algorithm Generates Traditional Musical Rhythms](http:/cgm.cs.mcgill.ca ~godfried publicationslbanff.pdf) by Toussaint. Some examples from this paper are included below, including rotation in some cases. b- (2,5) : A thirteenth century Persian rhythm called Khafif-e-ramal. - (3,4) : The archetypal pattern of the Cumbia from Colombia, as well as a Calypso rhythm from Trinidad. - (3,5,2) : Another thirteenth century Persian rhythm by the name of Khafif-e-ramal, as well as a Rumanian folk-dance rhythm. - (3,7) : A Ruchenitza rhythm used in a Bulgarian folk-dance. - (3,8) : The Cuban tresillo pattern. - (4,7) : Another Ruchenitza Bulgarian folk-dance rhythm. - (4,9) : The Aksak rhythm of Turkey. - (4,11) : The metric pattern used by Frank Zappa in his piece titled Outside Now. - (5,6) : Yields the York-Samai pattern, a popular Arab rhythm. - (5,7) : The Nawakhat pattern, another popular Arab rhythm. - (5,8) : The Cuban cinquillo pattern. - (5,9) : A popular Arab rhythm called Agsag-Samai. - (5,11) : The metric pattern used by Moussorgsky in Pictures at an Exhibition. - (5,12) : The Venda clapping pattern of a South African children s song. - (5,16) : The Bossa-Nova rhythm necklace of Brazil. - (7,8) : A typical rhythm played on the Bendir (frame drum). - (7,12) : A common West African bell pattern. - (7,16,14) : A Samba rhythm necklace from Brazil. - (9,16) : A rhythm necklace used in the Central African Republic. - (11,24,14) : A rhythm necklace of the Aka Pygmies of Central Africa. - (13,24,5) : Another rhythm necklace of the Aka Pygmies of the upper Sangha.  0prrw f rot (blen, vlen) beatPattern valuePattern: pattern rotate/replace.-prr rot (blen, vlen) beatPattern valuePattern: pattern rotate/replace."preplace (blen, plen) beats values combines the timing of beats with the values of values<. Other ways of saying this are: * sequential convolution * values quantized to beats. Examples: ud1 $ sound $ preplace (1,1) "x [~ x] x x" "bd sn" d1 $ sound $ preplace (1,1) "x(3,8)" "bd sn" d1 $ sound $ "x(3,8)"  ~C "bd sn" d1 $ sound "[jvbass jvbass:5]*3" |+| (shape $ "1 1 1 1 1"  ~ "0.2 0.9") It is assumed the pattern fits into a single cycle. This works well with pattern literals, but not always with patterns defined elsewhere. In those cases use preplace@ and provide desired pattern lengths: @ let p = slow 2 $ "x x x"'d1 $ sound $ preplace (2,1) p "bd sn" @prep is an alias for preplace.protate len rot p rotates pattern p by rot beats to the left. len.: length of the pattern, in cycles. Example: <d1 $ every 4 (protate 2 (-1)) $ slow 2 $ sound "bd hh hh hh"The <<~9 operator rotates a unit pattern to the left, similar to <~T, but by events rather than linear time. The timing of the pattern remains constant: Id1 $ (1 <<~) $ sound "bd ~ sn hh" -- will become d1 $ sound "sn ~ hh bd" ~>> is like <<~ but for shifting to the right.pequal cycles p1 p2: quickly test if p1 and p2 are the same.discretise n p: samples the pattern p at a rate of nQ events per cycle. Useful for turning a continuous pattern into a discrete one. randcat ps : does a slowcat on the list of patterns ps4 but randomises the order in which they are played.The  function takes a pattern of integer numbers, which are used to select values from the given list. What makes this a bit strange is that only a given number of values are selected each cycle. For example: Id1 $ sound (fit 3 ["bd", "sn", "arpy", "arpy:1", "casio"] "0 [~ 1] 2 1") The above fits three samples into the pattern, i.e. for the first cycle this will be `"bd"`, `"sn"` and `"arpy"`, giving the result `"bd [~ sn] arpy sn"` (note that we start counting at zero, so that `0` picks the first value). The following cycle the *next* three values in the list will be picked, i.e. `"arpy:1"`, `"casio"` and `"bd"`, giving the pattern `"arpy:1 [~ casio] bd casio"` (note that the list wraps round here).! struct a b: structures pattern b in terms of a." substruct a b : similar to struct, but each event in pattern a gets replaced with pattern b., compressed to fit the timespan of the event.% returns the nth iteration of a  &https://en.wikipedia.org/wiki/L-systemLindenmayer System with given start sequence. for example: 'lindenmayer 1 "a:b,b:ab" "ab" -> "bab" 'ORemoves events from second pattern that don't start during an event from first.6Consider this, kind of messy rhythm without any rests. ?d1 $ sound (slowcat ["sn*8", "[cp*4 bd*4, hc*5]"]) # n (run 8) If we apply a mask to it nd1 $ s (mask ("1 1 1 ~ 1 1 ~ 1" :: Pattern Bool) (slowcat ["sn*8", "[cp*4 bd*4, bass*5]"] )) # n (run 8) Due to the use of ` here, the same mask is first applied to `"sn*8"` and in the next cycle to `"[cp*4 bd*4, hc*5]".=You could achieve the same effect by adding rests within the  patterns, but mask allows you to do this more easily. It kind of keeps the rhythmic structure and you can change the used samples independently, e.g. rd1 $ s (mask ("1 ~ 1 ~ 1 1 ~ 1" :: Pattern Bool) (slowcat ["can*8", "[cp*4 sn*4, jvbass*16]"] )) # n (run 8) Detail: It is currently needed to explicitly _tell_ Tidal that the mask itself is a `Pattern Bool` as it cannot infer this by itself, otherwise it will complain as it does not know how to interpret your input.** is a generalization of , where the list is instead constructed by using another integer pattern to slice up a given pattern. The first argument is the number of cycles of that latter pattern to use when slicing. It's easier to understand this with a few examples: *d1 $ sound (fit' 1 2 "0 1" "1 0" "bd sn") !So what does this do? The first `1`< just tells it to slice up a single cycle of `"bd sn"`. The `2`K tells it to select two values each cycle, just like the first argument to #. The next pattern `"0 1"` is the "from" pattern which tells it how to slice, which in this case means `"0"` maps to `"bd"`, and `"1"` maps to `"sn"`. The next pattern `"1 0"` is the "to" pattern, which tells it how to rearrange those slices. So the final result is the pattern `"sn bd"`.-A more useful example might be something like `d1 $ fit' 1 4 (run 4) "[0 3*2 2 1 0 3*2 2 [1*8 ~]]/2" $ chop 4 $ (sound "breaks152" # unit "c")  which uses chop8 to break a single sample into individual pieces, which *p then puts into a list (using the `run 4` pattern) and reassembles according to the complicated integer pattern.+ runWith n f p treats the given pattern p as having n$ sections, and applies the function f@ to one of those sections per cycle, running from left to right. 8d1 $ runWith 4 (density 4) $ sound "cp sn arpy [mt lt]" ,runWith' works much the same as +, but runs from right to left.2toScale lets you turn a pattern of notes within a scale (expressed as a list) to note numbers. For example `toScale [0, 4, 7] "0 1 2 3"` will turn into the pattern `"0 4 7 12"`. It assumes your scale fits within an octave, to change this use 3 size`. Example: toscaleA 24 [0,4,7,10,14,17] (run 8)` turns into `"0 4 7 10 14 17 24 28"`4#`swingBy x n` divides a cycle into nA slices and delays the notes in the second half of each slice by x fraction of a slice . swing is an alias for `swingBy (1%3)`66 is like 9 but only picks a new item from the list once each cycle 76`shuffle n p` evenly divides one cycle of the pattern p into n parts, and returns a random permutation of the parts each cycle. For example, `shuffle 3 "a b c"` could return `"a b c"`, `"a c b"`, `"b a c"`, `"b c a"`, `"c a b"`, or `"c b a"`. But it will **never** return `"a a a"`, because that is not a permutation of the parts.8`scramble n p` is like 7( but randomly selects from the parts of p instead of making permutations. For example, `scramble 3 "a b c"` will randomly select 3 parts from `"a"` `"b"` and `"c"`, possibly repeating a single part.=mempty is a synonym for silence. | mappend is a synonym for overlay.>pure a, returns a pattern with an event with value a>, which has a duration of one cycle, and repeats every cycle.@show (p :: Pattern)i returns a text string representing the event values active during the first cycle of the given pattern.CAdmit the pattern datatype to the Num, Fractional and Floating classes, to allow arithmetic on them, and for bare numbers to be automatically converted into patterns of numbers      !"#$%&'()*+,-./0123456789:;<=>?@ABC      !"#$%&'()*+,-./0123456789:;CBA@?>=<      !"#$%&'()*+,-./0123456789:;      !"#$%&'()*+,-./0123456789:;<=>?@ABCNonepchordate cs m n selects the n>th "chord" (a chord is a list of Ints) from a list of chords cs and transposes it by mqflatpatI takes a Pattern of lists and pulls the list elements as separate Eventsrenchord chords pn pc& turns every note in the note pattern pn/ into a chord, selecting from the chord lists chords using the index pattern pc. For example, 6Chords.enchord [Chords.major Chords.minor] "c g" "0 1"G will create a pattern of a C-major chord followed by a G-minor chord./DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr/DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr/DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr/DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrNone9;[yAST representation of patternsTPat_E Int Int (TPat a)Estuvwxyz{|}~<stuvwxyz{|}~Eyz{|}~wxvstu7stuvwxy z{|}~ None09;OT7These are shorthand for merging lists of patterns with #, |*|, |+|, or |/|. Sometimes this saves a little typing and can improve readability when passing things into other functions. As an example, instead of writing Z d1 $ sometimes ((|*| speed "2") . (|*| cutoff "2") . (|*| shape "1.5")) $ sound "arpy*4"  cutoff "350"  shape "0.3"  you can write l d1 $ sometimes (*** [speed "2", cutoff "2", shape "1.5"]) $ sound "arpy*4" ### [cutoff "350", shape "0.3"] 5Copies values from one parameter to another. Used by nToOrbit in Sound.Tidal.Dirt. DAF0 111111 None1group multiple params into one8A pattern of strings representing sounds or synth notes. Internally,  or its shorter alias  is a combination of the samplebank name and number when used with samples, or synth name and note number when used with a synthesiser. For example `bd:2`k specifies the third sample (not the second as you might expect, because we start counting at zero) in the bd sample folder. Internally, /: is a combination of two parameters, the hidden parameter b2 which specifies the samplebank or synth, and the ;B parameter which specifies the sample or note number. For example: d1 $ sound "bd:2 sn:0" is essentially the same as: d1 $ s' "bd sn" # n "2 0" ;} is therefore useful when you want to pattern the sample or note number separately from the samplebank or synth. For example:  d1 $ n "0 5 ~ 2" # sound "drum" is equivalent to: $d1 $ sound "drum:0 drum:5 ~ drum:2" Ja pattern of numbers that speed up (or slow down) samples while they play.ya pattern of numbers to specify the attack time (in seconds) of an envelope applied to each sample. Only takes effect if V is also specified. Ta pattern of numbers from 0 to 1. Sets the center frequency of the band-pass filter. La pattern of numbers from 0 to 1. Sets the q-factor of the band-pass filter. Ka pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25`/ to cut off the first quarter from each sample. Using `begin "-1"` combined with `cut "-1"` means that when the sample cuts itself it will begin playback from where the previous one left off, so it will sound like one seamless sample. This allows you to apply a synth param across a long sample in a way similar to chop: "cps 0.5 d1 $ sound "breaks125*8"  unit "c"  begin "-1"  cut "-1"  coarse "1 2 4 8 16 32 64 128" This will play the  breaks125 sample and apply the changing ' parameter over the sample. Compare to: #d1 $ (chop 8 $ sounds "breaks125")  unit "c"  coarse "1 2 4 8 16 32 64 128" [which performs a similar effect, but due to differences in implementation sounds different. Ochoose the physical channel the pattern is sent to, this is super dirt specificKa pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25`/ to cut off the first quarter from each sample. Using `begin "-1"` combined with `cut "-1"` means that when the sample cuts itself it will begin playback from where the previous one left off, so it will sound like one seamless sample. This allows you to apply a synth param across a long sample in a way similar to chop: "cps 0.5 d1 $ sound "breaks125*8"  unit "c"  begin "-1"  cut "-1"  coarse "1 2 4 8 16 32 64 128" This will play the  breaks125 sample and apply the changing ' parameter over the sample. Compare to: #d1 $ (chop 8 $ sounds "breaks125")  unit "c"  coarse "1 2 4 8 16 32 64 128" [which performs a similar effect, but due to differences in implementation sounds different.Ka pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25`/ to cut off the first quarter from each sample. Using `begin "-1"` combined with `cut "-1"` means that when the sample cuts itself it will begin playback from where the previous one left off, so it will sound like one seamless sample. This allows you to apply a synth param across a long sample in a way similar to chop: "cps 0.5 d1 $ sound "breaks125*8"  unit "c"  begin "-1"  cut "-1"  coarse "1 2 4 8 16 32 64 128" This will play the  breaks125 sample and apply the changing ' parameter over the sample. Compare to: #d1 $ (chop 8 $ sounds "breaks125")  unit "c"  coarse "1 2 4 8 16 32 64 128" [which performs a similar effect, but due to differences in implementation sounds different.Ka pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25`/ to cut off the first quarter from each sample. Using `begin "-1"` combined with `cut "-1"` means that when the sample cuts itself it will begin playback from where the previous one left off, so it will sound like one seamless sample. This allows you to apply a synth param across a long sample in a way similar to chop: "cps 0.5 d1 $ sound "breaks125*8"  unit "c"  begin "-1"  cut "-1"  coarse "1 2 4 8 16 32 64 128" This will play the  breaks125 sample and apply the changing ' parameter over the sample. Compare to: #d1 $ (chop 8 $ sounds "breaks125")  unit "c"  coarse "1 2 4 8 16 32 64 128" [which performs a similar effect, but due to differences in implementation sounds different.|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.Ka pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25`/ to cut off the first quarter from each sample. Using `begin "-1"` combined with `cut "-1"` means that when the sample cuts itself it will begin playback from where the previous one left off, so it will sound like one seamless sample. This allows you to apply a synth param across a long sample in a way similar to chop: "cps 0.5 d1 $ sound "breaks125*8"  unit "c"  begin "-1"  cut "-1"  coarse "1 2 4 8 16 32 64 128" This will play the  breaks125 sample and apply the changing ' parameter over the sample. Compare to: #d1 $ (chop 8 $ sounds "breaks125")  unit "c"  coarse "1 2 4 8 16 32 64 128" [which performs a similar effect, but due to differences in implementation sounds different.obit crushing, a pattern of numbers from 1 (for drastic reduction in bit-depth) to 16 (for barely no reduction).Ka pattern of numbers from 0 to 1. Skips the beginning of each sample, e.g. `0.25`/ to cut off the first quarter from each sample. Using `begin "-1"` combined with `cut "-1"` means that when the sample cuts itself it will begin playback from where the previous one left off, so it will sound like one seamless sample. This allows you to apply a synth param across a long sample in a way similar to chop: "cps 0.5 d1 $ sound "breaks125*8"  unit "c"  begin "-1"  cut "-1"  coarse "1 2 4 8 16 32 64 128" This will play the  breaks125 sample and apply the changing ' parameter over the sample. Compare to: #d1 $ (chop 8 $ sounds "breaks125")  unit "c"  coarse "1 2 4 8 16 32 64 128" [which performs a similar effect, but due to differences in implementation sounds different.'In the style of classic drum-machines, ] will stop a playing sample as soon as another samples with in same cutgroup is to be played.YAn example would be an open hi-hat followed by a closed one, essentially muting the open. Ed1 $ stack [ sound "bd", sound "~ [~ [ho:2 hc/2]]" # cut "1" ] PThis will mute the open hi-hat every second cycle when the closed one is played.Using \ with negative values will only cut the same sample. This is useful to cut very long samples  d1 $ sound " 3,8 bev, [ho:3]" # cut "-1" -Using `cut "0"` is effectively _no_ cutgroup.Va pattern of numbers from 0 to 1. Applies the cutoff frequency of the low-pass filter.Ea pattern of numbers from 0 to 1. Sets the level of the delay signal.Da pattern of numbers from 0 to 1. Sets the amount of delay feedback.?a pattern of numbers from 0 to 1. Sets the length of the delay. when set to `1`/ will disable all reverb for this pattern. See X and _# for more information about reverb.!a pattern of numbers that specify volume. Values less than 1 make the sound quieter. Values greater than 1 make the sound louder.$Wa pattern of numbers from 0 to 1. Applies the cutoff frequency of the high-pass filter.%wa pattern of numbers to specify the hold time (in seconds) of an envelope applied to each sample. Only takes effect if  and V are also specified.&Pa pattern of numbers from 0 to 1. Applies the resonance of the high-pass filter.7A pattern of numbers. Specifies whether delaytime is calculated relative to cps. When set to 1, delaytime is a direct multiple of a cycle.8loops the sample (from   to   ) the specified number of times.;)specifies the sample variation to be used<rPushes things forward (or backwards within built-in latency) in time. Allows for nice things like _swing_ feeling: Kd1 $ stack [ sound "bd bd/4", sound "hh(5,8)" ] # nudge "[0 0.04]*4"  -pitch model >rPushes things forward (or backwards within built-in latency) in time. Allows for nice things like _swing_ feeling: Kd1 $ stack [ sound "bd bd/4", sound "hh(5,8)" ] # nudge "[0 0.04]*4"  -pitch model @rPushes things forward (or backwards within built-in latency) in time. Allows for nice things like _swing_ feeling: Kd1 $ stack [ sound "bd bd/4", sound "hh(5,8)" ] # nudge "[0 0.04]*4"  -pitch model BrPushes things forward (or backwards within built-in latency) in time. Allows for nice things like _swing_ feeling: Kd1 $ stack [ sound "bd bd/4", sound "hh(5,8)" ] # nudge "[0 0.04]*4"  -pitch model DrPushes things forward (or backwards within built-in latency) in time. Allows for nice things like _swing_ feeling: Kd1 $ stack [ sound "bd bd/4", sound "hh(5,8)" ] # nudge "[0 0.04]*4"  -pitch model FrPushes things forward (or backwards within built-in latency) in time. Allows for nice things like _swing_ feeling: Kd1 $ stack [ sound "bd bd/4", sound "hh(5,8)" ] # nudge "[0 0.04]*4"  -pitch model La pattern of numbers. An L 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.Mwa pattern of numbers between 0 and 1, from left to right (assuming stereo), once round a circle (assuming multichannel)Na pattern of numbers between -inf and inf, which controls how much multichannel output is fanned out (negative is backwards ordering)Oja pattern of numbers between 0.0 and 1.0, which controls the multichannel spread range (multichannel only)Pa pattern of numbers between 0.0 and inf, which controls how much each channel is distributed over neighbours (multichannel only)Qa 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)Vza pattern of numbers to specify the release time (in seconds) of an envelope applied to each sample. Only takes effect if  is also specified.WQa pattern of numbers from 0 to 1. Specifies the resonance of the low-pass filter.X;a pattern of numbers from 0 to 1. Sets the level of reverb.^gwave shaping distortion, a pattern of numbers from 0 for no distortion up to 1 for loads of distortion._Pa pattern of numbers from 0 to 1. Sets the perceptual size (reverb time) of the X to be used in reverb.aa pattern of numbers which changes the speed of sample playback, i.e. a cheap way of changing pitch. Negative values will play the sample backwards!b6a pattern of strings. Selects the sample to be played.gused in conjunction with ai, accepts values of "r" (rate, default behavior), "c" (cycles), or "s" (seconds). Using `unit "c"` means a 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 a.lEformant filter to make things sound like vowels, a pattern of either a,  , i, o or u. Use a rest (`~`) for no effect.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%& '!(")#*$+%,&-'.(/)0*1+2,3-4.5/60718293:4;5<6=7>8?9@:A;B<=>?@ABCDEFGHCIDJEKFLGMHNIOJPKQLRMSNTOUPVQWRXSYTZU[V\W]X^Y_Z`[a\b]c^d_e`fagbhcidjekflgmhniojpkqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<>@BDF=?ACEGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqsrtuwvxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None None None 8Pans the last n versions of the pattern across the fieldA generalization of . Washes away the current pattern after a certain delay by applying a function to it over time, then switching over to the next pattern to which another function is applied.fWash away the current pattern by applying a function to it over time, then switching over to the next. Wd1 $ sound "feel ! feel:1 feel:2" t1 (wash (chop 8) 4) $ sound "feel*4 [feel:2 sn:2]" Note that `chop 8` is applied to `sound "feel ! feel:1 feel:2"` for 4 cycles and then the whole pattern is replaced by `sound "feel*4 [feel:2 sn:2]`.Just stop for a bit before playing new patternJust as , M stops for a bit and then applies the given transition to the playing pattern 9d1 $ sound "bd" t1 (wait' (xfadeIn 8) 4) $ sound "hh*8" ZJumps directly into the given pattern, this is essentially the _no transition_-transition. Variants of ' provide more useful capabilities, see  and Sharp = transition after the specified number of cycles have passed. "t1 (jumpIn 2) $ sound "kick(3,8)" Unlike  the variant R will only transition at cycle boundary (e.g. when the cycle count is an integer).Sharp 9 transition at next cycle boundary where cycle mod n == 0:Degrade the new pattern over time until it ends in silenceNone -Striate is a kind of granulator, for example: )d1 $ striate 3 $ sound "ho ho:2 ho:3 hc" lThis plays the loop the given number of times, but triggering progressive portions of each sample. So in this case it plays the loop three times, the first time playing the first third of each sample, then the second time playing the second third of each sample, etc.. With the highhat samples in the above example it sounds a bit like reverb, but it isn't really.You can also use striate with very long samples, to cut it into short chunks and pattern those chunks. This is where things get towards granular synthesis. The following cuts a sample into 128 parts, plays it over 8 cycles and manipulates those parts by reversing and rotating the loops. )d1 $ slow 8 $ striate 128 $ sound "bev" The  function is a variant of G with an extra parameter, which specifies the length of each part. The  function still scans across the sample over a single cycle, but if each bit is longer, it creates a sort of stuttering effect. For example the following will cut the bev sample into 32 parts, but each will be 1/16th of a sample long: 0d1 $ slow 32 $ striate' 32 (1/16) $ sound "bev"  Note that  uses the   and  8 parameters internally. This means that if you're using  (or &) you probably shouldn't also specify   or  . like 1, but with an offset to the begin and end values  Just like w, but also loops each sample chunk a number of times specified in the second argument. The primed version is just like :, where the loop count is the third argument. For example: -d1 $ striateL' 3 0.125 4 $ sound "feel sn:2" Like , these use the   and  ' parameters internally, as well as the 8 parameter for these versions.|Also degrades the current pattern and undegrades the next. To change the number of cycles the transition takes, you can use clutchIn like so: Ad1 $ sound "bd(5,8)" t1 (clutchIn 8) $ sound "[hh*4, odx(3,8)]" &will take 8 cycles for the transition.8Degrades the current pattern while undegrading the next. This is like xfade but not by gain of samples but by randomly removing events from the current pattern and slowly adding back in missing events from the next one. ;d1 $ sound "bd(3,8)" t1 clutch $ sound "[hh*4, odx(3,8)]" clutch: takes two cycles for the transition, essentially this is  clutchIn 2.Icrossfades between old and new pattern over given number of cycles, e.g.: 7d1 $ sound "bd sn" t1 (xfadeIn 16) $ sound "jvbass*3" 3Will fade over 16 cycles from "bd sn" to "jvbass*3"?Crossfade between old and new pattern over the next two cycles. -d1 $ sound "bd sn" t1 xfade $ sound "can*3"  is built with - in this case taking two cycles for the fade.Stut applies a type of delay to a pattern. It has three parameters, which could be called depth, feedback and time. Depth is an integer and the others floating point. This adds a bit of echo: $d1 $ stut 4 0.5 0.2 $ sound "bd sn" The above results in 4 echos, each one 50% quieter than the last, with 1/5th of a cycle between them. It is possible to reverse the echo: 'd1 $ stut 4 0.5 (-0.2) $ sound "bd sn" 5Instead of just decreasing volume to produce echoes, stut'\ allows to apply a function for each step and overlays the result delayed by the given time. =d1 $ stut' 2 (1%3) (# vowel "{a e i o u}%2") $ sound "bd sn" TIn this case there are two _overlays_ delayed by 1/3 of a cycle, where each has the vowel filter applied.same as ^ though it allows you to specify the number of cycles until dropping to the new pattern, e.g.: Dd1 $ sound "jvbass(3,8)" t1 (anticipateIn 4) $ sound "jvbass(5,8)"  is an increasing comb filter.QBuild up some tension, culminating in a _drop_ to the new pattern after 8 cycles. Copies the n parameter to the orbitV parameter, so different sound variants or notes go to different orbits in SuperDirt.    NoneThe  function creates strange stereo effects, by applying a function to a pattern, but only in the right-hand channel. For example, the following reverses the pattern on the righthand side: <d1 $ slow 32 $ jux (rev) $ striate' 32 (1/16) $ sound "bev" 2When passing pattern transforms to functions like  #juxjux and  #everyevery;, it's possible to chain multiple transforms together with lg, for example this both reverses and halves the playback speed of the pattern in the righthand channel: Nd1 $ slow 32 $ jux ((# speed "0.5") . rev) $ striate' 32 (1/16) $ sound "bev" In addition to ,  allows using a list of pattern transform. resulting patterns from each transformation will be spread via pan from left to right. For example: Ad1 $ jux' [iter 4, chop 16, id, rev, palindrome] $ sound "bd sn" 5will put `iter 4` of the pattern to the far left and  to the far right. In the center the original pattern will play and mid left mid right the chopped and the reversed version will appear.One could also write: d1 $ stack [ iter 4 $ sound "bd sn" # pan "0", chop 16 $ sound "bd sn" # pan "0.25", sound "bd sn" # pan "0.5", rev $ sound "bd sn" # pan "0.75", palindrome $ sound "bd sn" # pan "1", ] Multichannel variant of , _not sure what it does_With , the original and effected versions of the pattern are panned hard left and right (i.e., panned at 0 and 1). This can be a bit much, especially when listening on headphones. The variant Y has an additional parameter, which brings the channel closer to the centre. For example: -d1 $ juxBy 0.5 (density 2) $ sound "bd sn:1" dIn the above, the two versions of the pattern would be panned at 0.25 and 0.75, rather than 0 and 1.Smash is a combination of  and  - it cuts the samples into the given number of bits, and then cuts between playing the loop at different speeds according to the values in the list.So this: /d1 $ smash 3 [2,3,4] $ sound "ho ho:2 ho:3 hc" Is a bit like this: Ad1 $ spread (slow) [2,3,4] $ striate 3 $ sound "ho ho:2 ho:3 hc" This is quite dancehall: sd1 $ (spread' slow "1%4 2 1 3" $ spread (striate) [2,3,4,1] $ sound "sn:2 sid:3 cp sid:4") # speed "[1 2 1 1]/2" an altenative form to  is  which will use  instead of .x will "spin" a layer up a pattern the given number of times, with each successive layer offset in time by an additional `1/n`) of a cycle, and panned by an additional `1/n`f. The result is a pattern that seems to spin around. This function works best on multichannel systems. Ld1 $ slow 3 $ spin 4 $ sound "drum*3 tabla:4 [arpy:2 ~ arpy] [can:2 can:3]" 2 will take a pattern which goes from 0 to 1 (like ), and scale it to a different range - between the first and second arguments. In the below example, `scale 1 1.5` shifts the range of  from 0 - 1 to 1 - 1.5. Sd1 $ jux (iter 4) $ sound "arpy arpy:2*2" |+| speed (slow 4 $ scale 1 1.5 sine1)  is an exponential version of X, good for using with frequencies. Do *not* use negative numbers or zero as arguments!  granualizes every sample in place as it is played, turning a pattern of samples into a pattern of sample parts. Use an integer value to specify how many granules each sample is chopped into: .d1 $ chop 16 $ sound "arpy arp feel*4 arpy*4" Different values of A can yield very different results, depending on the samples used: d1 $ chop 16 $ sound (samples "arpy*8" (run 16)) d1 $ chop 32 $ sound (samples "arpy*8" (run 16)) d1 $ chop 256 $ sound "bd*4 [sn cp] [hh future]*2 [cp feel]"  is similar to  in that it granualizes every sample in place as it is played, but every other grain is silent. Use an integer value to specify how many granules each sample is chopped into: Bd1 $ gap 8 $ sound "jvbass" d1 $ gap 16 $ sound "[jvbass drum:4]" M applies a function smoothly over an array of different patterns. It uses an  OscPatternV to apply the function at different levels to each pattern, creating a weaving effect. [d1 $ weave 3 (shape $ sine1) [sound "bd [sn drum:2*2] bd*2 [sn drum:1]", sound "arpy*8 ~"] ] is similar in that it blends functions at the same time at different amounts over a pattern: `d1 $ weave' 3 (sound "bd [sn drum:2*2] bd*2 [sn drum:1]") [density 2, (# speed "0.5"), chop 16] (A function that takes two OscPatterns, and blends them together into a new OscPattern. An OscPattern is basically a pattern of messages to a synthesiser.)8Shifts between the two given patterns, using distortion.Example: Fd1 $ interlace (sound "bd sn kurt") (every 3 rev $ sound "bd sn:2") Step sequencinglike C, but allows you to specify an array of strings to use for 0,1,2...  / does a poor man's pitchshift by semitones via a.=You can easily produce melodies from a single sample with up: d1  up "0 5 4 12"  sound "arpy" ~This will play the _arpy_ sample four times a cycle in the original pitch, pitched by 5 semitones, by 4 and then by an octave.T makes a sample fit the given number of cycles. Internally, it works by setting the gF parameter to "c", changing the playback speed of the sample with the a$ parameter, and setting setting the  of the pattern to match. {d1 $ loopAt 4 $ sound "breaks125" d1 $ juxBy 0.6 (|*| speed "2") $ slowspread (loopAt) [4,6,2,3] $ chop 12 $ sound "fm:14" (tabby - A more literal weaving than the  function, give number of threads^ per cycle and two patterns, and this function will weave them together using a plain (aka +) weave, with a simple over/under structure,     ,     ,     ,     Nonemnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ !"#$%&'()*+,-.0/123456789:;<=>?@ABCDEFGHIJKLMN      !"#$%&'()*+,-./0123456789:;stuvwxyz{|}~      !"#$%& '!(")#*$+%,&-'.(/)0*1+2,3-4.5/60718293:4;5<6=7>8?9@:A;B<=>?@ABCDEFGHCIDJEKFLGMHNIOJPKQLRMSNTOUPVQWRXSYTZU[V\W]X^Y_Z`[a\b]c^d_e`fagbhcidjekflgmhniojpkqrstuvwxyz{|}~     _ !"#$%&'()*+,-./0123456789::;<<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQzRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                       !"#$%&' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x yz{z|}~zzzzzzzzzzzzzzzz%%%%%%%%%%%%%%%%%%%%%%%%%%%                             ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefegeheiejekelemeneozpzqzrzst tidal-0.9-5iSw6RjVppE49n9cCNndY5Sound.Tidal.UtilsSound.Tidal.TimeSound.Tidal.TempoSound.Tidal.ScalesSound.Tidal.BjorklundSound.Tidal.PatternSound.Tidal.ChordsSound.Tidal.ParseSound.Tidal.StreamSound.Tidal.ParamsSound.Tidal.OscStreamSound.Tidal.SuperColliderSound.Tidal.TransitionSound.Tidal.DirtSound.Tidal.StrategiesSound.Tidal.Context enumeratemapFstmapFstsmapSndmapSndswordsBy maybeReadfst'snd'thd'mapFst'mapSnd'mapThd'mapFsts'mapSnds'mapThds'mapArcs mergelists!!!EventArcTimesamnextSamcyclePosisIn arcCycles arcCycles'subArcmapArcmapCycle mirrorArc eventStart eventOnset eventOffseteventArcmidPointhasOnset hasOffsetonsetInoffsetIn TConnection ClientStateTempoatbeatcpspaused clockLatencywsConn getLatency getClockIp getServerPort readTempo logicalTime tempoMVarbeatNow clientApp sendTemposendCps sendNudge connectClient runClient cpsUtils'cpsUtilsbpsUtils cpsSetterclocked clockedTick updateTempo nudgeTempo removeClient broadcast startServer serverApp oscBridge serverLoop $fShowTempo$fEqTConnectionminPentmajPentritusenegyptiankumai hirajoshiiwatochineseindianpelog prometheusscriabingongshangjiaozhiyuwhole augmented augmented2 hexMajor7 hexDorian hexPhrygianhexSus hexMajor6 hexAeolianmajorioniandorianphrygianlydian mixolydianaeolianminorlocrian harmonicMinor harmonicMajor melodicMinormelodicMinorDesc melodicMajorbartokhindutodipurvimarvabhairav ahirbhairav superLocrian romanianMinorhungarianMinorneapolitanMinor enigmaticspanish leadingWhole lydianMinorneapolitanMajor locrianMajor diminished diminished2 chromatic bjorklundPatternarcshowTimeshowArc showEventunwrapatomsilence withQueryArc withQueryTime withResultArcwithResultTime withEvent timedValuesoverlaystackappendappend'cat splitAtSamslowcat listToPatmaybeListToPatrunscandensitydensity' densityGapslowslow'<~~>brakiteriter'rev palindromewhenwhenTplayWhenplayForseqPeveryevery' foldEverysigsinewavesinesineratratsine sinewave1sine1sinerat1sineAmp1sawwavesawsawratsawwave1saw1sawrat1triwavetritrirattriwave1tri1trirat1 squarewave1square1 squarewavesquareenvLenvLRenvEqenvEqRfadeOutfadeOut'fadeIn'fadeInspread slowspread fastspreadspread' spreadChoosespreadr filterValues filterOnsetsfilterStartInRangefilterOnsetsInRangeseqToRelOnsetDeltassegmentsegment'splitpoints groupByTimeifprand timeToRandirandchoose degradeBy unDegradeBy sometimesBy sometimesoftenrarely almostNever almostAlwaysneveralways someCyclesBy somecyclesBy someCyclesdegradewedgewhenmod superimpose splitQueriestrunczoomcompresssliceArcwithinrevArcee'indexprrwprrpreplaceprep preplace1 preplaceWithprw preplaceWith1prw1<~>protateprotprot1<<~~>>pequal discretiserandcatfitpermstepstruct substruct parseLMRule parseLMRule' lindenmayerunwrap'mask enclosingArcstretchfit'runWithrunWith'insideoutside loopFirsttimeLoopseqPLooptoScale'toScaleswingByswing cycleChooseshufflescrambleurur'inhabit$fMonadPattern$fMonoidPattern$fApplicativePattern$fFunctorPattern $fShowPattern$fFloatingPattern$fFractionalPattern $fNumPatternmajor7dom7minor7augdimdim7onefiveplussharp5msharp5sus2sus4sixm6 sevenSus2 sevenSus4 sevenFlat5m7flat5 sevenSharp5m7sharp5ninem9m7sharp9maj9nineSus4sixby9m6by9 sevenFlat9m7flat9 sevenFlat10 nineSharp5m9sharp5sevenSharp5flat9 m7sharp5flat9elevenm11maj11 evelenSharpm11sharpthirteenm13chordateflatpatenchordSignPositiveNegativeColourD Parseable parseTPatTPat TPat_Atom TPat_Density TPat_Slow TPat_ZoomTPat_DegradeBy TPat_Silence TPat_FootTPat_Cat TPat_Overlay TPat_ShiftLTPat_pEtoPatplexerbracesbracketsparensanglessymbolnaturalintegerfloatnaturalOrFloat applySignsign intOrFloatr parseRhythm pSequenceN splitFeet pSequencepSinglepPartpPolyInpPolyOutpStringpVocablepDoublepBool parseIntNoteparseInt pIntegral parseNotefromNotepColourpMultpRandpEeoff pReplicatepStretchpRatio pRational$fIsStringPattern$fParseableColour$fParseableRatio$fParseableInteger$fParseableInt$fParseableBool $fParseable[]$fParseableDouble $fMonoidTPat $fShowTPat ParamPatternParamMapValueVSVFVIsvaluefvalueivalueShapeparamslatencycpsStampParamSFInamesDefaultfDefaultiDefaultBackend toMessageflush ToMessageFunc ticksPerCycle defaultValue hasDefault defaulted defaultMaprequired hasRequiredisSubsetdoAt logicalOnset' applyShape'startstatestreamstreamcallbackonTickonTick'makemakeSmakeFmakeIparammerge|=|# mergeWith mergeNumWith mergePlus|*||+||-||/|###***+++///setter copyParam $fShowParam $fOrdParam $fEqParam $fShowValue $fEqValue $fOrdValuemake'grpsoundspFpIpS accelerateattackbandfbandqbeginbegin_pchannel channel_plegatolegato_p clhatdecay clhatdecay_pcoarsecoarse_pcrushcrush_pcutcutoff cutoffegintdecaydelay delayfeedback delaytimedetunedryendgaingatehatgrainhcutoffhold hresonancekriolelagogolclaplclaveslclhatlcrashlfo lfocutoffintlfodelaylfoint lfopitchintlfoshapelfosynclhitomlkickllotomlocklooplophatlsnarendegreedegree_p mtranspose mtranspose_p ctranspose ctranspose_pharmonic harmonic_pstepsPerOctavestepsPerOctave_p octaveRatio octaveRatio_pnudgeoctaveoffset ophatdecayorbitpanpanspanpansplaypanwidth panorientpitch1pitch2pitch3 portamentorelease resonanceroomsagogosclapsclavesscrashsemitoneshapesizeslidespeeds' stutterdepth stuttertimesustaintomdecayunitvelocityvcfegintvcoegintvoicevoweldurmodwheel expression sustainpedal tremolorate tremolorate_p tremolodepthtremolodepth_p phaserrate phaserrate_p phaserdepth phaserdepth_pattchdecayctfctfgdelayfbdelaytdetgathglaglbdlchlcllcplcrlfoclfoilfoplhtlltlohlsnohdecaypit1pit2pit3porsagsclscpscrsldstdsttsustdecayvcfvcovoinotemidinotedrumdrumNOscMapOscSlangpath timestamp namedParamspreamble TimeStamp BundleStamp MessageStampNoStamp toOscDatumtoOscMapsendmakeConnection $fEqTimeStamp supercolliderscSlang scBackendscStream transitionhistpan superwashwashwaitwait'jumpjumpInjumpIn'jumpModmortalcombineVmixNums interpolateIndirt dirtSlangsuperDirtSlangsuperDirtBackendsuperDirtState dirtBackend dirtStream dirtState dirtSetterssuperDirtSetters superDirts dirtstream dirtToColour showToColour datumToColourstringToColourpickstriatestriate'striateOstriateL striateL' metronomeclutchInclutchxfadeInxfadestutstut' anticipateIn anticipatenToOrbitstutterechotriplequaddoublejuxjuxcutjuxcut'jux'jux4juxBysmashsmash'samplessamples'spreadfspinsawwave4 sinewave4rand4 stackwithscalescalexchopchop'gapchopArcenweaveweave' interlacestepstepsstep'offoffaddupghost''ghost'ghostslice randsliceloopAttabbybaseGHC.List!!ghc-prim GHC.TypesTrueSTEPleftright bjorklund' Data.Monoid<>False accelerate_pattack_pbandf_pbandq_pcut_pcutoff_p cutoffegint_pdecay_pdelay_pdelayfeedback_p delaytime_pdetune_pdry_pend_pgain_pgate_p hatgrain_p hcutoff_phold_p hresonance_pkriole_plagogo_plclap_p lclaves_plclhat_plcrash_plfo_plfocutoffint_p lfodelay_plfoint_p lfopitchint_p lfoshape_p lfosync_plhitom_plkick_pllotom_plock_ploop_plophat_plsnare_pn_pnudge_poctave_poffset_p ophatdecay_porbit_ppan_p panspan_p pansplay_p panwidth_p panorient_ppitch1_ppitch2_ppitch3_p portamento_p release_p resonance_proom_psagogo_psclap_p sclaves_pscrash_p semitone_pshape_psize_pslide_pspeed_ps_pstutterdepth_p stuttertime_p sustain_p tomdecay_punit_p velocity_p vcfegint_p vcoegint_pvoice_pvowel_pdur_p modwheel_p expression_psustainpedal_pGHC.Base.++filterzipmap<$ Applicativepure<*>*><* Data.Foldablefoldrlengthnullfoldlfoldl'foldl1sumproductfoldr1maximumminimumelemMonoidmemptymappendmconcatGHC.RealRatioRational Alternativemanyempty<|>some Data.RatioapproxRationalControl.ConcurrentthreadWaitWriteSTMthreadWaitReadSTMthreadWaitWritethreadWaitReadrunInUnboundThreadrunInBoundThreadisCurrentThreadBoundforkOSWithUnmaskforkOS forkFinallyrtsSupportsBoundThreadsControl.Concurrent.QSemN signalQSemN waitQSemNnewQSemNQSemNControl.Concurrent.QSem signalQSemwaitQSemnewQSemQSemControl.Concurrent.ChanwriteList2ChangetChanContents isEmptyChan unGetChandupChanreadChan writeChannewChanChan Data.ListisSubsequenceOfData.Traversable mapAccumR mapAccumLControl.Applicativeoptional WrappedMonad WrapMonad unwrapMonad WrappedArrow WrapArrow unwrapArrowZipList getZipList GHC.Conc.IO threadDelayControl.Concurrent.MVar mkWeakMVaraddMVarFinalizermodifyMVarMaskedmodifyMVarMasked_ modifyMVar modifyMVar_withMVarMaskedwithMVarswapMVar GHC.Conc.SyncmkWeakThreadIdthreadCapabilityyield myThreadIdthrowTo killThreadsetNumCapabilitiesgetNumCapabilitiesforkOnWithUnmaskforkOnforkIOWithUnmaskforkIOThreadIdData.Functor.ConstConstgetConstfindnotElem minimumBy maximumByallanyorand concatMapconcatDualgetDualEndoappEndoAllgetAllAnygetAnySumgetSumProduct getProductFirstgetFirstLastgetLastAltgetAlt Data.OldListunwordswordsunlineslinesunfoldrsortOnsortBysort permutations subsequencestailsinitsgroupBygroupdeleteFirstsByunzip7unzip6unzip5unzip4zipWith7zipWith6zipWith5zipWith4zip7zip6zip5zip4genericReplicate genericIndexgenericSplitAt genericDrop genericTake genericLengthinsertByinsert partition transpose intercalate intersperse intersectBy intersectunionByunion\\deleteBydeletenubBynub isInfixOf isSuffixOf isPrefixOf findIndices findIndex elemIndices elemIndex stripPrefix dropWhileEnd Data.Functor<$> denominator numerator%unzip3unzipzipWith3zipWithzip3lookupreversebreakspansplitAtdroptake dropWhile takeWhilecycle replicaterepeatiteratescanr1scanrscanl'scanl1scanlfoldl1'initlasttailunconsheadGHC.MVar isEmptyMVar tryReadMVar tryPutMVar tryTakeMVarputMVarreadMVartakeMVarnewMVar newEmptyMVarMVarliftA3liftA2liftA<**>