# SpatGRIS SpatGRIS is a sound spatialization software that frees composers and sound designers from the constraints of real-world speaker setups. With the ControlGRIS plugin distributed with SpatGRIS, rich spatial trajectories can be composed directly in your DAW and reproduced in real-time on any speaker layout. It is fast, stable, cross-platform, easy to learn and works with the tools you already know. SpatGRIS supports any speaker setup, including 2D layouts like quad, 5.1 or octophonic rings, and 3D layouts like speaker domes, concert halls, theatres, etc. Projects can also be mixed down to stereo using a binaural head-related transfer function or simple stereo panning. It can handle up to 256 inputs and outputs simultaneously and features 3D and 2D views that help visualizing sources motions and monitor sound activity. SpatGRIS is currently being developed at the [Groupe de Recherche en Immersion Spatiale (GRIS)](https://gris.musique.umontreal.ca/) and the [Société des Arts Technologiques (SAT)](https://sat.qc.ca/en/). Updates are published on a regular basis. - [Using a virtual audio device](#using-a-virtual-audio-device) - [Building](#building) - [Running](#running) - [Using custom OSC interfaces](#using-custom-osc-interfaces) ## Using a virtual audio device If you want to use SpatGRIS and ControlGRIS on the same computer, you will need a virtual audio device that can route the audio from your DAW to SpatGRIS. #### MacOS We officially support the use of [BlackHole](https://github.com/ExistentialAudio/BlackHole). The 256-, 128-, 64-, 32- and 16-channel versions are distributed with SpatGRIS. #### Windows Because ASIO does not allow interfacing with two different audio devices simultaneously, the best working configuration is to use [JACK](https://jackaudio.org/) with [ASIO4ALL](https://asio4all.org/). If you are a [Reaper](https://www.reaper.fm/) user, ReaRoute may be a viable alternative. Note that sound has to be sent back to Reaper. #### Linux While we do not support a specific routing solution on Linux, there are a lot of different ways of creating loopback audio ports with either JACK, PipeWire, ALSA or PulseAudio. ## Building #### 1. Clone SpatGRIS sources and submodules ``` git clone git@github.com:GRIS-UdeM/SpatGRIS.git ``` For the submodules: ``` cd SpatGRIS git submodule update --init --recursive ``` #### 2. Build the [Spatial_Audio_Framework](https://github.com/leomccormack/Spatial_Audio_Framework) (SAF) libraries for the binaural stereo reduction ##### MacOS ```bash cd submodules/AlgoGRIS/build_scripts ./MacOS_build_Spatial_Audio_Framework_lib.sh ``` ##### Windows ```bash cd submodules/AlgoGRIS/build_scripts ./Win_build_Spatial_Audio_Framework_lib.sh ``` ##### Linux Install the `openblas` package, which provides the BLAS and LAPACK libraries, as well as `fftw`, appropriate for your distribution. Then : ```bash cd submodules/AlgoGRIS/build_scripts ./Linux_build_Spatial_Audio_Framework_lib.sh ``` #### 3. Build the Projucer JUCE is included as a submodule. Go to `SpatGRIS/submodules/AlgoGRIS/submodules/StructGRIS/submodules/JUCE/extras/Projucer/Builds/` and build the Projucer for your plateform. Ensure that the Projucer global paths are set correctly. JUCE path is `SpatGRIS/submodules/AlgoGRIS/submodules/StructGRIS/submodules/JUCE` and modules path is `SpatGRIS/submodules/AlgoGRIS/submodules/StructGRIS/submodules/JUCE/modules`. ##### Additional dependencies on Linux : From the [JUCE github website](https://github.com/juce-framework/JUCE/blob/develop/docs/Linux%20Dependencies.md) : ```bash sudo apt install libasound2-dev libjack-jackd2-dev \ ladspa-sdk \ libcurl4-openssl-dev \ libfreetype6-dev libfontconfig1-dev \ libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev \ libwebkit2gtk-4.1-dev \ libglu1-mesa-dev mesa-common-dev ``` #### 4. Generating project files ```bash cd --resave SpatGRIS.jucer ``` #### 5. Compiling Go to the generated `Builds/` folder. On Windows, use the Visual Studio 2022/2026 solution file. On MacOS, use the Xcode project. You will have to supply your own developer ID to XCode. On Linux : ```bash cd Builds/LinuxMakeFile make CONFIG=Release CXX=clang++ CC=clang -j8 ``` ## Running SpatGRIS must be launched from the project root directory. ## Using custom OSC interfaces OSC can be sent directly to SpatGRIS without having to use ControlGRIS. There is an example patch made for MAX 7 provided in this repo ([osc_max_example.maxpat](osc_max_example.maxpat)). __Please note that angles are always measured clockwise, starting from the upstage center (the positive Y direction).__ The server address is always `/spat/serv`. ##### `pol` moves a source using polar coordinates in radians. | #parameter | type | allowed values | meaning | | :--- | :--- | :--- | :--- | | 1 | string | `pol` | - | | 2 | int | [1, 128] | Source index | | 3 | float | any | azimuth angle | | 4 | float | any | elevation angle | | 5 | float | [-3.0, 3.0] | radius | | 6 | float | [0, 1] | Horizontal span | | 7 | float | [0, 1] | Vertical span | ex : The message `/spat/serv pol 7 0.0 0.78 0.5 0.1 0.2` moves the source #7 in the front at half elevation and placed at half the distance from the origin, with an horizontal span of 10% and a vertical span of 20%. #### `deg` moves a source using polar coordinates in degrees. | index | type | allowed values | meaning | | :--- | :--- | :--- | :--- | | 1 | string | `deg` | - | | 2 | int | [1, 128] | Source index | | 3 | float | any | azimuth angle | | 4 | float | any | elevation angle | | 5 | float | [-3.0, 3.0] | radius | | 6 | float | [0, 1] | Horizontal span | | 7 | float | [0, 1] | Vertical span | ex : The message `/spat/serv deg 7 -90.0 45.0 0.5 0.1 0.2` moves the source #7 at the extreme left, at half elevation and half the distance of the space, with an horizontal span of 10% and a vertical span of 20%. #### `car` moves a source using cartesian coordinates. | index | type | allowed values | meaning | | :--- | :--- | :--- | :--- | | 1 | string | `car` | - | | 2 | int | [1, 128] | Source index | | 3 | float | [-1.66, 1.66] | x (left/right) | | 4 | float | [-1.66, 1.66] | y (back/front) | | 5 | float | [-1.66, 1.66] | z (down/up) | | 6 | float | [0, 1] | Horizontal span | | 7 | float | [0, 1] | Vertical span | ex : The message `/spat/serv car 7 1.0 1.0 1.0 0.0 0.0` moves the source #7 at the top right corner, with no horizontal or vertical spans. #### `clr` clears a source's position. | index | type | allowed values | meaning | | :--- | :--- | :--- | :--- | | 1 | string |`clr` | clear | | 2 | int | [1, 128] | Source index | ex : The message `/spat/serv clr 7` clears the seventh source's position. #### `alg` sets a source's hybrid spatialization mode. | index | type | allowed values | meaning | | :--- | :--- | :--- | :--- | | 1 | string | `alg` | - | | 2 | int | [1, 128] | Source index | | 3 | string | `dome` or `cube` | Algorithm | ex : The message `/spat/serv alg 7 cube` sets the seventh source's spatialization algorithm to "cube" (only works in _hybrid_ mode).