From 8e8110e357b22bbbc2d1e566f24d2e33e6ecb0fe Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 01:01:34 -0300 Subject: spheres: its sound streamed from the GPU's block, at the host's lead The synth block goes to the speakers with f.audioBuffer, made to keep in.lead queued; in_flight, discard and lead_seconds are gone, and a chord's jump is the stream's clear alone (nothing is on its way back to drop). The block is still read back, a frame later, for the scope. The sound is the same: with the block fixed at 800 samples a frame, the play script and a script that plays every chord key (seven jumps) push the same samples before and after, to the bit (849600 and 1164007 of them), the new one a frame sooner. A change leaves for the device in 19 to 27 ms on average (three one-minute runs on a loaded machine) instead of 96 (dummy driver, 60 Hz, SDL's 1024-sample pulls). The empty Store declaration the brief mentioned is not in this sketch (main.zig says "No Store"); nothing was touched there. Tests: zig build test, 75/75 steps, 3/3 tests (its play script now also expects the stream fed). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- examples/spheres/test/play.script | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/spheres/test') diff --git a/examples/spheres/test/play.script b/examples/spheres/test/play.script index 1b06372..8dbe978 100644 --- a/examples/spheres/test/play.script +++ b/examples/spheres/test/play.script @@ -1,6 +1,8 @@ # Plays each preset and synthesis mode headless; screenshots land in # .zig-cache/spheres/ for review. frames 120 +# The GPU's blocks reach the speakers' stream. +expect-audio 1 expect running true expect preset figure_eight screenshot .zig-cache/spheres/figure-eight.png -- cgit v1.3