From 9bd77e54943d954291b5faef287ccca5dcebd7a4 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:15:15 -0300 Subject: examples: micscope and spheres come home, as they were, building 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 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- examples/micscope/test/transport.script | 90 +++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 examples/micscope/test/transport.script (limited to 'examples/micscope/test/transport.script') diff --git a/examples/micscope/test/transport.script b/examples/micscope/test/transport.script new file mode 100644 index 0000000..f821a03 --- /dev/null +++ b/examples/micscope/test/transport.script @@ -0,0 +1,90 @@ +# Opens a file as a take and plays it both ways: a 2 s log sweep (40 Hz to +# 16 kHz) over a quiet 440 Hz tone. +console open test/sweep.wav +frames 2 +expect takes 1 +expect selected 0 +expect transport.value stopped +key right +expect transport.value forward +frames 30 +expect-audio 1 +screenshot .zig-cache/micscope/forward.png +key left +expect transport.value backward +expect backward true +frames 20 +key space +expect transport.value stopped +# Space resumes the way it last went. +key space +expect transport.value backward +key space +# Seeking: keys, and a click on the take's timeline. +key end +expect seek.value 1 +click 400 150 +expect seek.serial 2 +# Ctrl+wheel (or a pinch) on a take's timeline zooms its time around the +# pointer; Z zooms back out. +hold left_ctrl +wheel 400 150 3 +release left_ctrl +key z +key right +frames 30 +screenshot .zig-cache/micscope/played.png +# A second take goes under the first and is selected; up is older. +console open test/sweep.wav +expect takes 2 +expect selected 1 +key up +expect selected 0 +key down +expect selected 1 +# A click on the first take selects it. +click 400 150 +expect selected 0 +frames 2 +screenshot .zig-cache/micscope/two-takes.png +# Deleting it leaves the second. +key delete +expect takes 1 +expect selected 0 +# State that miscounts the takes is told by draw. +console set takes 0 +frames 2 +expect takes 1 +# More takes than fit: the camera follows the bottom until the wheel pans +# it, then 0 shows the whole strip. +console open test/sweep.wav +console open test/sweep.wav +console open test/sweep.wav +expect follow true +wheel 400 400 2 +expect follow false +frames 2 +screenshot .zig-cache/micscope/panned.png +key 0 +expect follow true +frames 2 +screenshot .zig-cache/micscope/overview.png +# Ctrl+wheel off the timelines zooms the view. +hold left_ctrl +wheel 1150 400 1 +release left_ctrl +frames 2 +screenshot .zig-cache/micscope/zoomed-view.png +# The buttons on top do what the keys do, for touch screens. +click 832 18 +expect transport.value recording +click 832 18 +expect transport.value stopped +click 890 18 +expect transport.value forward +click 890 18 +expect transport.value stopped +click 1238 18 +expect a4 441 +frames 2 +screenshot .zig-cache/micscope/buttons.png -- cgit v1.3