jevstrudel.git / website / src / pages / learn / factories.mdx
factories.mdx68 lines · 1.4 KB · raw
1---
2title: Creating Patterns
3layout: ../../layouts/MainLayout.astro
4---
5
6import { MiniRepl } from '../../docs/MiniRepl';
7import { JsDoc } from '../../docs/JsDoc';
8
9# Creating Patterns
10
11The following functions will return a pattern.
12These are the equivalents used by the Mini Notation:
13
14| function                       | mini             |
15| ------------------------------ | ---------------- |
16| `cat(x, y)`                    | `"<x y>"`        |
17| `seq(x, y)`                    | `"x y"`          |
18| `stack(x, y)`                  | `"x,y"`          |
19| `stepcat([3,x],[2,y])`         | `"x@3 y@2"`      |
20| `polymeter([a, b, c], [x, y])` | `"{a b c, x y}"` |
21| `polymeterSteps(2, x, y, z)`   | `"{x y z}%2"`    |
22| `silence`                      | `"~"`            |
23
24## cat
25
26<JsDoc client:idle name="cat" h={0} />
27
28## seq
29
30<JsDoc client:idle name="seq" h={0} />
31
32## stack
33
34<JsDoc client:idle name="stack" h={0} />
35
36## stepcat
37
38<JsDoc client:idle name="stepcat" h={0} />
39
40## arrange
41
42<JsDoc client:idle name="arrange" h={0} />
43
44## polymeter
45
46<JsDoc client:idle name="polymeter" h={0} />
47
48## polymeterSteps
49
50<JsDoc client:idle name="polymeterSteps" h={0} />
51
52## silence
53
54<JsDoc client:idle name="silence" h={0} />
55
56## run
57
58<JsDoc client:idle name="run" h={0} />
59
60## binary
61
62<JsDoc client:idle name="binary" h={0} />
63
64## binaryN
65
66<JsDoc client:idle name="binaryN" h={0} />
67
68After Pattern Constructors, let's see what [Time Modifiers](/learn/time-modifiers) are available.