summaryrefslogtreecommitdiff
path: root/examples/spheres/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 01:01:34 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit8e8110e357b22bbbc2d1e566f24d2e33e6ecb0fe (patch)
tree06d89aadd338b67adaa9de7c9bc05d7bfb09a25d /examples/spheres/README.md
parent562b503d5007e3afe1de426fc1175eadfbbb45c4 (diff)
downloadsketchbook-8e8110e357b22bbbc2d1e566f24d2e33e6ecb0fe.tar.gz
sketchbook-8e8110e357b22bbbc2d1e566f24d2e33e6ecb0fe.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'examples/spheres/README.md')
-rw-r--r--examples/spheres/README.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/spheres/README.md b/examples/spheres/README.md
index 3c65666..30023de 100644
--- a/examples/spheres/README.md
+++ b/examples/spheres/README.md
@@ -17,10 +17,12 @@ Everything moves on the GPU:
| `sprite.*`, `trail.*`, `fade.frag` | The sky: the cloud as layered dust on a long exposure, system 0's bodies as glows, and their trails as ribbons tapering with age. |
| `link.*` | The coupling: a ribbon from modulator to carrier, as bright as the coupling, with pulses flowing along it. |
-The sound reaches the speakers by a readback (`f.download`) about two
-frames later; the CPU only queues it, and hands it to sketchbook's `scope`
-module (the views micscope uses) for the oscilloscope, spectrum and
-spectrogram.
+The sound goes from the GPU's block straight to the speakers
+(`f.audioBuffer`): the host reads it back in the same frame and keeps the
+lead it measures queued (`in.lead`), so a change is heard in about two
+device pulls rather than 100 ms. A second readback (`f.download`), a frame
+later, hands it to sketchbook's `scope` module (the views micscope uses)
+for the oscilloscope, spectrum and spectrogram.
## From motion to sound