Skip to main content

Made with COMPAS

compas_acoustics

compas_acoustics simulates, analyses and auralises the acoustics of rooms modelled with COMPAS or in Rhino and Grasshopper. It computes impulse responses with the image source method and ray tracing (Mono), and with a hybrid engine of image sources, edge diffraction and a directional feedback delay network (Binaural, Ambisonics); it derives room acoustic parameters (ISO 3382) from them and convolves them with anechoic recordings to listen to a design.

Features

  • Simulation methods: Mono (image sources and ray tracing, with pyroomacoustics), Binaural and Ambisonics (a hybrid of image sources, edge diffraction and a directional feedback delay network), all through scene.simulate.
  • Analysis: reverberation times, clarity and definition, direct-to-reverberant ratio, lateral fraction, stage support, strength and STI from an impulse response (Analyser).
  • Auralisation: convolve mono, binaural or ambisonic responses with anechoic recordings (Auraliser), and play them (AudioPlayer).
  • Materials library: 95 absorbing and scattering materials in categories, searchable from Python and Grasshopper.
  • Grasshopper plugin: components for Rhino 8 on Windows and macOS that run every computation in a Python worker.

Installation

The installation guide has the details.

Python (3.9 or newer; the Binaural and Ambisonics methods need 3.11 or newer):

pip install compas_acoustics

Rhino 8 / Grasshopper (Windows and macOS): install compas_acoustics from Rhino's Package Manager and restart Rhino. Then place the Install Worker component (Util panel) in Grasshopper and press Install: it creates the worker, the Python 3.12 environment the components compute in.

For development:

git clone https://github.com/gramaziokohler/compas_acoustics.git
cd compas_acoustics
pip install -e ".[dev]"

Getting started

Every simulation method runs through scene.simulate:

import compas_acoustics as ca

scene = ca.Scene("room")
scene.add_acoustic_objects(ca.AcousticObjectsLibrary.shoebox_room(8, 6, 3, materials=ca.AcousticMaterial("wall", 0.2, 0.1)))
scene.add_source(ca.Source("talker", 2, 2, 1.6))
scene.add_receiver(ca.Receiver("listener", 6, 4, 1.2, direction=[-1, -0.5, 0]))

mono = scene.simulate(ca.Mono(ray_tracing=True))  # pyroomacoustics: image sources + ray tracing
binaural = scene.simulate(ca.Binaural())  # needs Python >= 3.11
ambisonics = scene.simulate(ca.Ambisonics(sh_order=1))  # ACN/SN3D, for a decoder elsewhere

speech = ca.Defaults().ANECHOIC_SOUNDFILES_LIBRARY_PATH + "/female_speech.wav"
signal = ca.Auraliser(list(binaural.values()), anechoic_sounds=[speech]).convolve()  # (samples, 2)

Auraliser convolves and keeps the format of its responses: mono, binaural, or ambisonic ACN/SN3D (AmbiX) to save as a multichannel file for an ambisonic decoder elsewhere. There is no ambisonic-to-binaural or stereo decoder: for headphones, simulate with Binaural.

examples/ has short scripts: simple_simulation_shoebox.py (a room from scratch), obj.py (a room from OBJ files), rays.py, scattered_rays.py and specular_reflections.py (ray and image-source paths for display).

Grasshopper plugin development

The plugin is src/compas_acoustics_ghcsharp/CompasAcoustics.sln: build it with invoke build-gha (or dotnet build), test it with dotnet test src/compas_acoustics_ghcsharp/CompasAcoustics.sln. Each component takes its names, descriptions, ports and icon from src/compas_acoustics_ghcsharp/CompasAcoustics.Grasshopper/Components/Specs/<CA_name>/. After a change to src/compas_acoustics/pb/protobuf_defs/.../acoustics.proto, run invoke generate (Python and C# bindings) and python tests/pb_fixtures/generate.py (the payloads the C# tests read).

Materials library

Materials are grouped in categories (MaterialCategory). To update the materials that come from pyroomacoustics, run:

python tools/import_backend_materials.py

Documentation

For further "getting started" instructions, a tutorial, examples, and an API reference, please check out the online documentation here: compas_acoustics docs: concepts, installation, a Python and a Grasshopper track with examples, a reference of every Grasshopper component, and the API reference.

License

The code is released under the MIT license. The package also ships data under its own licences, some stricter than MIT: the HRTF set of Binaural is CC BY-SA 3.0 (share-alike), and the two speech recordings are CC BY-NC 4.0 (no commercial use). The License and credits page lists every source and its licence.

Issue Tracker

If you find a bug or if you have a problem with running the code, please file an issue on the Issue Tracker.

Metadata

Release files for compas-acoustics 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compas-acoustics 0.2.0
File Size Uploaded Provenance Actions
compas_acoustics-0.2.0.tar.gz 10.5 MB With provenance Details for compas_acoustics-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for compas-acoustics 0.2.0
File Interpreter ABI Platform Actions
compas_acoustics-0.2.0-py3-none-any.whl Python 3 none any Details for compas_acoustics-0.2.0-py3-none-any.whl

Total release size: 20.9 MB

Release files / compas_acoustics-0.2.0.tar.gz

Download URL compas_acoustics-0.2.0.tar.gz
Size 10.5 MB
Tags Source
SHA-256 checksum
How to use checksums
ef00ccc3223d88be30de6623d337ba55c78c6e71efd33cf3d238c8df234e9e48
BLAKE2b-256 checksum
How to use checksums
341db4a27cfdcabf6e36a999db123ceef4ebb1370f02acab418729fc3e376703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / compas_acoustics-0.2.0-py3-none-any.whl

Download URL compas_acoustics-0.2.0-py3-none-any.whl
Size 10.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
81d8a0e0520a53cae8f945a08aed7a6ca85cba428421f1d681b3088bc329cc8f
BLAKE2b-256 checksum
How to use checksums
bf6e4b7c4590403eb7d626ce6cdcb854abcb1f9b32004157bcac4958773fbae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for compas-acoustics 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for compas_acoustics-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page