Creating Patterns
The following functions will return a pattern. These are the equivalents used by the Mini Notation:
| function | mini |
|---|---|
cat(x, y) | "<x y>" |
seq(x, y) | "x y" |
stack(x, y) | "x,y" |
timeCat([3,x],[2,y]) | "x@3 y@2" |
polymeter([a, b, c], [x, y]) | "{a b c, x y}" |
polymeterSteps(2, x, y, z) | "{x y z}%2" |
silence | "~" |
cat
slowcatThe given items are concatenated, where each one takes one cycle.
- items (any): The items to concatenate
cat(e5, b4, [d5, c5]).note() // "<e5 b4 [d5 c5]>".note()
You can also use cat as a chained function like this:
s("hh*2").cat(
note("c2(3,8)")
)seq
fastcat, sequenceLike cat, but the items are crammed into one cycle.
seq(e5, b4, [d5, c5]).note() // "e5 b4 [d5 c5]".note()
Or as a chained function:
s("hh*2").seq(
note("c2(3,8)")
)stack
polyrhythm, prThe given items are played at the same time at the same length.
stack(g3, b3, [e4, d4]).note() // "g3,b3,[e4,d4]".note()
As a chained function:
s("hh*2").stack(
note("c2(3,8)")
)timeCat
Like Pattern.seq, but each step has a length, relative to the whole.
timeCat([3,e3],[1, g3]).note() // "e3@3 g3".note()
arrange
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()
polymeter
pmCombines the given lists of patterns with the same pulse. This will create so called polymeters when different sized sequences are used.
polymeter(["c", "eb", "g"], ["c2", "g2"]).note()
// "{c eb g, c2 g2}".note()polymeterSteps
Aligns one or more given sequences to the given number of steps per cycle.
- steps (number): how many items are placed in one cycle
- sequences (Array.<any>): one or more arrays of Patterns / values
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"))silence
Does absolutely nothing..
silence // "~"
run
A discrete pattern of numbers from 0 to n-1
run(4).scale('C4 major').note()
// "0 1 2 3".scale('C4 major').note()After Pattern Constructors, letβs see what Time Modifiers are available.