← Все справочники · исходный .md · справочники написаны для агента, поэтому на английском
Sand and other granular flows
Sand, gravel, salt, rice, seeds, beads, hail, rubble, crumbs — and rain or debris landing on things — are the same sound: very many small impacts whose statistics you can hear. The ear does not follow grains; it reads their rate, their size distribution, how hard they land, and what they land on.
The model (GrainFlow, kernel name grains)
Grains arrive as a Poisson process. Each is a tiny force pulse — strength from size and fall speed, brightness from contact time (small grains → shorter contact → brighter). The pulses excite two paths:
- ring — the surface's modes (
SURFACES[name].modes, anobjectModesspec): sheet metal sings, wood knocks,
paper rattles, a drum skin booms; - direct — the dry tick radiated at the contact point, band-limited per surface (
hp,lp, optionalres).
| Parameter | Hears as | Typical values |
|---|---|---|
rate grains/s | density: separate ticks → patter → hiss → roar (level grows ~√rate) | trickle 50–500 · pour 2k–20k · dump/sandstorm 50k–400k |
size mm | brightness and weight of each grain | dust 0.05 · sand 0.1–1 · rice 3 · gravel 4–15 · pebbles 20+ |
sizeSpread | uniformity: sieved beads vs. mixed rubble | 0–0.2 uniform · 0.35 natural sand · 0.8 rubble |
height m | impact speed √(2gh): level and energy | hourglass 0.02 · hand pour 0.3 · from a truck 2 |
cover 0–1 | how buried the surface is: resonance damps, tone drifts to grain-on-grain | automate 0 → 1 over a pour |
clump 0–1 | unevenness of the stream | machine feed 0 · hand pour 0.3–0.6 · gusty/sandstorm 0.8 |
slide 0–1 | grains skittering after landing: continuous hiss | tilted or smooth hard surface ↑ |
spread 0–1 | stereo width of the landing zone | thin stream 0.1 · scatter 0.9 |
opts.surface — a SURFACES key or your own object; opts.grainRing: { f, t60 } gives the particles their own resonance (glass beads, hail, hollow pellets, coins).
Offline: pour({ surface, seconds, rate: [[t, v], …], cover: [[t, v], …], … }) — any parameter may be a constant or breakpoints. crunch({ surface, size, pressure, seconds }) — a collapsing burst: footsteps on gravel/sand/snow, a shovel bite, a handful dropped, a body in dirt.
What makes a pour convincing
- It evolves. A real pour starts as a thin stream on the bare surface (bright ticks, surface resonance
clearly audible), thickens (hiss takes over), buries the surface (cover↑: the ring dies, the tone darkens
into sand-on-sand), then thins to a trickle of single grains. Automaterateandcovertogether; a static
rate on a static surface sounds like a noise generator. - The surface is the identity. Same sand: on sheet metal it is a singing shimmer with a low roar; on glass
bright and brittle; on wood a soft knocking patter; on paper a rattle; on cloth almost nothing but a dull
breath; on a sand pile a soft, low "pff". Choose or design the surface first. - Graininess is a choice. Sparse big grains = countable ticks (kurtosis 30+); dense fine sand = smooth hiss
(kurtosis near 5–10 at pour rates, lower as it thickens). The brief decides: "a few grains still falling"
and "wall of sand" are opposite ends of one parameter. - Bounce and skitter. On hard smooth surfaces grains rebound and land again (the surface's
bounce), and
slide (slide): both blur the stream and add the dry "ssss" tail when the pour stops. - Height changes character, not only level. Higher fall = harder contacts and more rebound. A stream cut
off high up keeps arriving for √(2h/g) seconds — delay the stop of the rate curve accordingly.
Designing surfaces
A surface is { modes, ring, direct, hp, lp, res, bounce, tilt }. To build a new one:
- pick
modesas for any object (physics.md§2): thin sheets =platewith many modes and highdamping
(sheets are lossy); hollow things =tube/shellplus aresband-pass for the cavity; dead surfaces =null; - set the dry band: hard and dense →
hp2–3 kHz,lp12–18 kHz; soft →lp3–5 kHz; granular bed → 1–5 kHz; - balance
ringvsdirectand overall level by rendering 4 s at a fixed rate and reading LUFS (the built-in
table was calibrated so 3000 grains/s of 0.4 mm sand from 0.4 m lands between −17 LUFS on ringing metal and
−36 LUFS on cloth).tilt(dB/oct on mode amplitudes, default +3) keeps continuous excitation from being all
low roar.
Blend surfaces by running two kernels (sand reaching the edge of a tray and spilling onto the floor).
Variations on the theme
- Hourglass / thin steady stream:
rate200–1500,clump0,height0.02–0.1,surface: 'sand'or'glass'→ automatecoverquickly to 1. - Sandstorm on a tent / car / window:
rate50k–300k,size0.1–0.2,clump0.8,height2–5 (stands in
for wind speed), surfacedrumSkin/sheetMetal/glass; layer aWindkernel sharing the gust curve. - Gravel dumped:
size6–15,sizeSpread0.6,raterising to 300–2000,woodBox/sheetMetal(truck bed),
addboomor a low thud layer at the start. - Sand dune slide / avalanche hiss:
surface: 'sand',cover1,slide0.8–1, slowrateswell; optionally
a low sine "boom" (booming dunes hum near 70–110 Hz). - Rain on things: the
Rainkernel is aGrainFlowwith drop-sized grains plus a diffuse wash; itssurfaceoption accepts the same table (roof, leaves, water, tent). - Footsteps on granular ground:
crunchper step,pressurefrom walk/run,sizefor the material; vary
seed and pressure per step and alternate two slightly different sizes for left/right. - Debris after an impact:
crunchwith largesize, widespread, delayed 30–200 ms after the hit.
Verifying
--lens texture:kurtosisandlocalCrestDbfor graininess;levelStdDbfor evenness.TIMEmap across a pour: the surface's bands (low/mid for sheets and wood) must fade ascoverrises while
presence/air persist — the picture of burying.- Compare surfaces with
compare.mjs --variety: distinct surfaces should sit > 8 dB apart; if two are close,
their design is not differentiated enough (the level difference alone does not count — it is normalized out). - Rate sanity: doubling
rateshould raise level by about 3 dB and lower kurtosis.