Feat: documentation, UI/UX

This commit is contained in:
2026-03-01 19:09:52 +01:00
parent ecb559e556
commit db44f9b98e
57 changed files with 1531 additions and 615 deletions

View File

@@ -1,6 +1,6 @@
# Editing a Step
Each step in Cagire contains a Forth script. When the sequencer reaches that step, it runs the script to produce sound. This is where you write your music. Press `Enter` when hovering over any step to open the code editor. The editor appears as a modal overlay with the step number in the title bar. If the step is a linked step (shown with an arrow like `→05`), pressing `Enter` navigates to the source step instead.
Each step in Cagire contains a Forth script. When the sequencer reaches that step, it runs the script to produce sound. This is where you write your music. Press `Enter` when hovering over any step to open the code editor. The editor appears as a modal overlay with the step number in the title bar. If the step is a mirrored step (shown with an arrow like `→05`), pressing `Enter` navigates to the source step instead.
## Writing Scripts
@@ -18,7 +18,7 @@ Add parameters before words to modify them:
c4 note 0.75 decay sine sound .
```
Writing long lines is not recommended because it can become quite unmanageable. Instead, break them into multiple lines for clarity:
Writing long lines can become tedious. Instead, break your code into multiple lines for clarity:
```forth
;; the same sound on multiple lines
@@ -29,6 +29,12 @@ sine sound
.
```
Forth has no special rule about what a line should look like and space has no meaning.
## Adding comments to your code
You can comment a line using `;;`. This is not very common for people that are used to Forth. There are no multiline comments.
## Saving
- `Esc` — Save, compile, and close the editor.
@@ -64,27 +70,6 @@ Press `Ctrl+F` to open the search bar. Type your query, then navigate matches:
- `Enter` — Confirm and close search.
- `Esc` — Cancel search.
## Debugging
## Script preview
Press `Ctrl+S` to toggle the stack display. This shows the stack state evaluated up to the cursor line, useful for understanding how values flow through your script.
Press `Ctrl+R` to execute the script immediately as a one-shot, without waiting for the sequencer to reach the step. A green flash indicates success, red indicates an error.
## Keybindings
| Key | Action |
|-----|--------|
| `Esc` | Save and close |
| `Ctrl+E` | Evaluate (save + compile in place) |
| `Ctrl+R` | Execute script once |
| `Ctrl+S` | Toggle stack display |
| `Ctrl+B` | Open sample finder |
| `Ctrl+F` | Search |
| `Ctrl+N` | Next match / next suggestion |
| `Ctrl+P` | Previous match / previous suggestion |
| `Ctrl+A` | Select all |
| `Ctrl+C` | Copy |
| `Ctrl+X` | Cut |
| `Ctrl+V` | Paste |
| `Shift+Arrows` | Extend selection |
| `Tab` | Accept completion / sample |
Press `Ctrl+R` to execute the script immediately as a one-shot, without waiting for the sequencer to reach the step. A green flash indicates success, red indicates an error. This is super useful for sound design. It also works when hovering on a step with the editor closed.