/ proof-of-concept / steelsim31
Sign in
proof-of-concept / steelsim31
steelsim31 / scripts / README-dataset.md
4.0 KBPreviewCodeBlameHistoryRaw

Dataset generation#

scripts/generate.ts renders many drumstick strikes headlessly and writes one WAV clip and one line of metadata per clip, for training and evaluating models that predict the sheet's material and dimensions from its sound. It serves dist/ (build first with npm run build) to a headless Chromium with WebGPU through Playwright and drives several pages in parallel: one simulation is bound by the latency of its GPU dispatches, so a large GPU has room for many.

node --experimental-strip-types scripts/generate.ts --out DIR --count N [--start I] [--workers W] [--seed S] [--duration D] [--spacing S] [--fps F]

Clip i is drawn from a generator seeded by (seed, i), so the dataset is reproducible and can be regenerated or extended in pieces; existing clips in DIR are skipped. scripts/show-samples.ts prints the drawn parameters of a range of clips without rendering them, and scripts/probe.ts runs one configuration (a URL query, or --seed S --index I for a dataset clip with optional overrides) and prints the status as it runs.

Output#

scripts/pull-dataset.sh copies the clips and the index from a remote machine into a local directory every couple of minutes.

Sampling (version 1)#

All draws are independent. The targets are log-uniform over about plus or minus 30 percent of the defaults: E in 120 to 220 GPa, rho in 6000 to 9500 kg/m^3, h in 0.6 to 1.1 mm, width in 9 to 16 in, height in 13 to 24 in. The nuisance variables are meant to make the model rely on what a real recording would also show: the initial shape is flat with probability 0.08 and otherwise a random feature list (bows, twist, dents, a crease, a smooth random field; see randomFeatures in shape.ts) with a height scale log-uniform in 0.5 to 5 mm, redrawn at half the scale while the largest slope exceeds 0.1; the strike point is uniform in 0.6 to 0.8 of the width and 0.25 to 0.45 of the height, the stick speed log-uniform in 2 to 4 m/s; sigma0 and sigma1 are the defaults times a log-uniform factor in 0.7 to 1.4; the listener is at 1 m with azimuth and elevation uniform in plus or minus 15 degrees. The grid spacing is fixed at 8 mm, the sheet is a rectangle, and the excitation is a single strike.

Two things to keep in mind when interpreting predictions. In the linear regime the sheet's motion depends on E and rho only through E / rho, and its frequencies scale as h sqrt(E / rho) / L^2; separating E from rho, or h from the size, must rely on the amplitude (through the stick's momentum exchange with the sheet's mass) and on the nonlinearity, both of which a real recording shows less reliably than the simulation. With a fixed grid spacing the grid dispersion at a given frequency depends on the bending wave constant, which is a simulator artifact a model could in principle exploit.

↑↓ move↵openescclose