Git Product home page Git Product logo

reuk / wayverb Goto Github PK

View Code? Open in Web Editor NEW
154.0 18.0 24.0 230.22 MB

This project is not under active development. Hybrid waveguide and raytracer for room acoustics on the GPU

License: GNU General Public License v2.0

CMake 0.07% C++ 42.98% Shell 0.02% C 19.81% Python 0.29% Max 0.03% Objective-C++ 1.81% MATLAB 0.01% Objective-C 0.37% Java 0.25% HTML 30.48% CSS 0.34% JavaScript 1.52% TeX 1.35% Makefile 0.01% Perl 0.65% Haskell 0.01%

wayverb's Introduction

Wayverb

Hybrid waveguide and ray-tracing room acoustic simulator with GPU acceleration.

Synopsis

This project contains a library for offline room-acoustics simulations, along with a graphical app which can be used to set-up and run these simulations. The app produces room impulse responses, which can be used with convolution reverbs to create realistic auralisations of virtual spaces. Simulated room impulse responses may be particularly useful for architects, sound-designers, and musicians.

There are several common methods for simulating room acoustics, which can largely be subdivided into two main categories:

  • Geometric methods are fast but inaccurate, especially at low frequencies.
  • Wave-modelling methods are much more accurate, but time-consuming to compute, especially at high frequencies.

As the strengths and weaknesses of the two methods balance one-another out, it makes sense to combine both methods, so that wave-modelling is used to simulate low-frequency output, and geometric methods are used to generate high-frequency content.

The approach of this library is to use:

  • image-source (a geometric method) for high-frequency early reflections,
  • stochastic ray-tracing (another geometric method) for high-frequency late reflections, and
  • rectilinear waveguide mesh (a wave-based method) for all low-frequency content.

Usage Notes

You'll need a 3D model of the space. This model must be solid and watertight, without holes or no-thickness planes. When the simulation is run, the waveguide mesh setup process will attempt to work out whether each node is inside or outside the space, and it will not be able to do so if the model does not have a well-defined inside and outside.

To ensure that your model is valid, you can:

  1. Open the model in Sketchup.
  2. Select-all and Edit > Make Group.
  3. Check the info window (Window > Entity Info).
  4. If this window displays a volume, it is correct.

If the model is not valid, you can debug it using the 'Solid Inspector' plugin.

These instructions are taken from the readme for ParallelFDTD, which uses a similar (but not idential) technique to Wayverb for setting up a waveguide mesh.

Wayverb interprets the units used in the model file as metres. Some exporters (like the Sketchup .dxf exporter) silently change the scale of the model during export. For best results, it is recommended to export to .obj wherever possible. The following dialog shows optimum settings for the Sketchup Object exporter.

Requirements

Running

To run the program you will need:

  • Mac OS 10.10 or newer
  • GPU with double-precision support

While this project might work on a mac with integrated graphics, ideally you should use a recent mac with a discrete graphics card. You could be waiting a long time otherwise!

This project has been developed and tested on Mac OS 10.11.6, on a Mac with an AMD GPU. It doesn't have any known bugs on this platform.

Some testing has been carried out on Mac OS 10.10, using an Nvidia GPU. On this platform there were reasonably consistent crashes within OpenCL framework code. These crashes are difficult to track down and have not been fixed, as the author has been unable to secure extended access to a machine with this Nvidia/10.10 configuration.

Some bugs are to be expected: if you find a bug, please file it using the issues tab on the Github repository.

Building

You will need:

  • Mac OS 10.10 or newer
  • Really recent Clang with C++14 support and experimental C++17 headers (development used Apple LLVM 8)
  • CMake

Open wayverb/Builds/MacOS/wayverb.xcodeproj and build from there. All dependencies should get downloaded and built automatically. The initial build will be really slow, due to downloading and compiling a lot of libraries. This is normal.

Unfortunately, some of the dependencies have their own dependencies. If building fails, you may also need to install the following:

  • autoconf
  • autogen
  • automake
  • libtool
  • pkg-config

If you have Homebrew installed, then you can grab everything you might need by running this command:

brew install cmake autoconf autogen automake libtool pkg-config

Project Structure

Important Folders

  • src: all the library code for the project. This is further subdivided:
    • core: generic utilities such as data structures, architectural patterns and DSP helpers
    • raytracer: components which relate specifically to geometric acoustics
    • waveguide: components which relate specifically to finite-difference time-domain (FDTD) air pressure simulation
    • combined: one way of combining the ray-tracer and waveguide components for broadband room acoustics simulations
    • audio_file: wrapper round libsndfile. If I ever switch the soundfile library from libsndfile (to something with a more flexible license) then this module is all that will have to change.
    • frequency_domain: wrapper around fftw. If I ever switch to some other library, this is the only code that will have to change. There are also a few utilities to do with analysis and filtering here.
    • hrtf: small utility for generating hrtf data files from audio inputs.
    • utilities: small self-contained utilities which aren't really tied to this project, but they have to live somewhere.
  • wayverb: a GUI app interface to the combined library written with JUCE
  • bin: a collection of small command-line programs primarily for testing outputs from the library components
  • docs_source: the source-code for the accompanying documentation. This gets built into the contents of...
  • docs: automatically-generated documentation, visible at the Wayverb site.

Other Folders

  • scripts: a 'scratchpad' folder for python and octave prototypes
  • demo: assets for testing purposes
  • config: these files configure the documentation generator. They used to configure the Travis CI process which automatically built and published the library documentation.

License

Please see the LICENSE file for details.

Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other libility, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

wayverb's People

Contributors

reuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wayverb's Issues

assimp 4.0.0 & HRTF cryptic runtime error

As reported in assimp/assimp#1141, there's a typo in the 3MF importer in version 3.1.1 that makes the build fail.
By updating the version tag from 3.1.1 to 4.0.0 assimp builds fine.

The build stops on the HRTF target with a runtime error I don't really understand:

Scanning dependencies of target write_hrtf
[ 39%] Building CXX object src/hrtf/cmd/CMakeFiles/write_hrtf.dir/main.cpp.o
[ 40%] Linking CXX executable write_hrtf
[ 40%] Built target write_hrtf
[ 40%] Generating hrtf_entries.h
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Unable to open directory.
/bin/sh: line 1: 94049 Abort trap: 6           ../hrtf/cmd/write_hrtf /Users/everdrone/projects/github/wayverb/src/core/data/IRC_1002_C > /Users/everdrone/projects/github/wayverb/build/src/core/hrtf_entries.h
make[2]: *** [src/core/hrtf_entries.h] Error 134
make[2]: *** Deleting file `src/core/hrtf_entries.h'
make[1]: *** [src/core/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2

I see it is trying to generate some hrtf table but I can't manage to compile successfully

clCreateBuffer error

Iā€™m running it on a MacBook Pro Retina 2014 with Mojave 14.6
Iā€™m trying to render a room and when I start the rendering I get this message.
How can it be fixed?
Thanks
702645C1-0F46-4A51-ADF5-3312E9BE7714

Waveguide parameters

I am not sure if I have understood the waveguide parameters. According to the online documentation the cutoff frequency is the limit between the waveguide low frequency simulation and the geometric simulation. What is the usable portion ? Is the portion of the IR which will be used to extract the results for the waveguide simulation ? By changing that parameter, I see that the 'effective sr' changes automatically. The smaller the usable portion becomes, the higher the effective sr becomes. Is this the sampling rate used for the extraction of the IR in wav form ? Could the developer or someone else help me ? I would highly appreciate it. Thanks

Can't build for Apple Silicon

The QuickTime framework is missing on newer macOS versions required to build for ARM64. Any chance of rebuilding for native Apple Silicon support?

Multiplatform?

How much effort would it take to build a Windows (or Linux if that's easier) release? I know JUCE is multiplatform by default, so that should help a bit. This software looks amazing, and I wish I could try it.

examples/audio_out.c patch does not apply

macOS Mojave (10.14.6) on a 2018 MBP

download the release from master, open xcode project and build. The error appears as "patch failed: examples/audio_out.c:427" then "examples/audio_out.c: patch does not apply" below the compilation message "performing patch step for 'samplerate_external'."

I've tried changing the line in the samplerate_external.dir/build.make file to include the suggestions for git to ignore whitespace, however it seems that the build.make file is reconstructed with each xcode build.
I've also tried applying the contents of the fix_carbon.patch file directly (it's the first patch under the samplerate_external heading in the build.make), and rebuilding to no avail.

Command line interface?

I need to simulate RIRs in batches given room configuration, and I was wondering if there is a way to write a script like a wrapper around your tool, or if anyone has done that before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.