| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The option was read into every key (default 0.08) and never used. Now
animation i of a play of n starts i * lag * each after the play does,
each = seconds / (1 + lag * (n - 1)), so the last still ends with the play
and the play keeps its length: manim's AnimationGroup run to a run_time. A
lag of 1 is one after another. An object two animations of one play change
moves with the first (Change.at); the camera with the first camera
animation. Compiled and live scenes agree: a live play shows an animation
from its own key's start, as the compiled lookup does. Default 0, so every
key of a scene without .lag is the bits it was (start + 0, seconds / 1).
What changes: examples/manual.zig, slide 1: 83, C0, 01 and add eax, 1
were written all at once over 1.5 s, now one after another (0.79 s each,
0.24 s apart); the six labels and three bytes of the flight played
together, now in order, 0.12 s apart, 0.58 s each (exported frames 22.0-
23.4 s and 25.1-26.4 s). vecanim's intro passes .lag to a play of one
write: unchanged.
Tests: anim: a lagged play (four at 0.5, then two at 1) live against
compiled at 16 instants, and its times. test-anim, test-talk, test-manual
pass; the compiled scene's export (92 frames), the talk's two (364) and
every scene screenshot are byte-identical to before, but for the player
bar's wall-clock record time; manual's exports differ in those 29 frames
only, its screenshots not at all.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |\
| |
| |
| |
| |
| |
| | |
Verb tables, state as files, fs verbs in every sketch binary; with the opcode-table slide of examples/manual.zig. No conflicts; zig build test: 180/180 steps, 144/144 tests.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The manual example is a talk in two slides now: Figure 2-1 as before,
then, once it clears, page 132 of the SDM's Vol. 2 (ADD) fades in with
its opcode table taken out; the table is written back row by row (the
column rules drawn down, then each row with the rule above it); the
camera goes to 80 /0 ib ADD r/m8, imm8 as the rest greys; its opcode
cell is tinted; closer in, the 0 after the slash morphs into the 5 of
SUB's row from page 1400 while 80, / and ib hold still; then the rest of
the row follows (ADD into SUB, Add into Subtract, to into from, imm8 and
r/m8. sliding to their places) and the page around it becomes page
1400; at the end ADD's row comes back over SUB's, what differs is
marked, and a line says why (one opcode byte, the ModR/M reg field picks
the operation). Seven steps; the talk is 66 s exported.
The pages and rows are checked against the PDF (pdftotext): ADD is page
132, SUB page 1400, and the rows' word boxes and the page's own rule
shapes give the rectangles, in points, turned into the page's units by
one function. Page 1400 stands 20 units higher, so its row (182-197 pt)
lies on ADD's (167-182). The page draws a table's text row by row, left
to right, and its rules after all of its text, so a row part writes in
reading order. The column rules run the whole table, so their centres
all fall in one row (83 /0 ib, at 265 pt): a band a point high through
265 takes the seven of them first, and nothing else. Each row is cut in
the same eight pieces on both pages (the digit, the rest of the opcode,
the instruction, the three short columns, the description word by word)
and each piece morphs into its own: a morph pairs shapes by index, so
the whole row (44 shapes into 51) would send every glyph after Add
across the row.
test/manual.script goes on through slide 2 with pixel checks (the table
gone and back, the cell's tint, a step back to the exact picture before
the digit's morph, the marks at the end) and checks three more exported
frames of it, the same in both exports. The bench now times pages 132
and 1400 too (2118 and 2040 shapes: parse 10.0 and 10.3 ms, CPU draw
2.8, GPU record 1.2, in budget). The README's examples list and the
manual's paragraphs say so, and how a table's column rules are taken.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
"Local 9P controls" was a socket path, plan9port `9p` lines and a poll
of status for a screenshot. Now it says what a running sketch is: a
tree that describes itself (README, commands, made from the tables), how
it is found (posted as sketchbook/<name> by a run in a window, --9p NAME
or a socket path), `fs VERB PATH` in every executable and the generic
host, answering with the sketch closed from the save or the defaults;
a table of the files; how the State maps to files (rows of numbers one
file, arrays of arrays and of structs directories, drat-meout's notes as
the example; a value read as it was at the open); and an agent driving
drat-meout: start it, help, a console line, read state, await by reading
in a loop, a live click, one read for a screenshot, a refused write in
words, help of one file, quit, and a read with it closed. The ctl
paragraph says the 4096-byte write, errors as their names and what each
open pins; the trace examples use fs. The console bullet says help VERB
and set of an array. The Build API lists sb.modules.cloud9. --help's
--9p row and usage line say NAME|/SOCKET and fs.
Tests: the session in the manual was run against the drat-meout copy,
headless, posted under a scratch runtime directory.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | | | |
| | \ | |
| |\ \|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A paragraph on a PDF page as a Typst object: the absolute path Typst's
root / allows, and that the cache does not see the file change; text as
outlines; the order write follows; what a page costs, measured on
Figure 2-1's page (parse once 6-12 ms, 0.9-1.7 ms a frame to record for
the GPU, 0.4 ms on it, 2-5 ms on the CPU renderer), a table of contents
five times that, and the bench's page budget. One on part: the
rectangle (centre and size in the object's units, the literal s.rect
takes), how to pick it (the guides, or pdftotext -bbox and the points to
units sum), where the part stands and when it shows, the rest drawn by
the object, a shape to the first part, rules crossing fields, and
transformInto into the whole target so a morph can be split. One on
examples/manual.zig, -Dmanual and what happens without the PDF. The
examples list names it, and the objects list names part.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A compute shader's output was heard only after the sketch read it back
(f.download, a frame later) and pushed it behind a lead of its own
choosing; spheres kept 100 ms, and a change it made left for the device
96 ms later on average (measured, dummy driver, 60 Hz).
f.audioBuffer(key, buffer, .{ .count, .offset }) streams `count` f32 a
shader wrote: the host copies them back while it runs the frame's
commands, waiting on the copy's fence (Executor.read: 0.2 ms on average
here, 2 ms at the 99th percentile on a loaded machine), and queues them
on the stream, so nothing is in flight between frames and the sketch
keeps no books. Input.lead says how far ahead to make sound: the slowest
of the last 64 frames' worth of samples (timed between the ends of the
frames' commands, where the pushes are), plus the device's pull (what
SDL takes from a stream at once, read from the device: 1024 here), plus
half a pull for each underrun, a sample less each frame after; capped at
8192. A sketch pushes `in.lead -| in.stream(key).queued` a frame, and
its change leaves after about what is queued ahead of it, a pull: 19 to
27 ms on average with SDL's 1024-sample pulls, 6.3 to 6.5 ms with 256
(SDL_AUDIO_DEVICE_SAMPLE_FRAMES; 17 under heavy load). Stream.underruns
counts the pushes that found a stream empty though the frame before had
fed it (a gap).
The voices keep their 2048 samples: mixed to the lead, a one-shot longer
than it is mixed over several frames, and voices.script's expect-audio
and expect-no-audio, which look one frame at a time, failed.
On the web, audio.buffer reads the buffer back with mapAsync and queues
it on arrival, in order, counting it as queued meanwhile; in.lead stays
at 100 ms there.
The measurements (a probe patched into the host for the purpose, kept
out of the tree) are in the 02-pardes-code scratch, .scratch/sketch/gpusynth.
Tests: the lead's arithmetic (audio.zig, in test-audio's filter); spheres'
play script checks its stream is fed. zig build test: 164/164 steps,
49/49 tests run (the rest cached); zig build test-audio: 48/48 steps, with
the voices sketch's wasm, so web.zig compiles; voices.script passes four
runs in four. web/host.js: node --check only, no browser run.
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A sketch's data is State: flat bytes, what grows has its capacity in its
type. The Store, a heap in a file mapped at 0x2000_0000_0000 with 64 GiB
reserved, its power-of-two allocator, its root adopt and migration, and
its test, are gone from memory.zig; so are Context.store and store_root,
Info.store, Memory.store, the Store declaration's glue, Init.store,
Frame.store and Console.store, the web host's store in wasm memory, the
host's StoreFile wiring and `<state>.store` file, the `.store` suffix in
moving an old state into .sketchbook/, the build's tests' `rm` of it, and
layout.check's `pointers` flag (State is the one checked memory now).
Its one real user, micscope, moved off it in the change before. Old
`.state.store` files are not read, converted or deleted, and stay
ignored by .gitignore. A sketch that still declares a Store gets no
error for the declaration: nothing reads it, and a `*Store` parameter is
a compile error (no argument of that type).
layout.of(T, .state) refuses a State bigger than layout.max_state, 64 MiB,
one constant: "State is N bytes, and a save holds at most 64 MiB: lower
a capacity (an array, an sk.List), or keep what need not be saved in
Session." The pointer-hash gap the spec found (a Store pointer's
element type changing kept the old bytes) is gone with the only
persisted memory that held pointers.
README: no Store row, allocator row, migration paragraph, file bullet or
known limits; draw and command lose their store parameter; State's row
says 64 MiB at most; data that grows and is the user's work goes in a
List in State or, bigger than a save, in files the sketch appends to.
Tests: zig build test, 166/166 steps (the store's unit test gone; new: a
65-MiB State fails to compile with the message above, by expect_errors).
micscope, spheres, noc's e2e and drat-meout's test unchanged and green.
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
|
| |\
| |
| |
| |
| |
| |
| | |
The mixer's knee, newSound, sfxr, voice rate and groups, the scope's public pieces, micscope and spheres as examples; with the loader workaround for Zig 0.17.1's incremental linker and the panic-trace link. The README's hot-reload bullet takes the incremental loop's paragraph; zig build test: 164/164 steps, 132/132 tests.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`zig build lib --watch -fincremental --debounce 0` brings edit to frame
from 0.53 s to 43 ms on a small sketch and from about 1.2 s to 55 ms on
drat-meout (medians of 10 on a loaded machine; compile 7-10 ms instead of
0.3-1 s). The hot-reload paragraph says so, and what it costs on Zig
0.17.1: a new linker behind a host workaround, what to do if a reload runs
the wrong code, a larger library, resident compilers, and a multi-file save
that may build twice.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The sound section says what each part does: voices with their rate and
group and f.gain, when the host mixes them (once a frame, topping its
queue up to 2048 samples, about 43 ms, ahead of the device), streams
and the microphone, the mixer's curve, newSound and sfxr (from the
changes before this one), and that --export writes no sound.
Known limits said synthesised voices were silent on the web. Every voice
is: web.zig drops each .voice command (and now .gain), whatever its
sound; decodeSound gives .none; loadSound knows only files the page
decoded. It now says so, and what does sound there: streams and the
microphone.
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | | |
| | |
| | |
| | | |
slides, a talk with a widget, export holds; the player's new keys
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The host section said what the 7 snapshot slots, the 16 recordings and the
.inputs file did. It now says what the code does: the state file holds live
State only; where files go (.sketchbook/ under zig build run, the XDG data
directory for a shipped game, sketch.state for a script or an export); a
Sessions bullet (what is logged and keyframed, who records by
App.Options.record, memory for scripts, the commit cadence and what a crash
or a power loss loses, mend and the .broken last resort, measured sizes and
compaction, export-session and import, and what a playtest file holds of
the player); time travel over marks, clips and past sessions; the console,
and scripts' expect-snapshot NAME, expect-key and kill. The intro's table,
input.jumped, Data that grows, the test list, Build API's addRun and
.record, and the web's known limits follow. The hot-reload bullet and the
Animation section are other work's, untouched.
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
medium weight (.code_medium)
|
| |
|
|
| |
.code_italic), for programs
|
| |
|
|
| |
(f.textScaled), steady under a moving camera
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| | |
|
| |
|
|
| |
spectrum, spectrogram), audio codecs and fonts, web host
|
| |
|
|
|
|
|
| |
docs/regions-in-source.md: named regions that remember where they were
written (@src), an overlay to see and drag them, and a host-side patcher that
rewrites the literals with std.zig.Ast, so hot reload shows the edit. Also
scripts clicking regions by name. Not implemented yet.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
- 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 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.
|