Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatialisation of RNBO Unity Audioplugins #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ In these guides, we'll discuss the basics of adding your RNBO device as a plugin
* [Loading and Storing Presets](PRESETS.md)
* [Sending MIDI Messages](MIDI.md)
* [Making a Custom Filter](CUSTOM_FILTER.md)
* [Spatialisation and 3D Audio](SPATIALISATION_3D_AUDIO.md)

18 changes: 18 additions & 0 deletions docs/SPATIALISATION_3D_AUDIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Spatialisation of RNBO generated audio effects in Unity can seem a bit convoluted. The following describes a simple method that does not require any external frameworks.

For this method we need to use a special sound file included in this repository ./extras/SpatialiserFix.wav in our **Audio Source**, and use a couple of **`in~`** object in our rnbo~ patcher to apply the **Audio Source** spatialisation to the output of our RNBO generated audio effect.

The necessary steps are:
**In Unity**

1. Set the **Audio Source**'s **AudioClip** to our _SpatialiserFix.wav_ sound file.
- ![spatialiserfix-audioclip](images/spatialiserfix-audioclip.png)
2. Ensure the **Audio Source** is set to **Play On Awake** and **Loop**.
- ![spatialiserfix-loop](images/spatialiserfix-loop.png)
3. Set **Spatial Blend** to 1(_3D_).
- ![spatialiserfix-spatialblend](images/spatialiserfix-spatialblend.png)

**In RNBO~**
Multiply the output of your rnbo~ patcher with the stereo input from a couple of **`in~`** objects, like the section highlighted.
![spatialisation_rnbopatcher](images/spatialisation_rnbopatcher.png)
This will effectively apply the spatialisation that Unity applies to Audio Sources by default, to the output of our RNBO generated audio effect. While editing the rnbo~ patcher you may want to bypass the spatialisation section in order to hear the audio from your patcher.
Binary file added docs/images/spatialisation_rnbopatcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/spatialiserfix-audioclip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/spatialiserfix-loop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/spatialiserfix-spatialblend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extras/SpatialiserFix.wav
Binary file not shown.