Feat: lots of things, preparing for live gig

This commit is contained in:
2026-02-15 11:23:11 +01:00
parent cfaadd9d33
commit 160546d64d
59 changed files with 1414 additions and 96 deletions

View File

@@ -175,6 +175,20 @@ Classic Forth is deterministic. Cagire has built-in randomness:
These words take a quotation and execute it probabilistically.
## Periodic Execution
Execute a quotation on specific iterations:
```forth
{ "snare" s . } 4 every ;; every 4th pattern iteration
{ "hat" s . } 3 8 bjork ;; Euclidean: 3 hits across 8 step runs
{ "hat" s . } 5 8 pbjork ;; Euclidean: 5 hits across 8 pattern iterations
```
`every` checks the pattern iteration count. On iteration 0, 4, 8, 12... the quotation runs. On all other iterations it is skipped.
`bjork` and `pbjork` use Bjorklund's algorithm to distribute k hits as evenly as possible across n positions. `bjork` counts by step runs, `pbjork` counts by pattern iterations. Classic Euclidean rhythms: tresillo (3,8), cinquillo (5,8), son clave (5,16).
## Cycling
Cagire has built-in support for cycling through values. Push values onto the stack, then select one based on pattern state: