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

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

Physically-informed parametric sound: objects, contact, motion in space

Contents

  1. The model: exciter → resonator → space
  2. Objects: modes from shape, material, size
  3. Forces: strike, bounce, roll, scrape, stick–slip, break
  4. Driving sound from a physics engine (PhysicsSonifier)
  5. Space: distance, Doppler, binaural cues, occlusion, rooms
  6. Hacks that work better than physics
  7. Verifying

1. The model

Every contact sound is a force signal driving a set of resonances, heard through a space. Keep the three separate and each becomes a parameter set you can map to a game/physics variable:

force (what touched it, how hard, how fast)  →  modes (what it is)  →  spatialize / reverb (where it is)
strikeForce / rollForce / scrapeForce / stickSlipForce      objectModes      spatialize, synthIR, SpatialSource

resonate(force, modes, n) runs any force through any object. strike(modes, opts) is the one-impact shortcut (adds the contact click and an optional low thud). strikes(modes, events) renders a list of impacts.

2. Objects

objectModes({ shape, material, f0 | size, count, hit, damping, split, spread, aspect, seed }) → [{ f, t60, amp }]

morphModes(modes, { pitch, damping, tiltDbOct, jitter, seed }) transforms a set (size change, material change, per-hit variation). Mode amplitudes are energy-normalized, so objects with 4 or 40 modes are comparably loud.

3. Forces

Strike — strikeForce(sr, { hardness, velocity, mass }). Contact time shrinks with hardness and (weakly) velocity; a shorter pulse contains higher frequencies. Consequence: the same object is brighter when hit harder or with something harder — the main cue of impact strength, obtained for free. If a soft hit does not ring, the contact is longer than the mode's period: raise hardness or lower f0 (soft mallets only excite low modes). Velocity guide (m/s): 0.2 tap, 1.5 knock, 5 drop, 15 smash.

Bounce — bounceEvents({ height, restitution, irregular }) → [{ t, velocity }]. Intervals and velocities shrink by the restitution each time (0.3 clay, 0.6 wood, 0.85 steel on stone). The accelerating rhythm is the signature; irregular scatters it for non-spherical things (coin, bolt, bottle). Feed to strikes().

Roll — rollForce(n, sr, { speed, radius, roughness, wobble }). A surface profile read at the rolling speed (louder and brighter when faster) plus one bump per revolution (rate = speed / 2πr): that slow throb is what makes it read as rolling rather than as noise. Drive the surface's modes with it; the ball itself is nearly inaudible while rolling.

Scrape / slide — scrapeForce(n, sr, { speed, pressure, grain, roughness }). grain (metres between surface features) turns noise into a pitched rasp at speed/grain Hz: zipper, comb, file, tyre tread, guiro.

Stick–slip — stickSlipForce(n, sr, { rate, jitter, sharpness }). Pulses at rate: 3–40 Hz a creak you can count, 40–300 a groan, above that a squeak whose pitch is the rate. Slow rate with large pulses then a rush upward = a door; steady high rate = a brake squeal. Drive a damped plate (door panel) or a ringing one (metal gate, wine glass).

Break — shatter({ material, shape, f0, pieces, scatter, restitution, energy }). One hard strike of the whole object, then fragments with power-law sizes (few low, many high) that each fall and bounce.

Continuous forces are level-calibrated far below impacts (as in reality): a rolling ball sits ~20 dB under its own drop. Scale deliberately if the scene needs otherwise.

4. Driving sound from a physics engine

PhysicsSonifier is a kernel (realtime in a worklet, or offline) holding named bodies as modal banks:

const son = new sd.PhysicsSonifier(sr, { bodies: {
  ball:  { shape: 'shell', material: 'steel', size: 0.05, damping: 3 },
  floor: { shape: 'plate', material: 'hardwood', f0: 80, count: 36, damping: 2, gain: 0.6 } } });
son.impact({ a: 'ball', b: 'floor', velocity: 3.1, pan: -0.2 });          // collision callback
son.contact('id7', { a: 'ball', b: 'floor', type: 'roll', speed: 1.4, radius: 0.025 });  // each frame while touching
son.contactEnd('id7');

Mapping from engine data (Rapier, cannon-es, Matter, Box2D, PhysX):

Engine givesUse as
relative normal velocity at contact (or impulse / mass)impact.velocity — ignore contacts below ~0.05 m/s
tangential speed while in contact, rolling vs sliding (angular·radius ≈ linear → roll)contact.type, speed
normal force / weightcontact.force (scrape pressure)
contact point relative to the listener/camerapan here, or route to a SpatialSource
body material tagsbody material, shape, size; pair hardness defaults to the softer of the two

Both bodies of a pair receive the same force, so one mug sounds different on wood and on stone without authoring pairs. In the browser: kernelNode(ctx, 'physics', { bodies }) then node.call('impact', {...}). Rate-limit: merge impacts closer than ~5 ms on the same pair; cap active contacts. Beyond rigid bodies: GrainFlow (many small impacts, see sand.md), Stream/Fire/Wind kernels with a simulation value mapped to flow/size/speed, Engine with rpm/load.

5. Space

Offline: spatialize(buf, { path, listener, model, refDistance, rolloff, doppler, air, occlusion, room, roomDb }). Realtime/browser: SpatialSource (HRTF PannerNode + delay line + air filter) — same cues, native quality.

6. Hacks that work better than physics

7. Verifying