The source code

The source code consists of several distinct modules, all of which are freely available on github: https://github.com/aothms/ear.

EAR: Evaluation of Acoustics using Ray-tracing (C++)

EAR.cpp defines the main entry point of the application. It makes sure the Scene is initialized, the .EAR file is read and the Settings are parsed. Threads are spawned to generate the impulse responses and process the convolution of the render results. As a last step all convoluted sound files are collected and merged into a single output file. The Scene class provides the Ray-tracing logic to spawn rays and reflect them onto the geometry in the Mesh class. The MonoRecorder and StereoRecorder inherit from the abstract Recorder class that provides the logic to store traced samples in a buffer of floating point numbers. The SoundFile class provides access to the samples in the input .wav files.

The code requires gmtl (Graphics Math Template Library from the Generic Graphics Toolkit, http://ggt.sourceforge.net/) and boost (the threading module, http://www.boost.org/doc/libs/1_49_0/doc/html/thread.html). Other code libraries are included in the repository.

The Blender add-on (Python)

The main module (__init__.py) defines the Blender panels and operators that make the user interface of the addon. It also contains the logic required to serialize the auditory data in the scene to the .EAR file format. Other modules define additional functionality that is incorporated in the addon. The material definitions file (materials.py) defines a text based list of material properties that are loaded as example presets in the Blender materials panel. The sines module (sines.py) provides functionality to generate a complex of sine waves and write them to a .wav file. The storyboard module (storyboard.py) maps the animated location of a Blender object to a storyboard of sonic events.