Search guides and the APICtrl K
  1. API reference
  2. DSP

reflections.h

Early reflections from a room, by the image-source method.

#include <sonore/reflections.h>
On this page

Design notes

A reverb tail says how big a space is; the first few echoes say where the walls are, and a "room" reverb without them is a hall with the lights off. The FDN and the spring give the tail; this gives the echoes, from a room rather than from a table of taps somebody typed.

The method is Allen & Berkley's ("Image method for efficiently simulating small-room acoustics", JASA 1979): a rectangular room's walls are mirrors, so every reflection path is a straight line from an IMAGE of the source -- the source reflected across a wall, or across a wall and then another -- and the reflection arrives after the image's distance over the speed of sound, attenuated by 1/distance and by the walls' reflection coefficient once per bounce. Along each axis the images sit at i·L + s for even i and i·L + (L − s) for odd i, with |i| bounces; the three axes combine, and the order is the largest |i| + |j| + |k| kept. Two listening points an ear's width apart give the stereo pair, and the interaural delay of an off-axis source falls out of the geometry rather than being panned in.

Taps are read from one delay line by linear interpolation (they are static) and the walls' high-frequency loss is one lowpass on the output, which is an approximation of per-bounce filtering and is said to be.

Included by dsp.h.

Types 1

template <int MaxDelay = 16384, int MaxTaps = 256> class EarlyReflections

SIZE: MaxDelay floats plus the taps -- 64 KB at the default, enough for a 100 ms path at 96 kHz (order 2 in an 8 m room). A member, never a local.

↑↓ to move↵ to openEvery public name in the headers, and every guide