seq continues

This commit is contained in:
2026-01-19 16:44:17 +01:00
parent 2900f84b7d
commit ac9e64dcb7
18 changed files with 1568 additions and 361 deletions

58
seq/docs/keybindings.md Normal file
View File

@@ -0,0 +1,58 @@
# Keybindings
## Navigation
- **Ctrl+Left/Right**: Switch between pages (Main, Audio, Doc)
- **q**: Quit (with confirmation)
## Main Page - Sequencer Focus
- **Arrow keys**: Navigate steps in pattern
- **Enter**: Toggle step active/inactive
- **Tab**: Switch focus to editor
- **Space**: Play/pause
### Pattern Controls
- **< / >**: Decrease/increase pattern length
- **[ / ]**: Decrease/increase pattern speed
- **p**: Open pattern picker
- **b**: Open bank picker
### Slots
- **1-8**: Toggle slot on/off
- **g**: Queue current pattern to first free slot
- **G**: Queue removal of current pattern from its slot
### Files
- **s**: Save project
- **l**: Load project
- **Ctrl+C**: Copy step script
- **Ctrl+V**: Paste step script
### Tempo
- **+ / =**: Increase tempo
- **-**: Decrease tempo
## Main Page - Editor Focus
- **Tab / Esc**: Return to sequencer focus
- **Ctrl+E**: Compile current step script
## Audio Page
- **h**: Hush (stop all sounds gracefully)
- **p**: Panic (kill all sounds immediately)
- **r**: Reset peak voice counter
- **t**: Test sound (plays 440Hz sine)
- **Space**: Play/pause
## Doc Page
- **j / Down**: Next topic
- **k / Up**: Previous topic
- **PgDn**: Scroll content down
- **PgUp**: Scroll content up

115
seq/docs/scripting.md Normal file
View File

@@ -0,0 +1,115 @@
# Scripting
Steps are programmed using Rhai, a simple scripting language.
## Basic Syntax
Create sounds using `sound()` and chain parameters:
```
sound("kick").gain(0.8)
```
```
sound("hat").freq(8000).decay(0.1)
```
## Context Variables
These are available in every step script:
- `step`: Current step index (0-based)
- `beat`: Current beat position
- `bank`: Current bank index
- `pattern`: Current pattern index
- `tempo`: Current BPM
- `phase`: Phase within the bar (0.0 to 1.0)
- `slot`: Slot number playing this pattern
## Randomness
- `rand(min, max)`: Random float in range
- `rrand(min, max)`: Random integer in range (inclusive)
- `seed(n)`: Set random seed for reproducibility
## Variables
Store and retrieve values across steps:
- `set("name", value)`: Store a value
- `get("name")`: Retrieve a value
## Sound Parameters
### Core
- `sound(name)`: Create sound command
- `freq(hz)`: Frequency
- `note(midi)`: MIDI note number
- `gain(amp)`: Volume (0.0-1.0)
- `pan(pos)`: Stereo position (-1.0 to 1.0)
- `dur(secs)`: Duration
- `gate(secs)`: Gate time
### Envelope
- `attack(secs)`: Attack time
- `decay(secs)`: Decay time
- `sustain(level)`: Sustain level
- `release(secs)`: Release time
### Filter
- `lpf(hz)`: Lowpass frequency
- `lpq(q)`: Lowpass resonance
- `hpf(hz)`: Highpass frequency
- `bpf(hz)`: Bandpass frequency
### Effects
- `delay(mix)`: Delay amount
- `delaytime(secs)`: Delay time
- `delayfeedback(amt)`: Delay feedback
- `verb(mix)`: Reverb amount
- `verbdecay(secs)`: Reverb decay
### Modulation
- `vib(hz)`: Vibrato rate
- `vibmod(amt)`: Vibrato depth
- `fm(hz)`: FM modulator frequency
- `fmh(ratio)`: FM harmonic ratio
### Sample Playback
- `speed(ratio)`: Playback speed
- `begin(pos)`: Start position (0.0-1.0)
- `end(pos)`: End position (0.0-1.0)
## Examples
Conditional based on step:
```
if step % 4 == 0 {
sound("kick").gain(1.0)
} else {
sound("hat").gain(0.5)
}
```
Random variation:
```
sound("synth")
.freq(rand(200.0, 800.0))
.gain(rand(0.3, 0.7))
```
Using variables:
```
let n = get("counter");
set("counter", n + 1);
sound("beep").note(60 + (n % 12))
```

72
seq/docs/sequencer.md Normal file
View File

@@ -0,0 +1,72 @@
# Sequencer
## Structure
The sequencer is organized into:
- **Banks**: 16 banks (B01-B16)
- **Patterns**: 16 patterns per bank (P01-P16)
- **Steps**: Up to 32 steps per pattern
- **Slots**: 8 concurrent playback slots
## Patterns
Each pattern has:
- **Length**: Number of steps (1-32)
- **Speed**: Playback rate relative to tempo
- **Steps**: Each step can have a script
### Speed Settings
- 1/4: Quarter speed
- 1/2: Half speed
- 1x: Normal speed
- 2x: Double speed
- 4x: Quadruple speed
## Slots
Slots allow multiple patterns to play simultaneously.
- Press **1-8** to toggle a slot
- Slot changes are quantized to the next bar
- A "?" indicates a slot queued to start
- A "x" indicates a slot queued to stop
### Workflow
1. Edit a pattern in the main view
2. Press **g** to queue it to the first free slot
3. It starts playing at the next bar boundary
4. Press **G** to queue its removal
## Steps
Steps are the basic unit of the sequencer:
- Navigate with arrow keys
- Toggle active with Enter
- Each step can contain a Rhai script
### Active vs Inactive
- Active steps (highlighted) execute their script
- Inactive steps are skipped during playback
- Toggle with Enter key
## Playback
The sequencer uses Ableton Link for timing:
- Syncs with other Link-enabled apps
- Bar boundaries are used for slot changes
- Phase shows position within the current bar
## Files
Projects are saved as JSON files:
- **s**: Save with dialog
- **l**: Load with dialog
- File extension: `.buboseq`