Skip to content

asak

asak is a tiny, focused audio recorder and player for the terminal. It opens on a mode-selector splashPlay / Rec / Settings — and each mode is a clean, single-purpose surface. Play is a file browser with waveform preview and a moving playhead; Rec shows a live monitor waveform while you record plus a take timeline; Settings is a device picker. It records WAV and plays back WAV/MP3/OGG. For a music terminal it is the reference for two things the sequencer-and-synth references don’t cover: the entry-point mode menu and the record-and-monitor workflow with waveform rendering.

  • Mode-selector splash: the app boots into a three-option menu — Play, Rec, Settings — and Esc always returns here. A clean, branded front door rather than dropping straight into a busy interface.
  • Play mode: a file browser rooted at the working directory, each file showing a waveform preview; selecting/playing draws a playhead moving across the waveform. Keys: arrows navigate, Enter open, Backspace parent dir, Space pause/resume, Esc stop.
  • Rec mode: type a filename, Enter to start recording, Enter again to stop. During capture it shows a live monitor waveform (real-time input level/shape) and an elapsed take timeline. On save it returns to the splash and refreshes the Play browser so the new take is immediately there. The filename editor supports Home/End and standard editing.
  • Settings mode: an interactive device picker list for choosing the input/output device.
  • Global: q quit, Esc back to splash. Runs in an alternate screen.

cpal abstracts the audio devices across macOS/Linux/Windows (JACK behind a feature flag). The app is a small mode state machine — Splash → {Play | Rec | Settings} — each mode owning its own view and key handling, with the audio engine (capture in Rec, playback in Play) behind the UI. The waveform is a downsampled amplitude envelope drawn as a row/region of block characters, with the playhead a marked column.

A music terminal isn’t only a sequencer — it captures and plays back audio too. asak supplies the patterns the other Batch-8 references don’t:

  • The mode-selector splash is the Toneline’s front door. A clean Sequencer / Record / Settings (or Compose / Record / Voices / Settings) splash on boot gives the Toneline a branded, legible entry point and a consistent Esc-to-home gesture — far better than dumping the operator into a dense sequencer cold. This also fits the Deckline’s existing chrome model: the splash is a Row 1–23 menu over the firmware status/action rows.
  • Waveform-with-playhead is a core Toneline rendering primitive. The Toneline records (its fiction adds a 3.5 mm line-out and a larger speaker for exactly this listening/capture use). Showing a recorded take or a sampled voice as a block-character waveform with a moving playhead column is the standard audio-editing visual, and asak is the minimal reference for it. This is distinct from cava.md’s spectrum (frequency bars): asak renders the time-domain waveform (amplitude over time). The Toneline wants both — spectrum for live monitoring, waveform for take review/editing.
  • The record-monitor-save loop is the Toneline’s sampling workflow. Live-monitor waveform during capture → take timeline → save → immediately available for playback/sequencing. For a Toneline that samples (a vocal phrase, an external instrument via line-in), this is the exact UX: arm, monitor the incoming level/shape, capture, and have the sample land in the phrase/voice library ready to drop into a sequence.
  • Device-picker list is the model for the Toneline’s audio-device/output selection on the desktop emulator (on-device the output is fixed: internal 40 mm speaker + line-out per kn90t-toneline.md).
  • cpal is the desktop-emulator audio-I/O reference. For the emulator build (capturing/playing real audio on macOS/Linux), cpal’s cross-platform device abstraction is the pattern; on the device the audio path is the YM2612/YM2149 + DAC chain, not a host audio API.

Deckline note: the mode-selector splash and the waveform-with-playhead widget are reusable Deckline primitives. Any Deckline app with distinct modes benefits from asak’s splash-plus-Esc-home convention, and the time-domain waveform widget is the natural companion to the CIPHER-LINE/PSG spectrum visualizer for any sound-handling surface.

asak is already effectively single-color — its information is the shape of the waveform and the position of the playhead, both of which are pure geometry:

  • Waveform renders as a centered band of block characters whose height tracks amplitude — ▁▂▃▄▅▆▇█ above and below a center line — exactly cava’s eighth-block density ramp (cava.md) applied to a time-domain envelope instead of a frequency spectrum. Pure amber-on-black, no hue.
  • Playhead is a single inverted/marked column sweeping across the waveform — position + inversion, the canonical single-color “where am I” cue.
  • The mode splash is three labeled options with the selected one inverted; the device picker and file browser are plain selectable lists. All single-color-clean already.

asak — mode splash, waveform preview with playhead, live record monitor

Source: GitHub social card for chaosprint/asak. Shows the recorder/player TUI with the waveform display and mode-selector interface.

  • Three takeaways: the mode-selector splash (Toneline front door), the time-domain waveform-with-playhead widget (distinct from and complementary to cava’s spectrum), and the record→monitor→save→ready loop (the sampling workflow).
  • Complements cava.md precisely: asak = time-domain waveform (amplitude vs time, for editing/review); cava = frequency-domain spectrum (bars vs frequency, for live monitoring). A complete Toneline audio UI uses both.
  • Cross-link upiano.md — upiano plays/synthesizes; asak records/samples. Together they cover the Toneline’s input side (play a note, capture a sound).
  • Cross-link line.md — captured samples become voices/phrases the line-style sequencer language can place; asak feeds the library line performs from.