| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Voice.rate is the voice's playback speed and so its pitch: 2 is an octave
up and half as long, 0 holds it, and changing it does not restart the
voice. The mixer keeps a fractional cursor and resamples by linear
interpolation between a sample and the next (the last toward silence, or
the first when looping): the least code that sounds right, a little dull
far from 1; at rate 1 the samples come out exactly. An infinite or NaN
rate ends the voice instead of crashing the conversion.
Voice.group (0-7) puts a voice under a group's gain, which draw declares
each frame with f.gain(group, value) (Command.gain); a group not given
one plays at 1, so it is declared state and replays like the voices. The
mixer glides each group toward its gain by 1/480 a sample (10 ms for a
full swing), so a gain set in one step does not click. Music ducking
under speech is then the sketch lowering one number; nothing ducks by
itself. The web host ignores gains as it ignores voices.
Test: half and double speed against the interpolated samples, rate 0
holding, an infinite rate ending; a looping voice in group 1 at gain 0.5
gliding there and staying while group 0's is untouched, and going back to
1 when the gain is no longer declared. test-audio also builds the voices
sketch for the web, which compiles the web host's newSound and gain. The
README lists rate, group and f.gain with what they do.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
02-dont-rat-me-out's synth.zig, a pure and deterministic port of
DrPetter's sfxr, moves into the library as src/sketch/sfxr.zig, exposed as
sk.sfxr: render(params, rate, out) gives a coin, blip, laser or explosion
as samples for host.newSound. Its knobs count in samples at 44.1 kHz, so
the one change is the rate: every length (envelope, arpeggio, repeat,
phaser offset, period) grows by rate/44.1 kHz and every per-sample step
(slides, duty sweep, vibrato, filter coefficients and their ramps)
shrinks by it, to first order for the slides and filters; at 44.1 kHz
each factor is 1 and the samples are the original's to the bit. Two
spellings change without changing a sample: the phaser buffer is
@splat (Zig 0.17 has no ** on arrays) and the phaser delay is clamped
before it is converted, so a long sweep cannot overflow it.
Test: four parameter sets that between them turn every knob render the
lengths and Wyhash of the samples the original rendered at 44.1 kHz (run
once, outside the repo), and at 48 kHz a sound as long within 1 %.
test/voices.zig makes its blip with sfxr in draw, at in.sample_rate, and
is the README's example: a blip in six lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A sketch that synthesised a one-shot had to stream it (and keep a replay
from re-firing it by hand) or encode a WAV for decodeSound. host.newSound
(samples) copies mono samples at in.sample_rate into the host and gives an
Audio like a loaded one, so the one-shot is a voice: reconciled by key and
serial, mixed, faded and limited by the host. It is kept for the life of
the host like every sound, and .none if a sample is not finite. The
vtable entry is C callconv (pointer and length), as anything new in
abi.zig is, for a second host; the web host keeps the copy for samples()
(its voices are silent).
Tests: a unit test that the sound is a copy and that NaN and infinity are
refused; test/voices.zig makes a 1000-sample blip in setup and declares it
under a serial space bumps, and test/voices.script checks it sounds once,
stays silent through a recording of it played, stepped and seeked, and
sounds again for a new serial. For that, expect-audio KEY also passes
when voice KEY was mixed since it was last asked, and expect-no-audio KEY
says it was not. zig build test-audio runs the script too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
above it
Every mixed sample went through x/(1 + |x|), so one voice at 0.5 played
at 0.33, bent. The mix now passes through untouched up to 0.75 (-2.5
dBFS) and above it follows knee + (1 - knee)·u/(1 + u), u the excess over
the room left (the old curve is its knee-0 case): same value and slope
at the knee, rising, tending to 1. A clip normalised to full scale only
has its peaks bent (1 plays at 0.875); two at full scale sum to 0.958.
Per sample, no state, no lookahead, on the frame thread as before.
A unit test checks the curve: identity to the bit below the knee (every
997th float, both signs), rising and at most 1 from the knee to infinity
(every float near the knee), odd, slope 1 at the knee; `zig build
test-audio` runs the mixer's tests alone. The README says what the mixer
does, and that SDL clips the total of the voice mix and the streams.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |\
| |
| |
| |
| |
| |
| | |
Recording (sessions, marks, clips, the reload speed-ups under them) and anim's Deck with its example talk, together; no conflicts; zig build test: 161/161 steps, 127/127 tests.
Co-Authored-By: Claude Fable 5.2 <[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]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
render, paint, reveal, built, stage, guides and labels move verbatim from
player.zig into src/anim/Painter.zig, with the viewer's settings and the
Typst module as parameters, so a sketch that runs a Deck itself paints its
shot the same way: a Painter in its Session and paint() once a frame. The
scene's frame size is anim.width/height and a Shot carries its t. Pixels
unchanged: the scene tests' screenshots and all 92 exported frames match
the previous build's.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A scripted run from fresh state records in memory, and a very long one grew
without end. It stops at 256 MiB (ten hours or more of play at 60 Hz; a
write the memory database cannot make, out of memory included, is the
same): once, a warning, and no more frames, while what it holds still
reads (marks, clips, past sessions).
test-same plays test/past.script twice into two databases and compares them
value by value with test/same_sessions.zig, but for a session's started and
ended (the wall clock): every frame, keyframe, stretch and mark follows from
the script alone. A third run from fresh state leaves its state file and no
database.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A database whose last commit a power loss tore (its root header written,
its bytes not all) was refused and renamed aside, a new one begun. Now it
is opened at the last commit before the tear whose trailer verifies and
whose sessions read whole, scanned back from the end, as pardes's state
file is; renaming it to <path>.broken.<seconds> stays the last resort,
when no commit is whole, and nothing is deleted.
Every commit leaves the nodes it copied behind, about a kilobyte a second
of play: a clean exit compacts the file (into <path>.new, synced, renamed
over it) once it is 64 MiB and past twice what its batches and keyframes
hold plus 64 MiB.
Tests: a database of two sessions, cut at six places inside its last
commit, opens at the commit before with every frame of both; one with no
whole commit is kept aside byte for byte; a compacted one is smaller and
holds every frame and keyframe.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
export-session [S] FILE writes session S (this run's by default, committed
first), with the marks and clips that point into it, as session 0 of a new
database: written beside FILE, synced, renamed over it. import FILE appends
each session of such a file to this database, from "import <file name>",
its marks and clips renamed NAME@<file name> (cut to 32 bytes). The copy is
value by value, the same few lines for both, over whatever a session holds;
sessions lists where one came from.
test-import records test/past.script's session, exports it, imports it into
another database and replays it there: the mark it carries is the State
half a second in exactly, and two seconds in is frame 120's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
zig build run, probe and export pass --state .sketchbook/<name>.state. The
host makes that directory with a .gitignore of * (a sessions database
grows, and the jj snapshot build_info takes would commit it while under a
megabyte), and moves the state and store an older build kept beside it in
once, with renameat2(NOREPLACE): when both exist nothing moves and the
host says so. Without --state an interactive run keeps its files in
$XDG_DATA_HOME/<name>/ (~/.local/share without it), not the cwd; a script
or an export still uses sketch.state. test-paths checks all three cases.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
play session S [at SECONDS] restores the session's keyframe before that
time (a binary search over its keyframes' times), replays its frames up to
it and leaves it paused there; without a time it plays from the start. At
each later keyframe the replay reaches, the State is compared with it over
the leaves migration kept: a keyframe taken of what update made (periodic,
mark, before a reload, exit) that differs is reported once, "diverged
before frame F: N values, first <field>", and every keyframe is restored,
so a replay across a jump the log does not hold (set, load, a sketch
command) goes on from the State that followed it. A session built from
another source or build says so. The console's status line names the
session, frame and time, the mark, the clip and where it records.
test-past records a session, replays it by the same build (the mark's
State exactly, frame 120's two seconds in, no divergence), then by a build
with an edited fixture (one divergence, before the mark).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The state file keeps live state only (SKETCH03, one slot). save NAME is a
keyframe and a mark in the sessions database, synced to disk; load, diff,
snapshot and expect-snapshot take mark names, through the keyframe's own
layout migrated to today's, compared over the leaves migration kept. A
file from before (SKETCH01/02) has its used snapshot slots imported as
marks "1".."7" at open, then drops them; a run that records nothing
leaves them alone.
record NAME, stop and play NAME make and play clips: a frame range of a
session and its start keyframe, nothing overwritten, nothing invalidated
by a later save, no capacity. The 64 MiB .inputs file, its --fresh memset
and Timeline's Bank are gone; numbers still work as names, so every
existing script runs unchanged. Event times in a clip are the session's,
not restarted at record. reload.script also checks that a field a reload
drops is still in the keyframe taken before it (expect-key).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Live play was recorded only after someone typed record N, into 16 fixed
slots. Now every run is a session in one xitdb database per sketch, beside
its state file (<name>.xitdb): an append-only log of the frames live
update was fed, one commit a second of session time, and keyframes of the
State at start, every minute, on jumps, before and after reloads and at
exit. A kill -9 loses at most the uncommitted second (test-kill).
Whether a build records travels in the sketch: App.Options.record, null
meaning Debug, reaching the host as Info.record. Scripted runs from fresh
state record in memory, exports not at all. Each stretch of a session
keeps its build, layout and Info.source: the repository revision (one jj
or git call per build, build_info), zig version, backend and mode.
Sessions.zig takes plain data (bytes, events, strings, a path, an Io), so
a second host can drive it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A load copied the whole library to $XDG_RUNTIME_DIR (a read/write loop
across filesystems) and then hashed all of it for the build id: 40 ms for
a 10 MB Debug library, 200 ms for drat-meout's 58 MB. dlopen only needs a
fresh name, so the host links one to an fd open on the library, which also
pins the file a build may rename over meanwhile. The build id recordings
carry is a hash of the file's inode, size and modification time: Zig's own
linker writes no build-id note in Debug.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Each comptimePrint costs about a millisecond of comptime, and a sketch's
State, Session and Store reflection makes hundreds: drat-meout's library
spent about 0.4 s of its sema on them. Numbers are spelled by a small
decimal function instead; the signatures, leaf hashes and tag strings are
byte for byte the same, so state files keep their meaning.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The comptime walk over the shared types cost about half a second of every
sketch library's compile. abi_hash.zig runs it at build time, once per
change of the abi sources (watched like any input), and build.zig hands the
number to host and sketches as the module abi_hash; abi.hash folds in the
build as before. The value is the walk's own, computed for the build
machine in Debug.
|
| |/
|
|
|
|
|
|
| |
abi.hash now covers the zig version, codegen backend and optimize mode: Zig's
own calling convention (Host.VTable, every Allocator) differs between them,
so a Debug host loading a ReleaseFast or LLVM library faulted on its first
draw. Libraries export sketch_build, and the host's refusal says what
differs and what to run instead.
|
| |
|
|
|
|
|
|
|
|
| |
executor pardes shares
`f.postProcess(source, target, .{...})` records a fullscreen pass that samples a completed render into a distinct target image: colour at fragment binding 0 and, with `sample_depth`, depth at 1, which needs the source's latest pass to have depth and one sample (missing depth, multisampled depth and feedback loops are rejected). The scene format's version 4 carries it, the executor records it on the caller's command buffer and owns the sampler, the web host does the same with its texture and sampler pairs, and native profiling reports the work as `postprocess`. The README says how to use it.
docs/pardes-rendering.md describes the executor as pardes uses it for addon scenes: a borrowed SDL GPU device, `record` into the caller's command buffer, `run`, `output` and `postProcess`.
The working copy as it stood on 2026-11-16; message written by Claude from the diff, at the author's request.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Draw native GPU frames through the same bounded canvas used by headless capture. Backdrop commands reuse one snapshot and shader state, with an unchanged fallback on unsupported renderers. Verified through native debugger lenses, restart, and repeated font zoom checks.
|
| |
|
|
|
|
|
|
| |
canim keeps its table of places on the frame rather than in a process
global, so two players at once each have their own.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
|
| |
|
|
| |
medium weight (.code_medium)
|
| |
|
|
| |
.code_italic), for programs
|
| |
|
|
| |
(f.textScaled), steady under a moving camera
|
| | |
|
| | |
|
| |
|
|
| |
host.textSizeIn, sk.Face)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
with objects a scene draws itself
The player takes its canvas from the room it has and fits the scene's
frame into it, plays through and quits when exported, and draws vector
objects in runs around custom ones. The renderers' resvg comparison and
the timings come along as `zig build diff` and `zig build bench`; the
comparison's reference is padded to whole blocks rather than squeezed,
which had put Typst text over the limit.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
| |
|
|
|
|
| |
longer defragments (it lost a frame's first draws)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
| |
|
|
|
|
| |
a font from the environment
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
| |
|
|
| |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
| | |
|
| |
|
|
| |
spectrum, spectrogram), audio codecs and fonts, web host
|
| |
|
|
|
|
| |
await FIELD VALUE plays frames until a state field holds the value, for up
to a minute: for waits whose length is the sketch's business, such as a line
of dialogue typing out.
|
| |
|
|
|
|
| |
The renderer's draw blend mode was left at SDL's default, none, so every
translucent fill (panels, labels, HUD bars) drew opaque natively while the
web honored alpha. It blends now.
|
| |
|
|
|
|
|
|
|
|
|
| |
- input.started: true on the first update of a run, never after a reload,
for a sketch to stop what should not resume from saved state.
- A console line that errors fails its script. Sketch commands answer
unknown, done or failed (abi.Outcome) instead of a bool that hid errors.
- addScript also takes the hot-reloadable library, run through the generic
host, so scripts can reload a real build.
- Sounds that do not load are .none, not an empty clip.
- sk_tag reads an enum field's tag name from the web build, for tests.
|
| |
|
|
|
|
|
|
| |
The offscreen hints lost to the environment: with SDL_VIDEO_DRIVER=wayland
set, every headless test and script opened a real window. They are
overrides now. The offscreen driver has no Vulkan surface on every driver,
so a headless host's GPU renderer gets no window and draws into a
canvas-sized texture, which screenshots read.
|
|
|
The root is the game. The platform library moves to lib/sketchbook (with
serve_web.py, which serves any sketch's web build, as a tool of it), and
vecanim to sketches/vecanim, still its own package on the same library.
|