@maruaudio/dsp/acoustics/shoebox-ism is the image-source model for a rectangular room, ported from pyroomacoustics' image_source_shoebox. It mirrors the source through the six walls up to a reflection order, walking the L1 ball in upstream's order (z, y, x), and records each image's position, per-axis reflection index, order, per-band attenuation and direction to each microphone. shoeboxIsmAmplitudes gives the amplitude at a microphone: attenuation over distance, optional air absorption, a cardioid-family pattern and a direct-path gain or mask.
Parameters
beginShoeboxIsm(state, roomSize, absorption, scattering, nBands, hybrid, source, mics, nMics, maxOrder) latches one room:
| Input | Accepts |
|---|---|
maxOrder | Clamped to 17 (7,175 images), reported in orderClamped; negative turns the model off |
nBands, nMics | Up to 9 bands; up to 2 microphones |
absorption, scattering | Energy coefficients per wall and band, walls west, east, south, north, floor, ceiling; not range-checked |
hybrid | With any scattering above 0, transmission is multiplied by √(1 − s) |
source | Must lie inside the room, 0 ≤ p ≤ L per axis |
It returns 0 or a status (bad bands, microphones, room or order, or source outside); on error the state holds no images.
Lifecycle
createShoeboxIsm allocates one state sized for the maxima → beginShoeboxIsm → shoeboxIsmStep(budget) until shoeboxIsmDone, or shoeboxIsmRun; shoeboxIsmSeek(index) moves the cursor → shoeboxIsmAmplitudes. Each image is a pure function of its cursor, so any chunking matches a one-shot run.
When to use it
The early reflections of a simulated rectangular room, a budget at a time.
Limits
- Rectangular rooms only; f64 where upstream is f32 (about 1e-6 relative at order 17). An outside microphone gets zero amplitude.