docs: improve time modifiers page

+ polymeter + euclidRot
+ rename Factories to Pattern Constructors
This commit is contained in:
Felix Roos 2023-01-09 20:39:00 +01:00
parent 9ca5f9ad48
commit 10ee11c886
6 changed files with 77 additions and 48 deletions

View file

@ -55,14 +55,14 @@ export const SIDEBAR: Sidebar = {
{ text: 'Synths', link: 'learn/synths' },
{ text: 'Audio Effects', link: 'learn/effects' },
],
Functions: [
'Pattern Functions': [
{ text: 'Introduction', link: 'functions/intro' },
{ text: 'Value Modifiers', link: 'functions/value-modifiers' },
{ text: 'Factories', link: 'learn/factories' },
{ text: 'Signals', link: 'learn/signals' },
{ text: 'Pattern Constructors', link: 'learn/factories' },
{ text: 'Time Modifiers', link: 'learn/time-modifiers' },
{ text: 'Value Modifiers', link: 'functions/value-modifiers' },
{ text: 'Signals', link: 'learn/signals' },
{ text: 'Conditional Modifiers', link: 'learn/conditional-modifiers' },
{ text: 'Tonal', link: 'learn/tonal' },
{ text: 'Tonal Modifiers', link: 'learn/tonal' },
],
More: [
{ text: 'Patterns', link: 'technical-manual/patterns' },

View file

@ -38,3 +38,36 @@ While the Mini Notation is a powerful way to write rhythms shortly, it also has
Here, we are using mini notation for the individual rhythms, while using the function `stack` to mix them.
While stack is also available as `,` in mini notation, we cannot use it here, because we have different types of sounds.
## Combining Patterns
You can freely mix JS patterns, mini patterns and values! For example, this pattern:
<MiniRepl
client:idle
tune={`cat(
stack(g3,b3,e4),
stack(a3,c3,e4),
stack(b3,d3,fs4),
stack(b3,e4,g4)
).note()`}
/>
...is equivalent to:
<MiniRepl
client:idle
tune={`cat(
"g3,b3,e4",
"a3,c3,e4",
"b3,d3,f#4",
"b3,e4,g4"
).note()`}
/>
... as well as:
<MiniRepl client:only="react" tune={`note("<[g3,b3,e4] [a3,c3,e4] [b3,d3,f#4] [b3,e4,g4]>")`} />
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.

View file

@ -1,5 +1,5 @@
---
title: Pattern Factories
title: Pattern Constructors
description: Strudel Tutorial
layout: ../../layouts/MainLayout.astro
---
@ -7,10 +7,10 @@ layout: ../../layouts/MainLayout.astro
import { MiniRepl } from '../../docs/MiniRepl';
import { JsDoc } from '../../docs/JsDoc';
# Pattern Factories
# Pattern Constructors
The following functions will return a pattern.
Most of these are also used by the Mini Notation:
These are the equivalents used by the Mini Notation:
| function | mini |
| ------------------------------ | ---------------- |
@ -56,36 +56,3 @@ As a chained function:
## polymeterSteps
<JsDoc client:idle name="polymeterSteps" h={0} />
# Combining Patterns
You can freely mix JS patterns, mini patterns and values! For example, this pattern:
<MiniRepl
client:idle
tune={`cat(
stack(g3,b3,e4),
stack(a3,c3,e4),
stack(b3,d3,fs4),
stack(b3,e4,g4)
).note()`}
/>
...is equivalent to:
<MiniRepl
client:idle
tune={`cat(
"g3,b3,e4",
"a3,c3,e4",
"b3,d3,f#4",
"b3,e4,g4"
).note()`}
/>
... as well as:
<MiniRepl client:only="react" tune={`note("<[g3,b3,e4] [a3,c3,e4] [b3,d3,f#4] [b3,e4,g4]>")`} />
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.

View file

@ -1,6 +1,5 @@
---
title: Pattern Factories
description: Strudel Tutorial
title: Time Modifiers
layout: ../../layouts/MainLayout.astro
---
@ -10,6 +9,14 @@ import { JsDoc } from '../../docs/JsDoc';
# Time Modifiers
The following functions modify a pattern temporal structure in some way.
Some of these have equivalent operators in the Mini Notation:
| function | mini |
| ---------------------- | ------------ |
| `"x".slow(2)` | `"x/2"` |
| `"x".fast(2)` | `"x*2"` |
| `"x".euclid(3,8)` | `"x(3,8)"` |
| `"x".euclidRot(3,8,1)` | `"x(3,8,1)"` |
## slow
@ -39,7 +46,11 @@ The following functions modify a pattern temporal structure in some way.
<JsDoc client:idle name="Pattern.euclid" h={0} />
## euclidLegato
### euclidRot
<JsDoc client:idle name="Pattern.euclidRot" h={0} />
### euclidLegato
<JsDoc client:idle name="Pattern.euclidLegato" h={0} />
@ -51,11 +62,11 @@ The following functions modify a pattern temporal structure in some way.
<JsDoc client:idle name="Pattern.iter" h={0} />
## iterBack
### iterBack
<JsDoc client:idle name="Pattern.iterBack" h={0} />
### chunk
## chunk
<JsDoc client:idle name="Pattern.chunk" h={0} />