/ proof-of-concept / steelsim21
Sign in
proof-of-concept / steelsim21
README: command-line renderer and gallery
Jeremy Magland <jmagland@flatironinstitute.org> committed commit d54e806ea19f parent 15284b8 Browse files
1 changed file+15−0
README.mdmodified+15−0View file
@@ -25,6 +25,19 @@ Press Start. With the default excitation the sheet is pushed at the bottom-right
2525
2626 The default grid spacing of 4 mm (about 8.9k nodes) resolves bending waves to about 20 kHz. With in-plane inertia the stable time step is set by the in-plane wave speed, about 0.65 microseconds, so four seconds of sound take about six million steps. This runs at roughly 35k steps per second on an Intel Iris Xe integrated GPU (about three minutes for four seconds) and considerably faster on a discrete GPU. A spacing of 6 mm is about three times faster and adequate below 10 kHz.
2727
28+## Command-line renderer and the parameter gallery
29+
30+`docs/gallery/index.html` is a generated page with audio clips, spectrograms, and summary numbers for sweeps of the main parameters (stick speed, mass, tip hardness, strike position, push amount and release, bow, thickness, size, material, damping). Open it directly or through the dev server at `/docs/gallery/index.html`; the "Open in simulator" links need the dev server.
31+
32+The clips are produced by the command-line renderer, which runs the same simulation code in a headless Chromium through Playwright (the `webgpu` Node bindings of Dawn are available as an experimental `--engine dawn`, but the prebuilt binary needs glibc 2.38 and was unstable in testing):
33+
34+ npm run build && npm run build:cli
35+ npx playwright install chromium # once, or pass --chrome /usr/bin/google-chrome
36+ node dist-cli/steelsim.js render --out out --name hit excitation=strike strikeVelocity=4
37+ node dist-cli/steelsim.js gallery docs/gallery/manifest.json spacing=0.004
38+
39+`render` writes a WAV (absolute level, `--gain` dB relative to 1 Pa), a spectrogram PNG, and a JSON summary. `gallery` renders every sweep of the manifest (skipping clips whose raw signal is already cached under `docs/gallery/raw/`), applies one playback gain per sweep so loudness differences within a sweep are preserved, and regenerates the page. Any `key=value` on the command line overrides that parameter for every clip.
40+
2841 ## Layout
2942
3043 - `src/params.ts`: physical and numerical parameters, derived quantities.
@@ -34,4 +47,6 @@ The default grid spacing of 4 mm (about 8.9k nodes) resolves bending waves to ab
3447 - `src/render/`: 2D and 3D WebGPU rendering of the displacement field.
3548 - `src/audio/`: FFT, spectrogram, WAV encoder, playback.
3649 - `src/main.ts`: user interface.
50+- `src/cli/`: command-line renderer (Chrome and Dawn engines, PNG and WAV writers, metrics, gallery generator).
51+- `docs/gallery/`: sweep manifest and the generated gallery.
3752 - `tests/`: symmetry, rigid modes, energy-gradient consistency, and free-plate frequencies against the Leissa reference values.
↑↓ move↵openescclose