| Commit message (Collapse) | Author | Age |
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
objects
The Store's deletion with shared-page keyframes and the 64 MiB cap; f.audioBuffer and in.lead with spheres on them; the embedded-SVG image, Typst's root, part, and the manual example. No conflicts; zig build test: 179/179 steps, 140/140 tests; spheres 75/75, micscope 67/67.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
examples/manual.zig is a live scene with pauses, played by the stock
player: page 31 of the SDM's Vol. 2 (Typst's import of the PDF, every
glyph a shape) fades in on paper beside a title; the camera closes on
Figure 2-1, the instruction format, while the rest of the page greys
and its footnotes go; each field (Prefixes, Opcode, ModR/M, SIB,
Displacement, Immediate) is tinted and glows in turn; 83 C0 01, add
eax, 1, is written below; each byte flies into its field as the fields
it has none for fade; C0 morphs down the arrow into the ModR/M byte's
boxes as 11000000, which splits into 11, 000 and 000 over Mod, Reg and
R/M, each with what it says (direct, /0 ADD, EAX); and the camera goes
back to the page, filled in. Twelve steps, 18 s played straight.
The labels, the ModR/M boxes, the figure and its footnotes are parts of
the page, by rectangles in the page's units read off pdftotext -bbox
(points to units: (pt - 306) * 4/3, (pt - 396) * 4/3) and checked with
the guides; each tint is the s.rect of its label's rectangle. The bits
are parts of a Typst object, cut by character (0.6 em of DejaVu Sans
Mono at 14 pt).
The PDF is never committed. build.zig's -Dmanual names it, by default
~/01-resources/intel-devref-ii.pdf; when the file is not there the
scene is one line saying how to build with it. zig build manual plays
it in a window. test/manual.script, run by zig build test (and
test-manual) only when the file is there, steps through the talk with
pixel checks (the paper, a tint where it should be and not where it
should not, a step back) and exports it twice at 10 fps, the same
frames both times.
zig build bench also times the manual's page (its one #image source,
when the build has the PDF), with a budget of its own for a drawing of
over 1000 shapes: parse under 25 ms, CPU draw under 10, GPU record under
4, at 1280x720. Measured: 6.4, 1.9 and 0.77 ms on a quiet run; 14.8, 3.5
and 1.4 at load average 34; once 28.6 ms to parse, at that load, which
failed it (the simple objects' 1 ms is as sensitive: 0.87 ms then). The
manual's simple objects are not benched: a two-glyph 83 fitted to the
whole canvas takes 1.1-1.2 ms on the CPU.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The manual described a mapped state file, a sessions database beside
it, a probe, private files for scripted runs and exits that compact
past 64 MiB. Now, in The host: "The save" replaces "State file" (one
thing, State, in one file, `<name>.xitdb`; the present restored and
replayed at start; keyframes as pages and what they cost, measured;
layout migration as before; an old `<name>.state` imported once and
left as it was); "Where files go" lists `<name>.xitdb` and the files a
sketch appends to, `--state x.state` and `x.xitdb` naming one save;
"Sessions" says every run is one, `record` decides how much history is
kept (a build that does not record keeps the present and the marks,
the last minute of input at most while it runs, none after), a crash
loses under a second and the next run starts from the last committed
frame; a new paragraph, "The cap": 64 MiB, State half, history dropped
oldest first and the file compacted to three quarters (about 170 ms in
Debug), the present, marks and clips never dropped, a new mark refused
with how to make room. The State row and "Data that grows" say 32 MiB;
the appendFile paragraph names `<stem>.<name>` beside the save; scripts
and exports save nothing; the Build API loses `probe`, `addProbe` and
`probe_exe`; Known limits gains the hash pass's cost. layout.zig's note
on what State may hold says where it is saved; micscope's README names
its takes `micscope.take-<id>.f32`.
Tests: zig build test, 168/168 steps.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Phase 1 left two loose ends in micscope's take files. A new take could
continue an old file when its id met one already written without a jump
in between (the jump is what moves next_id past written files), and a
deleted take's file stayed on disk.
The host gains one call beside appendFile: f.host.writeFile(name, bytes)
writes a new, empty file of that name, through the same vtable entry
with a `replace` flag. The old file is unlinked, so a readFile mapping
of it keeps its bytes, and the host's cached mapping is retired (kept
until exit, the sketch may hold it) so the next readFile maps the new
file. The web host writes nothing, as for appendFile.
micscope writes each take's file so when the take begins: on the
frame whose transport request is newly `recording`, live, and not a
jump (a jump's requests are restored State's, not a beginning; a fresh
Session counts old requests as handled, so a restart mid-recording
keeps its file), before the takes are read; `open` writes a file's
samples so too.
A deleted take's file stays: its State entry comes back with any seek
or mark from before the delete, marks are kept with no end, and an
exported session carries them; neither the sketch (which cannot see
the history) nor the host (which cannot read State's meaning) can tell
when none is left. So "never, safely": the file is kept.
Tests: zig build test, 164/166 steps, 132/132 tests (the appendFile
test now also replaces a file and reads back only the new bytes); the
one failure was the Typst bench's 1 ms bound (1.024 ms), timing code this
change does not touch, on a machine loaded by other builds; it passed in
the next full run (166/166, with the change above this one). micscope's zig build test, 67/67 steps,
10/10 tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The library could read a file and not write one, so micscope kept its
takes in the Store: a tape appended every frame while recording, which a
save of 64 MiB could not hold (under six minutes of 48 kHz audio, and
micscope allows ten-minute takes). Now a sketch has one call that
writes: f.host.appendFile(name, bytes) appends to `<state>.<name>`, beside
the state file (in .sketchbook/ under `zig build run`), creating it, and
returns the file's path for readFile, or "" when nothing was written. It
is pointer and length in, a C-callconv entry in the vtable like newSound.
Only draw and command have a host, so a write is not replayed, like
sound. The web host writes nothing and returns "". readFile still maps a
file once, so what is appended after is not in what it returned.
A scripted --fresh run works on `<state>.<pid>`; the files it appends to
are `<state>.<pid>.<name>`, and the exit now moves every file of the run
(found by that prefix in the state's directory) to the given name, or
removes them for an export, where it moved the state and its store by
two fixed suffixes.
micscope: State lists the takes (sk.List(Take, 64): id, source) and the
counter, next_id; `update` adds a take when recording starts and removes
one on delete. Each take's samples are `take-<id>.f32` (mono f32 at the
host's rate), appended to by draw as it records and by `open`, which also
puts them straight into Session (the web keeps no files). Session holds
the tape (every take's samples, read from their files once a process)
and a clip per take (start, len, and heard, the playhead, which a restart
no longer keeps); draw makes the tape follow State: a take State lost
leaves it, one it lacks is read from its file. A deleted take's file
stays, so a seek back finds it again; after a jump (start, seek, load,
set, reload) draw moves next_id past take files already written
(--fresh keeps them, and a seek back finds the future's) with a
`next-id N` command. Gone: the Store, the remove request, the `takes N`
command that told State the Store's count, adoptTape. Old
micscope.state.store files are not read: their takes stay in them.
README: appendFile among the host calls, a paragraph on it, and the
private run's appended files.
Tests: zig build test, 164/164 steps, 133/133 tests (one new: appendFile
appends beside the state and names the file). micscope's zig build test,
67/67 steps, 10/10 tests; transport.script reads `takes.len`, loses the
miscounted-takes check with its mechanism, and gains a deleted take read
back from its file after `load` and the counter moved past written files.
Pictures: the four scripts' 18 screenshots before and after, compared by
pixel: the differences are where two runs of one build differ by
themselves (playheads, the microphone's take lengths, the live view).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
micscope carried the code the scope module was lifted from: seven
shaders byte for byte, its layouts but for a comment, and a private live
view (Live, analyseLive, drawLive) that was Scope.push, scroll and
spectrum. Now the live view is ss.live, a scope.Scope, pushed the
microphone and drawn with the panel's world rects and the camera
(Views.camera), every frame, clipped away while a recording stands in
for it so its columns keep up as before; the tuner reads its history
from ss.live.gpu.tape. The take panels run scope.kernels and
scope.pipelines over the tape with scope.layouts' blocks, wavePass and
spectrogramPass inlined at their one use; maxFreq, min_freq and floor_db
are the scope's. src/layouts.zig keeps only the tuner's blocks, the
build compiles only the tuner's two shaders, and the tuner names notes
with scope.midi, scope.hz and scope.note_names. Takes, transport and
tuner are as they were. 1003 lines out, 91 in.
Tests: zig build test, 67/67 steps, 10/10 tests (the live history's own
test went with it; the scope module tests the same). Pictures: the four
scripts' 18 screenshots, captured before and after with the same
scripts and compared pixel by pixel (two runs before differ by
themselves wherever wall-clock playback or microphone timing shows: the
playheads, how far the live view has filled). The one difference not of
that kind is the live spectrum: micscope made every image at most 132
rows, so its 184-row spectrum was stretched from 132; the scope makes
it at its size, so the live spectrum's lines come out crisp (at most 86
in a channel, inside its rect). The take spectra keep micscope's 132.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both lived outside any repository, beside sketchbook, with manifests that
pointed at ../01-drat-meout/lib/sketchbook, which no longer exists. They
are copied into examples/micscope and examples/spheres (their sources,
shaders, tests, test material and web icons; not their caches, builds,
packages, state files or .gitignore, which the root's covers), their
manifests depend on "../.." as the other examples do, and their
READMEs link sketchbook there. Nothing else changed: both build against
today's library and pass their own zig build test (micscope 62/62 steps,
11/11 tests, its transport, record, render and tuner scripts; spheres
75/75 steps, 3/3 tests, its play script). The originals are untouched.
micscope's test/reference.flac (3.7 MiB, CC BY-SA 3.0, credited in its
test/README.md) is the rendering reference its render script opens. The
README lists both examples.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
| |
An Event says its key (abi.Event.key), which the player and the talk example each spelled out by hand; `zig build talk` shows examples/talk.zig in a window on the generic host, its state under .zig-cache, and `zig build talk-lib --watch` beside it reloads every edit in place.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
| |
|
|
| |
slides, a talk with a widget, export holds; the player's new keys
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
examples/talk.zig keeps an anim.Deck in its State beside its own data,
turns clicks and keys into asks and paints with an anim.Painter: two
slides, a mass that bobs (loop) while the deck waits, a damping slider laid
out and hit-tested in the talk (it takes its clicks), a choice gate that
branches on it, and slide 1 cleared beside slide 2's writing.
test/talk.script (zig build test-talk) steps it, finishes a step on a
click, goes back, jumps slides, drags the slider without advancing,
reloads mid-wait with the first step retimed (same step, t a second later)
and checks two exports with 2 s holds frame by frame. The vecanim live
scene's words follow the new pause.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The player's State is an anim.Deck plus the viewer's settings; keys and
clicks become an Ask: click, space and page down step (space plays or
pauses a scene with no pause), page up and backspace go back a step, ] and
[ go a slide, P plays or pauses, left/right/home/end/,/. seek through
Ask.to and Ask.end. A compiled scene is a talk without gates. The HUD
shows the slide and step, and when the talk waits. Exported, each pause
holds the scene file's hold (1 s). Its frozen hold (held, stopBetween,
proceed) is gone. Scripts read deck.t and deck.playing where they read t
and playing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and the Deck
A talk is a live scene re-run from the top every frame, a function of its
time and of the gates opened so far. Frame.gate(open) waits while time runs
on and records the value it opened with; pause() is the presenter's click.
beside and loop are the sub-animations, slide() the second navigation
level, clear() the end of a slide. anim.Deck is the playhead and the gate
log as plain data for any sketch's State: update() takes an Ask (next,
back, next_slide, back_slide, to, end) and runs the talk with the app
mutable, shot() runs it read-only for drawing. A click during a step
finishes it; back cuts to the picture held before the last click; an edit
that moves the last opened gate moves t with it; exported, every gate
holds Deck.hold. Live takes a namespace or a tuple of them (sources) and
exposes frame. Builder.pause, Instant.clock and Frame.clock are gone: t
runs through gates. A test-anim step runs the module's tests and the
player's scenes.
|
| | |
|
| |
|