К содержимому
sound·design галерея

← Все справочники · исходный .md · справочники написаны для агента, поэтому на английском

Sound design

You cannot hear. This skill replaces ears with a loop: state the intent → synthesize → measure → look → revise. It ships a zero-dependency JavaScript DSP library (lib/), analyzers (tools/), and references that explain what matters for each kind of sound. Everything runs with bun or node ≥ 18; nothing to install for the core.

SKILL=<this folder>
bun $SKILL/tools/analyze.mjs out/hit.wav --lens impact --png      # report + picture
bun $SKILL/tools/compare.mjs ref.wav out/hit.wav                    # how it differs from a reference / last version
bun $SKILL/tools/compare.mjs --variety out/var_*.wav                # are variations too similar / too different
bun $SKILL/tools/loopcheck.mjs out/bed.wav --png                    # does it loop

In scripts: import * as sd from '<skill>/lib/node.js' (everything + file IO) — in pages: lib/index.js and lib/webaudio/index.js. Start from templates/generate.mjs (offline) or templates/browser/index.html (realtime). references/api.md is the one-page map of every function.

The loop

  1. Intent first. Before any code write two or three sentences: what is the source, what happens to it, where,
    and what should the listener feel. Then translate only this brief's consequences into measurable
    expectations (--expect / sd.save(..., { expect })). "Hit lands on 2.00 s", "feels heavy → sub present for
    ≥ 0.8 s", "tiny object → modes above 1.5 kHz, decay < 0.4 s". Three to six lines. Leave everything the brief
    does not constrain unconstrained.
  2. Choose a route, preferably two. Most sounds can be reached by different mechanisms (modal strike vs.
    layered noise; kernel vs. granulated recording). For any asset that matters, sketch two routes with different
    mechanisms and let the measurements and pictures choose; this is the main protection against every asset
    sounding like the library's defaults.
  3. Render and read the report. sd.save() writes the WAV and prints the analysis. Read the TIME heat map
    (band × time) and the ENV line first — they show the gesture. Add the lens for the sound's family. Open the
    PNG when timing, layering or a suspected artifact needs eyes (--zoom t0,t1 for attacks and seams).
  4. Revise from evidence. Change the mechanism when the shape is wrong; change parameters when the shape is
    right but the amounts are off. If an expectation fails, also ask whether the expectation was right.
  5. Finish like a deliverable. Fix every item under DEFECTS (they are wrong for any brief), set loudness with
    sd.master() or sd.normalizeLoudness(), keep the seed and parameters next to the file (meta), and say
    plainly to the user that the result was verified by measurement, not by ear — offer the preview page or files
    so a human can listen.

Read references/workflow.md once per session: it explains how to turn adjectives into expectations and how to keep taste from collapsing into the analyzer's numbers.

Where to look

The task is…ReadMain entry points
Objects hitting, rolling, scraping, breaking; sound driven by a physics engine; Doppler, pass-bys, 3D placementreferences/physics.mdobjectModes strike strikes bounceEvents rollForce scrapeForce stickSlipForce shatter PhysicsSonifier spatialize
Sand, gravel, grain, rain-on-things, debris, crunchy footstepsreferences/sand.mdGrainFlow pour crunch SURFACES
Trailer / advert / cutscene SFX, anything "cinematic", urgency, sync to picturereferences/cinematic.mdimpact boom subDrop riser whoosh braam downer shimmer drone glitch cue master
Game asset sets, variations, using or extending recorded samples, free librariesreferences/game-assets.mdsampleModel resynth variations enhance granulate
Voices without TTS: babble, creature/robot talk, Animalese, wallareferences/speech.mdspeak voiceFx crowd VOICES
Ambience beds, loops, weather/city/nature/machines, moving through spacesreferences/ambience.mdWind Rain Fire Stream Sea Birds Insects Traffic Engine Machine Hum Air Clock RoomTone loopKernel makeLoop tailWrap renderScene AmbienceMixer
Which runtime: WAV file, AudioWorklet, native Web Audio graph, server renderreferences/deployment.mdrenderKernel kernelNode tract SpatialSource renderOffline
What a metric means, which lens, how to read the spectrogramreferences/analysis.mdtools/*.mjs analyze checkExpectations
Sources, books, other skills, papers behind the modelsreferences/prior-art.md—

Read only the reference for the family you are working in; they are independent.

Three ways to ship a sound

ModeWhat it isChoose when
BakedRender to WAV (renderKernel, offline functions, renderScene), optionally with N variationsLinear media, engines with their own audio pipeline (Unity/Unreal/Godot/FMOD/Wwise), heavy one-shots
KernelA parametric generator class running in an AudioWorklet (and identically offline)The sound must respond continuously: physics, weather intensity, engine RPM, sand flow, endless non-repeating beds
GraphNative Web Audio nodes: baked or kernel sources into tract() effects, SpatialSource (HRTF + Doppler), AmbienceMixer zonesPlacement, rooms, mixing and interaction in the browser; same graph renders on a server for tests

They combine: bake the expensive layer, keep the responsive layer as a kernel, place both with the graph. Details and trade-offs: references/deployment.md.

Keeping sounds from converging

The library and the analyzers both pull toward an average. Push back deliberately:

Things that are always wrong

Clipping; inter-sample peaks above −1 dBTP on delivery; DC offset; a click at the first/last sample; a tail cut while audible; NaNs (reported loudly by writeWav); a "loop" that fails loopcheck; stereo that vanishes in mono (mono-sum loss below about −3 dB) when the target may play mono; sub-bass panned off-centre. The analyzer lists these under DEFECTS; none of them is a matter of taste.

Layout

lib/core      rng, buffers, noise, oscillators/envelopes, filters, FFT, effects, reverb, WAV, Kernel base
lib/synth     modal (objects & contact), particles (grain flows), nature, mech, voice
lib/gen       cinematic building blocks, cue(), master()
lib/scene     spatialize (Doppler/3D, offline), scenes with zones, loop tools
lib/sample    sample → model → resynthesis, enhance, granulate
lib/analysis  loudness, measurements, report + lenses, compare/variety, PNG spectrogram
lib/webaudio  worklet host, kernelNode, tract, SpatialSource, AmbienceMixer, renderOffline
tools/        analyze · compare · loopcheck · build-worklet        dist/sd-worklet.js  single-file worklet bundle
templates/    generate.mjs (offline loop) · browser/index.html (realtime)