TUI: real colors, diff-patch rendering, centered grid resize, MIDI config

- Replace Bold/Dim attributes with explicit colors that survive light
  themes (Reverse instead of hardcoded black/white for cursor/selection).
- Only redraw cells that actually changed each frame instead of a full
  clear, and center the field within the live viewport.
- Add orca-c's ruler-snapped grid resize keys (( ) _ +) and its fancy
  ruler-frame corners, ported from tui_main.c.
- Add ~/.config/orca-rs/config.toml for a default MIDI port name.
This commit is contained in:
2026-07-23 23:52:22 +02:00
parent bf388576a3
commit e2e643cbc8
5 changed files with 323 additions and 54 deletions
+13 -2
View File
@@ -42,6 +42,15 @@ MIDI is on by default: orca-rs creates a virtual ALSA sequencer port named
`orca-rs`, which PipeWire exposes through its Midi-Bridge — connect it to a
synth with qpwgraph/Helvum, or find it under `wpctl status`.
A default MIDI port to connect to (instead of creating a virtual one) can be
set in `~/.config/orca-rs/config.toml`:
```toml
midi_name = "IAC Driver"
```
`--midi-name` on the command line overrides it.
There is also a headless runner, equivalent to orca-c's `cli`:
```sh
@@ -54,14 +63,15 @@ orca-cli -t 60 file.orca # simulate 60 ticks, print the grid
|---|---|
| Arrow keys | Move cursor (Alt+arrows: leap by 8) |
| Shift+arrows | Grow/shrink selection |
| Ctrl+arrows | Resize grid |
| Ctrl+arrows | Resize grid by 1 cell |
| `(` / `)` | Resize grid width, snapped to the nearest ruler division |
| `_` / `+` | Resize grid height, snapped to the nearest ruler division |
| `0-9 a-z A-Z ! : ; = # * . ?` | Place glyph (fills selection) |
| Backspace / Delete | Erase selection |
| Space | Play / pause |
| Ctrl+F | Step one frame (while paused) |
| Ctrl+R | Reset frame counter |
| `<` / `>` | BPM 1 / +1 |
| `(` / `)` | BPM 10 / +10 |
| Ctrl+Z or Ctrl+U | Undo |
| Ctrl+X / Ctrl+C / Ctrl+V | Cut / copy / paste selection |
| Ctrl+S | Save |
@@ -73,6 +83,7 @@ orca-cli -t 60 file.orca # simulate 60 ticks, print the grid
- `src/sim/` — the VM: all operators, ported from orca-c's `sim.c`
- `src/tui.rs` — terminal UI (crossterm), counterpart of `tui_main.c`
- `src/io.rs` — UDP / OSC / MIDI event output
- `src/config.rs``~/.config/orca-rs/config.toml` (default MIDI port)
- `src/bin/orca-cli.rs` — headless runner, counterpart of `cli_main.c`
## Releasing