Ray Tracing Room Acoustics — User Guide

A simplified 3D geometric room model that traces specular reflections, adds direct propagation and a deterministic diffuse tail, builds a synthetic impulse response, and convolves it with the source.

Author: Shai CohenAffiliation: Department of Music, Bar-Ilan University, IsraelVersion: 0.5.1 (2026)License: MIT LicenseRepo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

The script represents the room as a rectangular box with coordinates x = width, y = depth, z = height. Rays leave the source in approximately even directions using a Fibonacci-sphere distribution, reflect specularly from the six room boundaries, and contribute to the IR when a reflected segment passes within the listener capture radius. A direct path and a diffuse noise tail are added separately.

Model scope. This is a musically useful geometric approximation, not a full architectural-acoustics solver. All six boundaries share one absorption coefficient; scattering, diffraction, room modes, frequency-dependent wall materials, source directivity, and binaural propagation are not modeled.

Quick start

  1. Select exactly one Sound.
  2. Run Ray_Tracing_Room_Acoustics.praat.
  3. Choose one of eight room presets or Custom.
  4. For Custom, set room dimensions, source/listener coordinates, ray/reflection counts, absorption, propagation, tail, diffuse level, and wet/dry mix.
  5. Click OK. The result is named original_raytraced_PresetName.

Room presets

PresetDimensions W×D×HRaysMax refl.Wall αRequested tail
Small Living Room5×4×3 m150100.400.6 s
Large Concert Hall40×20×15 m300250.153.0 s
Bathroom (Bright)2.5×2×2.2 m250200.051.0 s
Recording Studio (Dead)6×5×4 m10050.700.3 s
Cathedral (Very Long)60×40×25 m400300.085.0 s
Small Club12×10×4 m200120.251.0 s
Outdoor (Minimal)100×100×50 m8030.950.2 s
Bright Chamber8×7×6 m250150.121.5 s

Presets also set listener radius, air absorption, diffuse level, and source/listener positions. Speed_of_sound, Wet/Dry, Draw and Play remain available from the form.

Parameters

ParameterDefaultMeaning
Room_width_m / height / depth8 / 6 / 5Rectangular room dimensions. Internally limited to at least 0.1 m.
Number_of_rays200Fibonacci-sphere rays launched from the source.
Max_reflections15Maximum wall intersections traced per ray.
Listener_radius_m0.5Capture radius around the listener; internally capped below half the smallest room dimension.
Wall_absorption0.15Energy absorption coefficient. Pressure reflection amplitude is sqrt(1-α).
Air_absorption0.001Exponential pressure loss per metre.
Speed_of_sound343Propagation speed used to convert path length to delay.
Reverb_tail_s1.5Additional IR time after the calculated RT60.
Diffuse_level0.15Amplitude scale of the seeded Gaussian diffuse tail.
Source_x/y/z2 / 3 / 1.5Source position, clipped inside the room.
Listener_x/y/z6 / 3 / 1.5Listener position, clipped inside the room.
Wet_dry_percent60Blend between padded dry source and convolved room response.

Geometric room model

The direct path uses Euclidean source-to-listener distance, delay distance / speed_of_sound, and pressure amplitude exp(-airAbs·distance)/(1+distance). For reflected paths, every ray is advanced to the nearest of the six walls, reflected specularly, and attenuated by air loss and the pressure reflection coefficient. Listener arrival is evaluated before the wall loss that terminates that segment, so a listener hit reflects the path actually travelled to the listener.

Only reflected segments after at least one completed wall reflection are eligible for reflection taps. A ray stops early when its accumulated pressure gain falls below 0.001.

Impulse response & RT60

A mono IR is created with duration direct delay + RT60 + requested tail. RT60 is estimated from a single average wall absorption using Sabine's formula:

RT60 = 0.161 × room volume / (wall absorption × total surface area)

The value is constrained to 0.05…5.0 s. The diffuse tail begins at the direct-arrival time and uses seeded Gaussian noise multiplied by exp(-6.9·t/RT60). Its internal seed is 20260814, after which the script restores Praat's normal unpredictable RNG. The IR is only attenuated if its peak exceeds 0.99.

Channels & output

The same mono room IR is convolved with the selected Sound. Praat applies the convolution across the source channels, so the original channel count is preserved. The dry copy is padded to the wet result length before Wet/Dry mixing.

The final result is attenuation-limited only when its peak exceeds 0.95; quiet material is not boosted. The output is longer than the source because the convolution includes the complete synthetic IR response.

Visualization

The visualization retains the CAD-style room views and shows: top view in X–Y (width × depth), side view in Y–Z (depth × height), cached ray paths, source and listener, the generated impulse response with direct-arrival and RT60 references, and a full original/result waveform overlay on a shared amplitude axis.