--- title: Pattern Factories description: Strudel Tutorial layout: ../../layouts/MainLayout.astro --- import { MiniRepl } from '../../docs/MiniRepl'; import { JsDoc } from '../../docs/JsDoc'; # Pattern Factories The following functions will return a pattern. Most of these are also used by the Mini Notation: | function | mini | | ------------------------------ | ---------------- | | `cat(x, y)` | `""` | | `seq(x, y)` | `"x y"` | | `stack(x, y)` | `"x,y"` | | `timeCat([3,x],[2,y])` | `"x@2 y@2"` | | `polymeter([a, b, c], [x, y])` | `"{a b c, x y}"` | | `polymeterSteps(2, x, y, z)` | `"{x y z}%2"` | ## cat You can also use cat as a chained function like this: ## seq Or as a chained function: ## stack As a chained function: ## timeCat ## polymeter ## polymeterSteps # Combining Patterns You can freely mix JS patterns, mini patterns and values! For example, this pattern: ...is equivalent to: ... as well as: ")`} /> While mini notation is almost always shorter, it only has a handful of modifiers: \* / ! @. When using JS patterns, there is a lot more you can do.