diff --git a/Assets/03-Readme SpatialiseScene.txt b/Assets/03-Readme SpatialiseScene.txt index 989ae05..7d52809 100644 --- a/Assets/03-Readme SpatialiseScene.txt +++ b/Assets/03-Readme SpatialiseScene.txt @@ -1,47 +1,51 @@ -SpatialiseScene Notes ---------------------- -This scene demonstrates a couple of methods for spatialising Pure Data patches -in Unity. - - -OculusSpatializer Plugin Method -------------------------------- - -This is the simplest method of spatialising patches in Unity. It requires the -following steps: - -For the project: -1.) Edit -> Project Settings... -> Audio. -2.) Set Spatializer Plugin to OculusSpatializer. - -For each Audio Source in the scene: -1.) Toggle 'Spatialize' and 'Spatialize Post Effect' on. - -In testing it, the OculusSpatializer plugin seems to attenuate the sound quite -aggressively, so an alternative approach is also included. - - -Alternative Method ------------------- - -This method makes use of Unity's default audio spatialisation framework. It is a -bit more involved than the OculusSpatializer approach, but doesn't attenuate the -sound as aggressively. - -The first thing to note is that, by default, Unity only spatialises -AudioSources. It won't apply spatialisation to any other audio producing -Components (like LibPdInstance). In order to get around that limitation, we'll -need to cheat the system a bit. - -After adding an AudioSource and LibPdInstance to a GameObject in your scene, -the steps you'll need to take to spatialise your PD patch are: - -1.) Set the AudioSource's AudioClip to the included SpatialiserFix.wav file. -2.) Set the AudioSource to Play On Awake and Loop. -3.) Adjust the Spatial Blend slider to 1 (3D). -4.) In your PD patch, multiply the 2 outputs of an adc~ object by the output of - your patch before feeding it to the dac~ object. - -This process will ensure that the spatialisation applied to the AudioSource gets -applied to the output of your patch. See FilteredNoise-ADC.pd for more -information. +SpatialiseScene Notes +--------------------- +This scene demonstrates a couple of methods for spatialising Pure Data patches +in Unity. + + +Working with Unity's default spatialisation +------------------------------------------- + +This method makes use of Unity's default audio spatialisation framework. It is a +bit more involved than the alternative approach, but doesn't an external +spatial audio framework. + +The first thing to note is that, by default, Unity only spatialises +AudioSources. It won't apply spatialisation to any other audio producing +Components (like LibPdInstance). In order to get around that limitation, we'll +need to cheat the system a bit. + +After adding an AudioSource and LibPdInstance to a GameObject in your scene, +the steps you'll need to take to spatialise your PD patch are: + +1.) Set the AudioSource's AudioClip to the included SpatialiserFix.wav file. +2.) Set the AudioSource to Play On Awake and Loop. +3.) Adjust the Spatial Blend slider to 1 (3D). +4.) In your PD patch, multiply the 2 outputs of an adc~ object by the output of + your patch before feeding it to the dac~ object. + +This process will ensure that the spatialisation applied to the AudioSource gets +applied to the output of your patch. See FilteredNoise-ADC.pd for more +information. + + +Working with spatializer plugins +-------------------------------- + +Alternatively you can work with a custom spatialisation framework, using a +Spatializer Plugin. Spatializer Plugins make implementation a bit simpler, but +they do require you to import a spatialisation framework into your project. The +following example uses Steam Audio, but the steps are identical regardless of +which framework you use. + +It should be noted that Spatializer Plugins are almost always intended for VR +(i.e. headphone) use. So this approach may not make sense if you're building a +project intended for speaker output. + +For the project: +1.) Edit -> Project Settings... -> Audio. +2.) Set Spatializer Plugin to Steam Audio Spatializer. + +For each Audio Source in the scene: +1.) Toggle 'Spatialize' and 'Spatialize Post Effect' on. diff --git a/Assets/Scripts/LibPdInstance.cs b/Assets/Scripts/LibPdInstance.cs index 1db8fb5..887d70f 100644 --- a/Assets/Scripts/LibPdInstance.cs +++ b/Assets/Scripts/LibPdInstance.cs @@ -492,7 +492,7 @@ public class LibPdInstance : MonoBehaviour /// UnityEvent that will be invoked whenever we recieve a message from the PD patch. public StringStringObjArrEvent Message; }; - [Header("libpd -> Unity Events")] + [Header("libpd → Unity Events")] public PureDataEvents pureDataEvents; /// Events placed in a struct so they don't clutter up the Inspector by default.