Acoustics
  • Rust 97.3%
  • Shell 2.6%
  • Makefile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-23 12:34:02 -04:00
.github/workflows chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
dist chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
docs chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
examples chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
lib chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
rust-old chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
scripts chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
src chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
tests chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
.gitignore chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
bench-history.csv chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
CHANGELOG.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
CLAUDE.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
CODE_OF_CONDUCT.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
CONTRIBUTING.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
COPYING chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
cyrius.cyml chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
cyrius.lock chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
LICENSE chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
README.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
SECURITY.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
UPSTREAM.md chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00
VERSION chore: import MacCracken snapshot 2026-08-23 12:34:02 -04:00

Goonj

Goonj (गूँज — Hindi/Urdu for "echo, resonance") — acoustics engine for the AGNOS ecosystem.

Goonj is a Cyrius library — the completed Rust → Cyrius port (v2.0.4) of the original ~14,630-line Rust engine (frozen at rust-old/ as a parity oracle). It is compiled by cycc (toolchain pinned cyrius = "6.5.35" in cyrius.cyml), built on hisab for math/geometry, and ships as a single distlib bundle, dist/goonj.cyr, for downstream Cyrius consumers.

37 modules covering sound propagation, room simulation, ray/beam/image-source tracing, wave-based methods (DWM, FDTD, GFPE), impulse-response generation, diffraction, resonance, and spatialization — 3,624 parity assertions across 37 test suites, all green (41 suites / 3,667 assertions counting the hardening, modal and smoke suites).

Features

  • Propagation — speed of sound, inverse-square law, ISO 9613-1 atmospheric absorption, Doppler shift, Snell-law atmospheric ray tracing, Miki ground reflection
  • Room & materials — shoebox geometry, walls, BVH acceleration; frequency-dependent absorption/scattering (7 presets), wall transmission loss, JCAL porous model, metamaterials
  • Geometric acoustics — ray tracing (single/multiband, BVH), image-source early reflections, radiosity, beam tracing, diffuse-rain late reverb, scattering
  • Wave-based — 3D Digital Waveguide Mesh (DWM), 2D FDTD modal solver, GFPE outdoor propagation, hybrid crossover
  • Impulse responses & metrics — Sabine/Eyring/Fitzroy/Kuttruff RT60, energy decay curves, room-acoustics metrics (C50/C80/D50/EDT/G/ts/LF/IACC/STI), FDN reverb, dark velvet noise
  • Diffraction & propagation models — UTD half-plane and Kouyoumjian-Pathak wedge diffraction, occlusion, UDFA, outdoor (ISO 9613-2), underwater, coupled rooms, portals, vibroacoustics
  • Spatialization & I/O — ambisonics (B-format + 3rd-order HOA), binaural HRTF, directivity patterns, 16-bit PCM WAV export
  • Integration APIs — dhvani (IR handoff), kiran (occlusion), soorat (visualization)
  • Diagnostics — real sakshi-backed logging with a verbose mode (logging_init_verbose)

Quick start

cyrius deps                                  # resolve hisab (+ transitive sakshi) into lib/
cyrius build examples/basic.cyr build/basic  # build the demo, then ./build/basic
cyrius build src/main.cyr build/goonj        # build the smoke binary
cyrius test                                  # run every suite (auto-discovers all 41)
cyrius test tests/propagation.tcyr           # or just one, by path
cyrius bench tests/dwm.bcyr                  # run a benchmark
cyrius distlib                               # regenerate dist/goonj.cyr (the shippable bundle)

examples/basic.cyr is the shortest end-to-end tour — speed of sound, a shoebox hall, RT60, Schroeder frequency, a room mode and a Doppler shift. It builds against the shipped bundle, so it doubles as a worked example of how a downstream consumer folds goonj in:

Speed of sound at 20 C      : 343.4 m/s
Hall volume                 : 7200.0 m3
Sabine RT60                 : 4.95 s
Schroeder frequency         : 52.0 Hz

Cyrius has a flat, f64 API (no use/methods). A room + RT60, for example:

var geom = room_geometry_shoebox(f64_from(10), f64_from(8), f64_from(3), acoustic_material_concrete());
var rt60 = sabine_rt60(room_geometry_volume_shoebox(geom), room_geometry_total_absorption(geom));
var c    = speed_of_sound(f64_from(20));   # ≈ 343.4 m/s at 20 °C

Dependency stack

goonj (Cyrius acoustics)
  ├── hisab (math/geometry — HVec3, geo, BVH; consumed as dist/hisab.cyr, tag 2.11.2)
  ├── sakshi (structured logging; pulled transitively via hisab, 2.4.11)
  └── Cyrius stdlib (math, ganita, vec, fnptr, bench, …)

No Rust dependencies — serde, thiserror, tracing, and criterion were all dropped in the port.

Consumers

dhvani (impulse responses for convolution reverb), shruti (room simulation for mixing), kiran/joshua (game audio propagation, occlusion), aethersafha (spatial audio for conferencing). None consume the Cyrius bundle yet — they await their own ports.

Documentation

License

GPL-3.0-only