diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:14:09 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | e997fc3e6b312b30f5af90012fc22365bab701d4 (patch) | |
| tree | 96c7fee23b50e6b303fd1cf641be5761e98ca09a /README.md | |
| parent | c68a8c9d9efa746e8eaef0392a327888577a05e0 (diff) | |
| download | sketchbook-e997fc3e6b312b30f5af90012fc22365bab701d4.tar.gz sketchbook-e997fc3e6b312b30f5af90012fc22365bab701d4.zip | |
scope: its kernels, pipelines and a camera for sketches, and note helpers
A sketch that analyses buffers of its own (micscope's tape of takes) had
to copy the scope's shaders to run them. scope.kernels.{waveform,
spectrogram, spectrum} and scope.pipelines.{wave, spectrogram, spectrum}
are now public, documented with what each reads and writes, beside the
parameter and view blocks already in scope.layouts; Scope.gpu.tape is
documented as the history on the GPU for a kernel of the sketch's.
Views.camera, when given, makes the rects world rects: the views are made
at their size there and drawn at camera.toScreen(rect), so moving or
zooming the camera recomputes nothing (micscope's world of panels).
scope.midi(freq, a4), scope.hz(note, a4) and scope.note_names, as
micscope's tuner and spheres' chords each spell them; place() names its
argument freq so hz can be the function.
Test: notes and frequencies convert both ways (A4 at 440 and 442, E2,
middle C, a round trip at 432) and name their pitch class. The README's
scope paragraph says all of it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -391,8 +391,17 @@ update does (`examples/noc`: `koch`, `lsystem`, `quadtree`). `draw`s the views given rects for: the last seconds as a scrolling waveform and spectrogram, the smoothed spectrum of the newest samples, and an oscilloscope. All analysed and drawn on the GPU, new columns only; its -shaders swap to WGSL for the web like any others. Lifted from micscope's -live view; spheres uses it. +shaders swap to WGSL for the web like any others. Given `.camera`, the +rects are world rects: the views are made at their size there and drawn +through the camera, so panning or zooming recomputes nothing. A sketch +that analyses buffers of its own runs the same shaders: +`scope.kernels.{waveform, spectrogram, spectrum}` over any read-only +buffer of samples, `scope.pipelines.{wave, spectrogram, spectrum}` to +draw them, with the parameter and view blocks in `scope.layouts` +(`Scope.gpu.tape` is a Scope's own history on the GPU, for a kernel of +the sketch's). `scope.midi(hz, a4)`, `scope.hz(note, a4)` and +`scope.note_names` name pitches. Lifted from micscope's live view; +spheres uses it. **Vector graphics**, in the `vector` module (import `sb.modules.vector`): SVG parsing (the static subset Typst emits, and more) into cubic Bézier |
