PLAY is monophonic: one queue, one clock, one instrument per batch #20

Open
opened 2026-08-02 19:04:26 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md §4 (at 9151438)

A correction to an earlier claim, worth keeping: an earlier version of this entry said there
was no noise waveform, and that was wrong -- ENVELOPE's sixth argument selects triangle,
sawtooth, square or noise (src/runtime_audio.c), which Chapter 7 does not document and
should.

The real gap is in akbasic_play_service() (src/play.c): every voice's notes go into one
queue with one release clock, and the envelope applied when a note sounds is whatever the last T
parsed selected -- so a program that writes three V tracks gets them end to end, on one
instrument
, and M is a no-op precisely because there is nothing to synchronise.

The backend already has three independent voices and tone() takes a voice number. What is
wanted is a queue head and clock per voice, and the envelope resolved at parse time into the note
rather than read from shared state at release.

The demo works around it the way 1985 did on one channel: an interleaved kick-bass-arpeggio line,
which is authentic and should not be mandatory.

Files: src/play.c, src/runtime_audio.c, docs/07-sound.md


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md §4 (at 9151438) **A correction to an earlier claim, worth keeping:** an earlier version of this entry said there was no noise waveform, and that was wrong -- `ENVELOPE`'s sixth argument selects triangle, sawtooth, square or noise (`src/runtime_audio.c`), which **Chapter 7 does not document and should.** **The real gap is in `akbasic_play_service()` (`src/play.c`):** every voice's notes go into **one** queue with one release clock, and the envelope applied when a note sounds is whatever the last `T` *parsed* selected -- so a program that writes three `V` tracks gets them **end to end, on one instrument**, and `M` is a no-op precisely because there is nothing to synchronise. **The backend already has three independent voices and `tone()` takes a voice number.** What is wanted is a queue head and clock per voice, and the envelope resolved at parse time into the note rather than read from shared state at release. The demo works around it the way 1985 did on one channel: an interleaved kick-bass-arpeggio line, **which is authentic and should not be mandatory.** **Files:** `src/play.c`, `src/runtime_audio.c`, `docs/07-sound.md` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.2.0 milestone 2026-08-02 19:04:26 -04:00
tachikoma added the defectapi-gapblast-radius:mediumstatus::grooming labels 2026-08-02 19:04:26 -04:00
Sign in to join this conversation.