Updated spatialisation scene to demonstrate OculusSpatializer method.

This commit is contained in:
Niall Moody 2018-07-25 13:47:09 +01:00
parent e09a6898ee
commit 9bec3b1b1f
16 changed files with 1173 additions and 256 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View file

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: c50d11482e66d184f9c800fc21203a8b
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 8
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GreenAudioSource
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: c50d11482e66d184f9c800fc21203a8b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 586d054146c25994a9c7ca9ff85701a4
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View file

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Green Sphere Material
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.354
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.21960784, g: 0.5764706, b: 0.33822948, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1a64bb011787acd448e61d0add544e33
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -148,6 +148,68 @@ MonoBehaviour:
patchDir: /StreamingAssets/PdAssets/SpatialisationPatches/ patchDir: /StreamingAssets/PdAssets/SpatialisationPatches/
patch: {fileID: 102900000, guid: 55f52df84da09804c81d203410a4fdde, type: 3} patch: {fileID: 102900000, guid: 55f52df84da09804c81d203410a4fdde, type: 3}
pipePrintToConsole: 1 pipePrintToConsole: 1
pureDataEvents:
Bang:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Float:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringFloatEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Symbol:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringStringEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
List:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringObjArrEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Message:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringStringObjArrEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
midiEvents:
MidiNoteOn:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiControlChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiProgramChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiPitchBend:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiAftertouch:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiPolyAftertouch:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiByte:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
--- !u!82 &27935066 --- !u!82 &27935066
AudioSource: AudioSource:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -336,13 +398,15 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1648548012} - {fileID: 1648548012}
- {fileID: 2036315274}
- {fileID: 1984785756} - {fileID: 1984785756}
- {fileID: 1490087609} - {fileID: 2036315274}
- {fileID: 1664882003}
- {fileID: 1814864771}
- {fileID: 1975205260} - {fileID: 1975205260}
- {fileID: 1490087609}
- {fileID: 288967916} - {fileID: 288967916}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &170076733 --- !u!1 &170076733
GameObject: GameObject:
@ -424,7 +488,7 @@ GameObject:
- component: {fileID: 178383051} - component: {fileID: 178383051}
- component: {fileID: 178383050} - component: {fileID: 178383050}
m_Layer: 0 m_Layer: 0
m_Name: Moving Sphere m_Name: Moving Sphere - Unity Spatialisation
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@ -454,10 +518,72 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 14496bc842cc2dd40b3da723e07b976d, type: 3} m_Script: {fileID: 11500000, guid: 14496bc842cc2dd40b3da723e07b976d, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
patchName: FilteredNoise patchName: FilteredNoise-ADC
patchDir: /StreamingAssets/PdAssets/SpatialisationPatches/ patchDir: /StreamingAssets/PdAssets/SpatialisationPatches/
patch: {fileID: 102900000, guid: 0f0b3965e1ca19a479d4cc4e00cd2810, type: 3} patch: {fileID: 102900000, guid: 8d059ad70b1caa34abcb319fba07da55, type: 3}
pipePrintToConsole: 1 pipePrintToConsole: 1
pureDataEvents:
Bang:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Float:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringFloatEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Symbol:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringStringEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
List:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringObjArrEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Message:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringStringObjArrEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
midiEvents:
MidiNoteOn:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiControlChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiProgramChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiPitchBend:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiAftertouch:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiPolyAftertouch:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiByte:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
--- !u!82 &178383052 --- !u!82 &178383052
AudioSource: AudioSource:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -614,11 +740,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 178383049} m_GameObject: {fileID: 178383049}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 30} m_LocalPosition: {x: 0, y: 3, z: 40}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &222970854 --- !u!1 &222970854
GameObject: GameObject:
@ -834,11 +960,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 288967915} m_GameObject: {fileID: 288967915}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 1.1, y: 0.01, z: -3.1} m_LocalPosition: {x: 3.7869995, y: 0.01, z: -3.464}
m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005} m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005}
m_Children: [] m_Children: []
m_Father: {fileID: 144170969} m_Father: {fileID: 144170969}
m_RootOrder: 5 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!102 &288967917 --- !u!102 &288967917
TextMesh: TextMesh:
@ -847,8 +973,8 @@ TextMesh:
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 288967915} m_GameObject: {fileID: 288967915}
m_Text: "(note the use of a looping\n <i>SpatialiserFix</i> Soundfile;\n see <i>FilteredNoise.pd</i> m_Text: "(note the use of a looping\n <i>SpatialiserFix</i> Soundfile;\n see <i>FilteredNoise-ADC.pd</i>\n
for\n more details)" for more details)"
m_OffsetZ: 0 m_OffsetZ: 0
m_CharacterSize: 0.03 m_CharacterSize: 0.03
m_LineSpacing: 1 m_LineSpacing: 1
@ -1154,6 +1280,279 @@ MeshFilter:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 440634029} m_GameObject: {fileID: 440634029}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &779449923
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 779449930}
- component: {fileID: 779449929}
- component: {fileID: 779449928}
- component: {fileID: 779449927}
- component: {fileID: 779449926}
- component: {fileID: 779449925}
- component: {fileID: 779449924}
m_Layer: 0
m_Name: Moving Sphere - OculusSpatializer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &779449924
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3819b4d1512a80c4bb840f900fdebf13, type: 3}
m_Name:
m_EditorClassIdentifier:
objectToMove: {fileID: 779449930}
radius: 10
--- !u!114 &779449925
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 14496bc842cc2dd40b3da723e07b976d, type: 3}
m_Name:
m_EditorClassIdentifier:
patchName: FilteredNoise
patchDir: /StreamingAssets/PdAssets/SpatialisationPatches/
patch: {fileID: 102900000, guid: 0f0b3965e1ca19a479d4cc4e00cd2810, type: 3}
pipePrintToConsole: 1
pureDataEvents:
Bang:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Float:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringFloatEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Symbol:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringStringEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
List:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringObjArrEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
Message:
m_PersistentCalls:
m_Calls: []
m_TypeName: StringStringObjArrEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
midiEvents:
MidiNoteOn:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiControlChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiProgramChange:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiPitchBend:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiAftertouch:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiPolyAftertouch:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
MidiByte:
m_PersistentCalls:
m_Calls: []
m_TypeName: IntIntEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
--- !u!82 &779449926
AudioSource:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 1
SpatializePostEffects: 1
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!135 &779449927
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &779449928
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 1a64bb011787acd448e61d0add544e33, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &779449929
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &779449930
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 779449923}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 30}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &917451453 --- !u!1 &917451453
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1382,11 +1781,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1490087608} m_GameObject: {fileID: 1490087608}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 2, y: 0.01, z: -1.65} m_LocalPosition: {x: 4.677, y: 0.01, z: -1.88}
m_LocalScale: {x: 1.5, y: 2.818, z: 1} m_LocalScale: {x: 1.5, y: 2.944672, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 144170969} m_Father: {fileID: 144170969}
m_RootOrder: 3 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!64 &1490087610 --- !u!64 &1490087610
MeshCollider: MeshCollider:
@ -1567,21 +1966,11 @@ TextMesh:
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1648548011} m_GameObject: {fileID: 1648548011}
m_Text: 'This scene demonstrates how to m_Text: "This scene demonstrates how to\r\nspatialise PD patches in Unity.\r\n\nThe
<color=#389356a8><b>Green</b></color> <i>(FilteredSound.pd)</i> and\r\n<color=#ff2020a8><b>Red</b></color>
spatialise PD patches in Unity. <i>(FilteredSound-ADC.pd)</i>\nspheres <b>are</b> spatialised, while the\n<color=#385893a8><b>Blue</b></color>
sphere <i>(SineDrone.pd)</i> <b>is not</b>.\n\nLook at the AudioSources for the
3\nspheres to see how this is done:"
The <color=#ff2020a8><b>Red</b></color> sphere <i>(FilteredSound.pd)</i>
<b>is</b> spatialised, while the <color=#385893a8><b>Blue</b></color> sphere
<i>(SineDrone.pd)</i> <b>is not</b>.
Look at the AudioSources for the 2
spheres to see how this is done:'
m_OffsetZ: 0 m_OffsetZ: 0
m_CharacterSize: 0.03 m_CharacterSize: 0.03
m_LineSpacing: 1 m_LineSpacing: 1
@ -1630,6 +2019,94 @@ MeshRenderer:
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!1 &1664882002
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1664882003}
- component: {fileID: 1664882005}
- component: {fileID: 1664882004}
m_Layer: 0
m_Name: Green Audio Source Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1664882003
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1664882002}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 1.29, y: 0.01, z: 0.038000107}
m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005}
m_Children: []
m_Father: {fileID: 144170969}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!102 &1664882004
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1664882002}
m_Text: '<color=#389356a8><b>Green</b></color> Sphere
(OculusSpatializer method)'
m_OffsetZ: 0
m_CharacterSize: 0.03
m_LineSpacing: 1
m_Anchor: 0
m_Alignment: 1
m_TabSize: 4
m_FontSize: 56
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 2818572288
--- !u!23 &1664882005
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1664882002}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &1739204888 --- !u!1 &1739204888
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1690,6 +2167,93 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1814864770
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1814864771}
- component: {fileID: 1814864774}
- component: {fileID: 1814864773}
- component: {fileID: 1814864772}
m_Layer: 0
m_Name: Green Audio Source Screenshot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1814864771
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1814864770}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 2.32, y: 0.01, z: -1.92}
m_LocalScale: {x: 1.5, y: 3.024, z: 1.0000005}
m_Children: []
m_Father: {fileID: 144170969}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!64 &1814864772
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1814864770}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1814864773
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1814864770}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 586d054146c25994a9c7ca9ff85701a4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1814864774
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1814864770}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1975205259 --- !u!1 &1975205259
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1714,11 +2278,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1975205259} m_GameObject: {fileID: 1975205259}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 1.55, y: 0.01, z: 0} m_LocalPosition: {x: 3.9199998, y: 0.01, z: 0.038000107}
m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005} m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005}
m_Children: [] m_Children: []
m_Father: {fileID: 144170969} m_Father: {fileID: 144170969}
m_RootOrder: 4 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!102 &1975205261 --- !u!102 &1975205261
TextMesh: TextMesh:
@ -1727,12 +2291,14 @@ TextMesh:
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1975205259} m_GameObject: {fileID: 1975205259}
m_Text: <color=#ff2020a8><b>Red</b></color> Sphere m_Text: '<color=#ff2020a8><b>Red</b></color> Sphere
(alternative method)'
m_OffsetZ: 0 m_OffsetZ: 0
m_CharacterSize: 0.03 m_CharacterSize: 0.03
m_LineSpacing: 1 m_LineSpacing: 1
m_Anchor: 0 m_Anchor: 0
m_Alignment: 0 m_Alignment: 1
m_TabSize: 4 m_TabSize: 4
m_FontSize: 56 m_FontSize: 56
m_FontStyle: 0 m_FontStyle: 0
@ -1800,11 +2366,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1984785755} m_GameObject: {fileID: 1984785755}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: -0.46, y: 0.01, z: 0} m_LocalPosition: {x: -0.45, y: 0.01, z: -0.15}
m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005} m_LocalScale: {x: 1, y: 1.0000005, z: 1.0000005}
m_Children: [] m_Children: []
m_Father: {fileID: 144170969} m_Father: {fileID: 144170969}
m_RootOrder: 2 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!102 &1984785757 --- !u!102 &1984785757
TextMesh: TextMesh:
@ -1975,11 +2541,11 @@ Transform:
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2036315273} m_GameObject: {fileID: 2036315273}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0.01, z: -1.65} m_LocalPosition: {x: 0, y: 0.01, z: -1.88}
m_LocalScale: {x: 1.5, y: 2.812, z: 1} m_LocalScale: {x: 1.5, y: 2.9385245, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 144170969} m_Father: {fileID: 144170969}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!64 &2036315275 --- !u!64 &2036315275
MeshCollider: MeshCollider:

View file

@ -24,10 +24,42 @@
using System; using System;
using UnityEngine; using UnityEngine;
using UnityEditor; using UnityEditor;
using UnityEngine.Events;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
#region UnityEvent types
//------------------------------------------------------------------------------
/// Single string parameter event type (used for Bang events).
[System.Serializable]
public class StringEvent : UnityEvent<string> {}
/// String + float parameter event type (used for Float events).
[System.Serializable]
public class StringFloatEvent : UnityEvent<string, float> {}
/// String + string parameter event type (used for Symbol events).
[System.Serializable]
public class StringStringEvent : UnityEvent<string, string> {}
/// String + object array parameter event type (used for List events).
[System.Serializable]
public class StringObjArrEvent : UnityEvent<string, object[]> {}
/// String + object array parameter event type (used for Message events).
[System.Serializable]
public class StringStringObjArrEvent : UnityEvent<string, string, object[]> {}
/// Int + int + int parameter event type (used for various MIDI events).
[System.Serializable]
public class IntIntIntEvent : UnityEvent<int, int, int> {}
/// Int + int parameter event type (used for various MIDI events).
[System.Serializable]
public class IntIntEvent : UnityEvent<int, int> {}
#endregion
/// <summary> /// <summary>
/// Unity Component for running a Pure Data patch. Uses libpd's new multiple /// Unity Component for running a Pure Data patch. Uses libpd's new multiple
/// instance support, so you can run multiple LibPdInstances in your scene. /// instance support, so you can run multiple LibPdInstances in your scene.
@ -214,10 +246,8 @@ public class LibPdInstance : MonoBehaviour {
int n); int n);
#endregion #endregion
#region delegate/libpd callback declarations #region libpd delegate/callback declarations
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// Delegates/libpd callbacks.
//-Print hook--------------------------------------------------------------- //-Print hook---------------------------------------------------------------
// We don't make the print hook publicly available (for now), so it's just a // We don't make the print hook publicly available (for now), so it's just a
//single static delegate. //single static delegate.
@ -243,11 +273,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdBangHook bangHook; private LibPdBangHook bangHook;
/// Public delegate for receiving bang events.
public delegate void LibPdBang(string receiver);
/// Bang event; subscribe to this to receive bangs.
public static event LibPdBang Bang = delegate{};
//-Float hook--------------------------------------------------------------- //-Float hook---------------------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdFloatHook([In] [MarshalAs(UnmanagedType.LPStr)] string symbol, public delegate void LibPdFloatHook([In] [MarshalAs(UnmanagedType.LPStr)] string symbol,
@ -258,11 +283,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdFloatHook floatHook; private LibPdFloatHook floatHook;
/// Public delegate for receiving float events.
public delegate void LibPdFloat(string receiver, float val);
/// Bang event; subscribe to this to receive floats.
public static event LibPdFloat Float = delegate{};
//-Symbol hook-------------------------------------------------------------- //-Symbol hook--------------------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdSymbolHook([In] [MarshalAs(UnmanagedType.LPStr)] string symbol, public delegate void LibPdSymbolHook([In] [MarshalAs(UnmanagedType.LPStr)] string symbol,
@ -273,11 +293,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdSymbolHook symbolHook; private LibPdSymbolHook symbolHook;
/// Public delegate for receiving symbol events.
public delegate void LibPdSymbol(string receiver, string val);
/// Bang event; subscribe to this to receive symbols.
public static event LibPdSymbol Symbol = delegate{};
//-List hook---------------------------------------------------------------- //-List hook----------------------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdListHook([In] [MarshalAs(UnmanagedType.LPStr)] string source, public delegate void LibPdListHook([In] [MarshalAs(UnmanagedType.LPStr)] string source,
@ -289,11 +304,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdListHook listHook; private LibPdListHook listHook;
/// Public delegate for receiving lists.
public delegate void LibPdList(string source, object[] args);
/// Bang event; subscribe to this to receive lists.
public static event LibPdList List = delegate{};
//-Message hook------------------------------------------------------------- //-Message hook-------------------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMessageHook([In] [MarshalAs(UnmanagedType.LPStr)] string source, public delegate void LibPdMessageHook([In] [MarshalAs(UnmanagedType.LPStr)] string source,
@ -306,13 +316,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMessageHook messageHook; private LibPdMessageHook messageHook;
/// Public delegate for receiving messages.
public delegate void LibPdMessage(string source,
string symbol,
object[] args);
/// Bang event; subscribe to this to messages.
public static event LibPdMessage Message = delegate{};
//-MIDI Note On hook-------------------------------------------------------- //-MIDI Note On hook--------------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiNoteOnHook(int channel, public delegate void LibPdMidiNoteOnHook(int channel,
@ -324,11 +327,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMidiNoteOnHook noteOnHook; private LibPdMidiNoteOnHook noteOnHook;
/// Public delegate for receiving MIDI note on events.
public delegate void LibPdMidiNoteOn(int channel, int pitch, int velocity);
/// Bang event; subscribe to this to receive MIDI note on events.
public static event LibPdMidiNoteOn MidiNoteOn = delegate {};
//-MIDI Control Change hook------------------------------------------------- //-MIDI Control Change hook-------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiControlChangeHook(int channel, public delegate void LibPdMidiControlChangeHook(int channel,
@ -340,13 +338,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMidiControlChangeHook controlChangeHook; private LibPdMidiControlChangeHook controlChangeHook;
/// Public delegate for receiving MIDI control change events.
public delegate void LibPdMidiControlChange(int channel,
int controller,
int value);
/// Bang event; subscribe to this to receive MIDI control change events.
public static event LibPdMidiControlChange MidiControlChange = delegate {};
//-MIDI Program Change hook------------------------------------------------- //-MIDI Program Change hook-------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiProgramChangeHook(int channel, int program); public delegate void LibPdMidiProgramChangeHook(int channel, int program);
@ -356,11 +347,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMidiProgramChangeHook programChangeHook; private LibPdMidiProgramChangeHook programChangeHook;
/// Public delegate for receiving MIDI program change events.
public delegate void LibPdMidiProgramChange(int channel, int program);
/// Bang event; subscribe to this to receive MIDI program change events.
public static event LibPdMidiProgramChange MidiProgramChange = delegate {};
//-MIDI Pitch Bend hook----------------------------------------------------- //-MIDI Pitch Bend hook-----------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiPitchBendHook(int channel, int value); public delegate void LibPdMidiPitchBendHook(int channel, int value);
@ -370,11 +356,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMidiPitchBendHook pitchBendHook; private LibPdMidiPitchBendHook pitchBendHook;
/// Public delegate for receiving MIDI pitch bend events.
public delegate void LibPdMidiPitchBend(int channel, int value);
/// Bang event; subscribe to this to receive MIDI pitch bend events.
public static event LibPdMidiPitchBend MidiPitchBend = delegate {};
//-MIDI Aftertouch hook----------------------------------------------------- //-MIDI Aftertouch hook-----------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiAftertouchHook(int channel, int value); public delegate void LibPdMidiAftertouchHook(int channel, int value);
@ -384,11 +365,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMidiAftertouchHook aftertouchHook; private LibPdMidiAftertouchHook aftertouchHook;
/// Public delegate for receiving MIDI aftertouch events.
public delegate void LibPdMidiAftertouch(int channel, int value);
/// Bang event; subscribe to this to receive MIDI aftertouch events.
public static event LibPdMidiAftertouch MidiAftertouch = delegate {};
//-MIDI Polyphonic Aftertouch hook------------------------------------------ //-MIDI Polyphonic Aftertouch hook------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiPolyAftertouchHook(int channel, int pitch, int value); public delegate void LibPdMidiPolyAftertouchHook(int channel, int pitch, int value);
@ -398,11 +374,6 @@ public class LibPdInstance : MonoBehaviour {
private LibPdMidiPolyAftertouchHook polyAftertouchHook; private LibPdMidiPolyAftertouchHook polyAftertouchHook;
/// Public delegate for receiving MIDI polyphonic aftertouch events.
public delegate void LibPdMidiPolyAftertouch(int channel, int pitch, int value);
/// Bang event; subscribe to this to receive MIDI polyphonic aftertouch events.
public static event LibPdMidiPolyAftertouch MidiPolyAftertouch = delegate {};
//-MIDI Byte hook----------------------------------------------------------- //-MIDI Byte hook-----------------------------------------------------------
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LibPdMidiByteHook(int channel, int value); public delegate void LibPdMidiByteHook(int channel, int value);
@ -411,11 +382,6 @@ public class LibPdInstance : MonoBehaviour {
private static extern void libpd_set_midibytehook(LibPdMidiByteHook hook); private static extern void libpd_set_midibytehook(LibPdMidiByteHook hook);
private LibPdMidiByteHook midiByteHook; private LibPdMidiByteHook midiByteHook;
/// Public delegate for receiving MIDI byte events.
public delegate void LibPdMidiByte(int channel, int value);
/// Bang event; subscribe to this to receive MIDI byte events.
public static event LibPdMidiByte MidiByte = delegate {};
#endregion #endregion
#region member variables #region member variables
@ -465,6 +431,46 @@ public class LibPdInstance : MonoBehaviour {
/// Global variable used to ensure we don't initialise LibPd more than once. /// Global variable used to ensure we don't initialise LibPd more than once.
private static bool pdInitialised = false; private static bool pdInitialised = false;
#endregion #endregion
#region events
//--------------------------------------------------------------------------
/// Events placed in a struct so they don't clutter up the Inspector by default.
[System.Serializable]
public struct PureDataEvents {
/// UnityEvent that will be invoked whenever we recieve a bang from the PD patch.
public StringEvent Bang;
/// UnityEvent that will be invoked whenever we recieve a float from the PD patch.
public StringFloatEvent Float;
/// UnityEvent that will be invoked whenever we recieve a symbol from the PD patch.
public StringStringEvent Symbol;
/// UnityEvent that will be invoked whenever we recieve a list from the PD patch.
public StringObjArrEvent List;
/// UnityEvent that will be invoked whenever we recieve a message from the PD patch.
public StringStringObjArrEvent Message;
};
[Header("libpd -> Unity Events")]
public PureDataEvents pureDataEvents;
/// Events placed in a struct so they don't clutter up the Inspector by default.
[System.Serializable]
public struct MidiEvents {
/// UnityEvent that will be invoked whenever we recieve a MIDI note on from the PD patch.
public IntIntIntEvent MidiNoteOn;
/// UnityEvent that will be invoked whenever we recieve a MIDI CC from the PD patch.
public IntIntIntEvent MidiControlChange;
/// UnityEvent that will be invoked whenever we recieve a MIDI program change from the PD patch.
public IntIntEvent MidiProgramChange;
/// UnityEvent that will be invoked whenever we recieve a MIDI pitch bend from the PD patch.
public IntIntEvent MidiPitchBend;
/// UnityEvent that will be invoked whenever we recieve a MIDI aftertouch from the PD patch.
public IntIntEvent MidiAftertouch;
/// UnityEvent that will be invoked whenever we recieve a polyphonic MIDI aftertouch from the PD patch.
public IntIntIntEvent MidiPolyAftertouch;
/// UnityEvent that will be invoked whenever we recieve a MIDI byte from the PD patch.
public IntIntEvent MidiByte;
};
public MidiEvents midiEvents;
#endregion
#region MonoBehaviour methods #region MonoBehaviour methods
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -530,6 +536,32 @@ public class LibPdInstance : MonoBehaviour {
else else
pipePrintToConsole = pipePrintToConsoleStatic; pipePrintToConsole = pipePrintToConsoleStatic;
if(pureDataEvents.Bang == null)
pureDataEvents.Bang = new StringEvent();
if(pureDataEvents.Float == null)
pureDataEvents.Float = new StringFloatEvent();
if(pureDataEvents.Symbol == null)
pureDataEvents.Symbol = new StringStringEvent();
if(pureDataEvents.List == null)
pureDataEvents.List = new StringObjArrEvent();
if(pureDataEvents.Message == null)
pureDataEvents.Message = new StringStringObjArrEvent();
if(midiEvents.MidiNoteOn == null)
midiEvents.MidiNoteOn = new IntIntIntEvent();
if(midiEvents.MidiControlChange == null)
midiEvents.MidiControlChange = new IntIntIntEvent();
if(midiEvents.MidiProgramChange == null)
midiEvents.MidiProgramChange = new IntIntEvent();
if(midiEvents.MidiPitchBend == null)
midiEvents.MidiPitchBend = new IntIntEvent();
if(midiEvents.MidiAftertouch == null)
midiEvents.MidiAftertouch = new IntIntEvent();
if(midiEvents.MidiPolyAftertouch == null)
midiEvents.MidiPolyAftertouch = new IntIntIntEvent();
if(midiEvents.MidiByte == null)
midiEvents.MidiByte = new IntIntEvent();
// Calc numTicks. // Calc numTicks.
int bufferSize; int bufferSize;
int noOfBuffers; int noOfBuffers;
@ -906,21 +938,21 @@ public class LibPdInstance : MonoBehaviour {
/// Receive bang messages. /// Receive bang messages.
void BangOutput(string symbol) void BangOutput(string symbol)
{ {
Bang(symbol); pureDataEvents.Bang.Invoke(symbol);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive float messages. /// Receive float messages.
void FloatOutput(string symbol, float val) void FloatOutput(string symbol, float val)
{ {
Float(symbol, val); pureDataEvents.Float.Invoke(symbol, val);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive symbol messages. /// Receive symbol messages.
void SymbolOutput(string symbol, string val) void SymbolOutput(string symbol, string val)
{ {
Symbol(symbol, val); pureDataEvents.Symbol.Invoke(symbol, val);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -929,7 +961,7 @@ public class LibPdInstance : MonoBehaviour {
{ {
var args = ConvertList(argc, argv); var args = ConvertList(argc, argv);
List(source, args); pureDataEvents.List.Invoke(source, args);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -938,56 +970,56 @@ public class LibPdInstance : MonoBehaviour {
{ {
var args = ConvertList(argc, argv); var args = ConvertList(argc, argv);
Message(source, symbol, args); pureDataEvents.Message.Invoke(source, symbol, args);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI note on messages. /// Receive MIDI note on messages.
void MidiNoteOnOutput(int channel, int pitch, int velocity) void MidiNoteOnOutput(int channel, int pitch, int velocity)
{ {
MidiNoteOn(channel, pitch, velocity); midiEvents.MidiNoteOn.Invoke(channel, pitch, velocity);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI control change messages. /// Receive MIDI control change messages.
void MidiControlChangeOutput(int channel, int controller, int value) void MidiControlChangeOutput(int channel, int controller, int value)
{ {
MidiControlChange(channel, controller, value); midiEvents.MidiControlChange.Invoke(channel, controller, value);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI program change messages. /// Receive MIDI program change messages.
void MidiProgramChangeOutput(int channel, int program) void MidiProgramChangeOutput(int channel, int program)
{ {
MidiProgramChange(channel, program); midiEvents.MidiProgramChange.Invoke(channel, program);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI pitch bend messages. /// Receive MIDI pitch bend messages.
void MidiPitchBendOutput(int channel, int value) void MidiPitchBendOutput(int channel, int value)
{ {
MidiPitchBend(channel, value); midiEvents.MidiPitchBend.Invoke(channel, value);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI aftertouch messages. /// Receive MIDI aftertouch messages.
void MidiAftertouchOutput(int channel, int value) void MidiAftertouchOutput(int channel, int value)
{ {
MidiAftertouch(channel, value); midiEvents.MidiAftertouch.Invoke(channel, value);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI polyphonic aftertouch messages. /// Receive MIDI polyphonic aftertouch messages.
void MidiPolyAftertouchOutput(int channel, int pitch, int value) void MidiPolyAftertouchOutput(int channel, int pitch, int value)
{ {
MidiPolyAftertouch(channel, pitch, value); midiEvents.MidiPolyAftertouch.Invoke(channel, pitch, value);
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/// Receive MIDI byte messages. /// Receive MIDI byte messages.
void MidiByteOutput(int channel, int value) void MidiByteOutput(int channel, int value)
{ {
MidiByte(channel, value); midiEvents.MidiByte.Invoke(channel, value);
} }
#endregion #endregion

View file

@ -0,0 +1,137 @@
#N canvas -2 28 471 717 10;
#X obj 11 259 cnv 16 54 96 empty empty Spatialise_Output 32 -12 0 16
-260584 -66577 0;
#X obj 10 21 cnv 16 214 212 empty empty Noise_Generation 4 -12 0 16
-179694 -66577 0;
#X obj 15 331 dac~;
#X obj 15 25 noise~;
#X obj 33 169 vline~;
#X obj 33 99 random 200;
#X obj 33 122 + 400;
#X msg 33 145 \$1 1000;
#X obj 33 73 metro 1000;
#X obj 15 190 vcf~ 4;
#X msg 106 150 \$1 1000;
#X obj 106 87 random 21;
#X obj 106 127 + 4;
#X obj 106 176 line;
#X obj 33 43 loadbang;
#X obj 33 263 adc~;
#X obj 15 303 *~;
#X obj 39 303 *~;
#X obj 160 130 loadbang;
#X obj 160 153 delay 100;
#X msg 160 176 2 250;
#X obj 160 200 vline~;
#X obj 15 214 *~;
#X text 69 258 <- This section is what;
#X text 88 268 ensures our noise is;
#X text 88 279 spatialised in Unity;
#X text 108 305 Click here for an;
#X text 140 317 explanation:;
#N canvas 464 55 1066 681 explanation 0;
#X text 9 20 AudioSource Components.;
#X text 10 6 By default \, Unity only spatialises;
#X text 6 54 the AudioSource in a GameObject's chain;
#X text 7 66 will not have their output spatialised.;
#X text 8 43 Any sound generating Components following;
#X text 7 107 system by using a special soundfile;
#X text 4 119 (SpatialiserFix.wav) in the AudioSource \,;
#X text 7 131 and feeding the output of the AudioSource;
#X text 5 143 (which Unity has now spatialised for us);
#X text 8 156 into the audio input of our PD patch.;
#X text 8 96 To get around this we need to cheat the;
#X text 7 195 constant dc value of +1 (for this reason;
#X text 7 207 you should NOT attempt to play it through;
#X text 7 221 your speakers). When Unity applies its;
#X text 6 234 default spatialisation to it \, this gives;
#X text 8 246 us a stereo input which effectively;
#X text 7 259 contains the levels of the left & right;
#X text 8 270 channels for our patch.;
#X text 8 183 The SpatialiserFix file contains a;
#X text 6 309 output by these levels then gives us a;
#X text 6 321 correctly spatialised output.;
#X text 7 297 Simply multiplying our patch's stereo;
#N canvas 0 50 450 250 (subpatch) 0;
#X array SpatialiserFix 100 float 5;
#A 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1;
#X coords 0 1.2 100 -1.2 100 70 1 0 0;
#X restore 400 35 graph;
#X obj 400 122 hsl 128 16 0 1 0 0 empty PanReceive Pan_Control -2 -8
0 14 -262144 -1 -1 0 1;
#N canvas 20 81 626 466 spatialisation 0;
#X obj 7 8 inlet;
#X obj 251 14 loadbang;
#X msg 251 31 0;
#X obj 226 60 f;
#X obj 285 59 + 1;
#X obj 75 156 *;
#X obj 15 154 -;
#X msg 3 131 1;
#X obj 31 177 *;
#X obj 225 80 % 100;
#X obj 66 101 tabread SpatialiserFix;
#X msg 82 33 bang;
#X obj 75 186 s RightOutput;
#X obj 31 203 s LeftOutput;
#X connect 0 0 6 1;
#X connect 0 0 11 0;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 3 0 9 0;
#X connect 4 0 3 1;
#X connect 5 0 12 0;
#X connect 6 0 8 0;
#X connect 7 0 6 0;
#X connect 8 0 13 0;
#X connect 9 0 10 0;
#X connect 10 0 8 1;
#X connect 10 0 5 1;
#X connect 10 0 7 0;
#X connect 11 0 3 0;
#X restore 398 151 pd spatialisation;
#X obj 451 186 vsl 32 96 0 1 0 0 empty RightOutput R 10 -9 0 16 -262144
-1 -1 0 1;
#X obj 399 186 vsl 32 96 0 1 0 0 empty LeftOutput L 12 -9 0 16 -262144
-1 -1 0 1;
#X text 322 59 AudioSource;
#X text 354 130 Unity;
#X text 293 141 Spatialisation:;
#X text 319 212 AudioSource;
#X text 347 223 Output:;
#X text 290 3 Effectively \, what we are doing is:;
#X text 291 71 Soundfile Input:;
#X text 437 288 |;
#X text 437 296 v;
#X text 376 309 Fed to our patch via;
#X text 391 321 its adc~ object.;
#X connect 23 0 24 0;
#X restore 128 337 pd explanation;
#X connect 3 0 9 0;
#X connect 4 0 9 1;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 4 0;
#X connect 8 0 5 0;
#X connect 8 0 11 0;
#X connect 9 0 22 0;
#X connect 10 0 13 0;
#X connect 11 0 12 0;
#X connect 12 0 10 0;
#X connect 13 0 9 2;
#X connect 14 0 8 0;
#X connect 15 0 16 1;
#X connect 15 1 17 1;
#X connect 16 0 2 0;
#X connect 17 0 2 1;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 22 1;
#X connect 22 0 16 0;
#X connect 22 0 17 0;

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8d059ad70b1caa34abcb319fba07da55
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,137 +1,38 @@
#N canvas -8 8 471 717 10; #N canvas 657 74 443 510 10;
#X obj 11 259 cnv 16 54 96 empty empty Spatialise_Output 32 -12 0 16 #X obj 9 234 dac~;
-260584 -66577 0; #X obj 9 6 noise~;
#X obj 10 21 cnv 16 214 212 empty empty Noise_Generation 4 -12 0 16 #X obj 27 150 vline~;
-179694 -66577 0; #X obj 27 80 random 200;
#X obj 15 331 dac~; #X msg 27 126 \$1 1000;
#X obj 15 25 noise~; #X obj 27 54 metro 1000;
#X obj 33 169 vline~; #X obj 9 171 vcf~ 4;
#X obj 33 99 random 200; #X msg 100 131 \$1 1000;
#X obj 33 122 + 400; #X obj 100 68 random 21;
#X msg 33 145 \$1 1000; #X obj 100 157 line;
#X obj 33 73 metro 1000; #X obj 27 24 loadbang;
#X obj 15 190 vcf~ 4; #X obj 154 111 loadbang;
#X msg 106 150 \$1 1000; #X obj 154 134 delay 100;
#X obj 106 87 random 21; #X msg 154 157 2 250;
#X obj 106 127 + 4; #X obj 154 181 vline~;
#X obj 106 176 line; #X obj 9 195 *~;
#X obj 33 43 loadbang; #X obj 27 103 + 600;
#X obj 33 263 adc~; #X obj 100 108 + 9;
#X obj 15 303 *~; #X connect 1 0 6 0;
#X obj 39 303 *~; #X connect 2 0 6 1;
#X obj 160 130 loadbang; #X connect 3 0 16 0;
#X obj 160 153 delay 100; #X connect 4 0 2 0;
#X msg 160 176 2 250; #X connect 5 0 3 0;
#X obj 160 200 vline~; #X connect 5 0 8 0;
#X obj 15 214 *~; #X connect 6 0 15 0;
#X text 69 258 <- This section is what; #X connect 7 0 9 0;
#X text 88 268 ensures our noise is; #X connect 8 0 17 0;
#X text 88 279 spatialised in Unity; #X connect 9 0 6 2;
#X text 108 305 Click here for an; #X connect 10 0 5 0;
#X text 140 317 explanation:;
#N canvas 464 55 1066 681 explanation 0;
#X text 9 20 AudioSource Components.;
#X text 10 6 By default \, Unity only spatialises;
#X text 6 54 the AudioSource in a GameObject's chain;
#X text 7 66 will not have their output spatialised.;
#X text 8 43 Any sound generating Components following;
#X text 7 107 system by using a special soundfile;
#X text 4 119 (SpatialiserFix.wav) in the AudioSource \,;
#X text 7 131 and feeding the output of the AudioSource;
#X text 5 143 (which Unity has now spatialised for us);
#X text 8 156 into the audio input of our PD patch.;
#X text 8 96 To get around this we need to cheat the;
#X text 7 195 constant dc value of +1 (for this reason;
#X text 7 207 you should NOT attempt to play it through;
#X text 7 221 your speakers). When Unity applies its;
#X text 6 234 default spatialisation to it \, this gives;
#X text 8 246 us a stereo input which effectively;
#X text 7 259 contains the levels of the left & right;
#X text 8 270 channels for our patch.;
#X text 8 183 The SpatialiserFix file contains a;
#X text 6 309 output by these levels then gives us a;
#X text 6 321 correctly spatialised output.;
#X text 7 297 Simply multiplying our patch's stereo;
#N canvas 0 50 450 250 (subpatch) 0;
#X array SpatialiserFix 100 float 5;
#A 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1;
#X coords 0 1.2 100 -1.2 100 70 1 0 0;
#X restore 400 35 graph;
#X obj 400 122 hsl 128 16 0 1 0 0 empty PanReceive Pan_Control -2 -8
0 14 -262144 -1 -1 0 1;
#N canvas 20 81 626 466 spatialisation 0;
#X obj 7 8 inlet;
#X obj 251 14 loadbang;
#X msg 251 31 0;
#X obj 226 60 f;
#X obj 285 59 + 1;
#X obj 75 156 *;
#X obj 15 154 -;
#X msg 3 131 1;
#X obj 31 177 *;
#X obj 225 80 % 100;
#X obj 66 101 tabread SpatialiserFix;
#X msg 82 33 bang;
#X obj 75 186 s RightOutput;
#X obj 31 203 s LeftOutput;
#X connect 0 0 6 1;
#X connect 0 0 11 0;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 3 0 9 0;
#X connect 4 0 3 1;
#X connect 5 0 12 0;
#X connect 6 0 8 0;
#X connect 7 0 6 0;
#X connect 8 0 13 0;
#X connect 9 0 10 0;
#X connect 10 0 8 1;
#X connect 10 0 5 1;
#X connect 10 0 7 0;
#X connect 11 0 3 0;
#X restore 398 151 pd spatialisation;
#X obj 451 186 vsl 32 96 0 1 0 0 empty RightOutput R 10 -9 0 16 -262144
-1 -1 0 1;
#X obj 399 186 vsl 32 96 0 1 0 0 empty LeftOutput L 12 -9 0 16 -262144
-1 -1 0 1;
#X text 322 59 AudioSource;
#X text 354 130 Unity;
#X text 293 141 Spatialisation:;
#X text 319 212 AudioSource;
#X text 347 223 Output:;
#X text 290 3 Effectively \, what we are doing is:;
#X text 291 71 Soundfile Input:;
#X text 437 288 |;
#X text 437 296 v;
#X text 376 309 Fed to our patch via;
#X text 391 321 its adc~ object.;
#X connect 23 0 24 0;
#X restore 128 337 pd explanation;
#X connect 3 0 9 0;
#X connect 4 0 9 1;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 4 0;
#X connect 8 0 5 0;
#X connect 8 0 11 0;
#X connect 9 0 22 0;
#X connect 10 0 13 0;
#X connect 11 0 12 0; #X connect 11 0 12 0;
#X connect 12 0 10 0; #X connect 12 0 13 0;
#X connect 13 0 9 2; #X connect 13 0 14 0;
#X connect 14 0 8 0; #X connect 14 0 15 1;
#X connect 15 0 16 1; #X connect 15 0 0 0;
#X connect 15 1 17 1; #X connect 15 0 0 1;
#X connect 16 0 2 0; #X connect 16 0 4 0;
#X connect 17 0 2 1; #X connect 17 0 7 0;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 22 1;
#X connect 22 0 16 0;
#X connect 22 0 17 0;

Binary file not shown.

View file

@ -11,7 +11,7 @@ AudioManager:
m_DSPBufferSize: 1024 m_DSPBufferSize: 1024
m_VirtualVoiceCount: 512 m_VirtualVoiceCount: 512
m_RealVoiceCount: 32 m_RealVoiceCount: 32
m_SpatializerPlugin: m_SpatializerPlugin: OculusSpatializer
m_AmbisonicDecoderPlugin: m_AmbisonicDecoderPlugin:
m_DisableAudio: 0 m_DisableAudio: 0
m_VirtualizeEffects: 1 m_VirtualizeEffects: 1

View file

@ -1,6 +1,6 @@
LibPd Integration Examples LibPd Integration Examples
-------------------------- --------------------------
- Generate documentation from LibPdInstance.cs. - Add OculusSpatializer example.
Further down the line: Further down the line:
---------------------- ----------------------