Write some amount of documentation

This commit is contained in:
2026-01-31 01:46:18 +01:00
parent e1c4987db5
commit 8cd0ec92c0
57 changed files with 2096 additions and 198 deletions

48
docs/emitting.md Normal file
View File

@@ -0,0 +1,48 @@
# Emitting Sounds
The core of Cagire is emitting sounds. Every step script builds up sound commands and emits them to the audio engine.
## The Sound Register
Before emitting, you must select a sound source using `sound` (or its alias `s`):
```forth
"kick" sound
"kick" s ( same thing, shorter )
```
This sets the current sound register. All subsequent parameter words modify this sound until you emit or clear it.
## Emitting
The `.` word emits the current sound:
```forth
"kick" s . ( emit one kick )
"kick" s . . . ( emit three kicks )
```
Use `.!` to emit multiple times:
```forth
"kick" s 4 .! ( emit four kicks )
```
## Clearing
The `clear` word resets the sound register and all parameters:
```forth
"kick" s 0.5 gain . clear "hat" s .
```
This is useful when you want to emit different sounds with independent parameters in the same step.
## Words
| Word | Stack | Description |
|------|-------|-------------|
| `sound` / `s` | (name --) | Set sound source |
| `.` | (--) | Emit current sound |
| `.!` | (n --) | Emit current sound n times |
| `clear` | (--) | Clear sound register and params |