diff --git a/UnityProject/.idea/.idea.UnityProject/.idea/contentModel.xml b/UnityProject/.idea/.idea.UnityProject/.idea/contentModel.xml
index 50756aa..2193db9 100644
--- a/UnityProject/.idea/.idea.UnityProject/.idea/contentModel.xml
+++ b/UnityProject/.idea/.idea.UnityProject/.idea/contentModel.xml
@@ -9,12 +9,14 @@
+
-
-
-
-
-
+
+
+
+
+
+
@@ -30,8 +32,15 @@
+
+
+
+
+
+
+
diff --git a/UnityProject/.idea/.idea.UnityProject/.idea/workspace.xml b/UnityProject/.idea/.idea.UnityProject/.idea/workspace.xml
index 58c34aa..9648a08 100644
--- a/UnityProject/.idea/.idea.UnityProject/.idea/workspace.xml
+++ b/UnityProject/.idea/.idea.UnityProject/.idea/workspace.xml
@@ -2,15 +2,28 @@
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
@@ -21,148 +34,164 @@
-
+
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
+
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -175,53 +204,63 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
+
+
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
@@ -269,15 +327,44 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -337,7 +424,9 @@
-
+
+
+
1562485186899
@@ -353,11 +442,46 @@
1562515012981
-
+
+ 1569668003044
+
+
+
+ 1569668003044
+
+
+ 1569698519801
+
+
+
+ 1569698519801
+
+
+ 1569709150438
+
+
+
+ 1569709150438
+
+
+ 1569709175582
+
+
+
+ 1569709175582
+
+
+ 1569751217305
+
+
+
+ 1569751217305
+
+
-
+
@@ -369,27 +493,28 @@
-
+
+
-
-
+
+
-
+
-
+
-
+
@@ -418,7 +543,12 @@
-
+
+
+
+
+
+
@@ -427,6 +557,19 @@
+
+ file://$PROJECT_DIR$/Assets/Scripts/PdConnection/PdSpectrumBind.cs
+ 27
+
+
+
+
+
+
+
+
+
+
@@ -437,290 +580,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -832,20 +691,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -898,19 +743,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1012,25 +844,329 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UnityProject/Assembly-CSharp-Editor.csproj b/UnityProject/Assembly-CSharp-Editor.csproj
index 27c3759..d07f55b 100644
--- a/UnityProject/Assembly-CSharp-Editor.csproj
+++ b/UnityProject/Assembly-CSharp-Editor.csproj
@@ -26,7 +26,7 @@
full
false
Temp\bin\Debug\
- DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2018_4_3;UNITY_2018_4;UNITY_2018;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_TEXTURE_STREAMING;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_VIDEO;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_EVENT_QUEUE;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER
+ DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2018_4_3;UNITY_2018_4;UNITY_2018;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_TEXTURE_STREAMING;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_VIDEO;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_EVENT_QUEUE;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;EXTOSC;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER
prompt
4
0169
@@ -58,13 +58,11 @@
-
-
+
-
diff --git a/UnityProject/Assembly-CSharp.csproj b/UnityProject/Assembly-CSharp.csproj
index 06c41ef..65ef83e 100644
--- a/UnityProject/Assembly-CSharp.csproj
+++ b/UnityProject/Assembly-CSharp.csproj
@@ -26,7 +26,7 @@
full
false
Temp\bin\Debug\
- DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2018_4_3;UNITY_2018_4;UNITY_2018;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_TEXTURE_STREAMING;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_VIDEO;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_EVENT_QUEUE;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER
+ DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2018_4_3;UNITY_2018_4;UNITY_2018;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_TEXTURE_STREAMING;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_VIDEO;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_EVENT_QUEUE;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;EXTOSC;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER
prompt
4
0169
@@ -64,6 +64,7 @@
+
diff --git a/UnityProject/Assets/Editor/EditorToggle.cs b/UnityProject/Assets/Editor/EditorToggle.cs
deleted file mode 100644
index 790fc8c..0000000
--- a/UnityProject/Assets/Editor/EditorToggle.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-
-namespace cylvester
-{
- public interface IEditorToggle
- {
- event Action ToggleStateChanged;
- bool State { get; set; }
- }
-
- public class EditorToggle : IEditorToggle
- {
- private bool state_;
-
- public event Action ToggleStateChanged = () => { };
-
- public bool State
- {
- get => state_;
- set
- {
- if (state_ != value)
- {
- state_ = value;
- ToggleStateChanged.Invoke();
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/UnityProject/Assets/Editor/EditorToggle.cs.meta b/UnityProject/Assets/Editor/EditorToggle.cs.meta
deleted file mode 100644
index b9bacf4..0000000
--- a/UnityProject/Assets/Editor/EditorToggle.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 6c627fe9ba84425a92fe457030f5f874
-timeCreated: 1569673031
\ No newline at end of file
diff --git a/UnityProject/Assets/Editor/LevelMeter.cs b/UnityProject/Assets/Editor/LevelMeter.cs
index 1a48caa..76c723a 100644
--- a/UnityProject/Assets/Editor/LevelMeter.cs
+++ b/UnityProject/Assets/Editor/LevelMeter.cs
@@ -3,7 +3,12 @@ using UnityEditor;
namespace cylvester
{
- public class LevelMeter
+ interface ILevelMeter
+ {
+ void Render();
+ }
+
+ public class LevelMeter : ILevelMeter
{
private const int TextureWidth = 1;
private const int TextureHeight = 100;
diff --git a/UnityProject/Assets/Editor/PdBackendEditor.cs b/UnityProject/Assets/Editor/PdBackendEditor.cs
new file mode 100644
index 0000000..88ac102
--- /dev/null
+++ b/UnityProject/Assets/Editor/PdBackendEditor.cs
@@ -0,0 +1,56 @@
+using System;
+using UnityEditor;
+using UnityEngine;
+
+namespace cylvester
+{
+ [CustomEditor(typeof(PdBackend))]
+ public class PdBackendEditor : Editor
+ {
+
+ private IPdBackend pdBackend_;
+ private ILevelMeter[] levelMeters_;
+ private readonly string[] channels = {
+ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"
+ };
+
+ private void Awake()
+ {
+ pdBackend_ = (IPdBackend) target;
+ levelMeters_ = new ILevelMeter[16];
+
+ for (var i = 0; i < 16; ++i)
+ levelMeters_[i] = new LevelMeter(i, pdBackend_.LevelMeterArray);
+ }
+
+ public override void OnInspectorGUI ()
+ {
+ pdBackend_ = (IPdBackend) target;
+
+ GUILayout.Space(5);
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Main Patch");
+ pdBackend_.MainPatch = GUILayout.TextField(pdBackend_.MainPatch, 30);
+ GUILayout.EndHorizontal();
+
+ pdBackend_.NumInputChannels = EditorGUILayout.Popup("Number of input channels", pdBackend_.NumInputChannels, channels);
+ pdBackend_.State = GUILayout.Toggle(pdBackend_.State, "DSP Processing");
+
+ if (!pdBackend_.State)
+ return;
+
+ pdBackend_.UpdateShmem();
+
+ GUILayout.Space(5);
+ GUILayout.BeginHorizontal();
+ foreach (var levelMeter in levelMeters_)
+ levelMeter.Render();
+ GUILayout.EndHorizontal();
+
+ Repaint();
+
+ }
+
+ }
+
+}
diff --git a/UnityProject/Assets/Editor/PdConsole.cs.meta b/UnityProject/Assets/Editor/PdBackendEditor.cs.meta
similarity index 100%
rename from UnityProject/Assets/Editor/PdConsole.cs.meta
rename to UnityProject/Assets/Editor/PdBackendEditor.cs.meta
diff --git a/UnityProject/Assets/Editor/PdConsole.cs b/UnityProject/Assets/Editor/PdConsole.cs
deleted file mode 100644
index c787f81..0000000
--- a/UnityProject/Assets/Editor/PdConsole.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System;
-using UnityEditor;
-
-namespace cylvester
-{
- public class PdConsole : EditorWindow
- {
- private const int NumChannels = 16;
-
- private IEditorToggle dspToggle_;
- private ITogglePresenter togglePresenter_;
- private Action onDspToggleStateChanged_;
- private IPdBackend pdBackend_;
- private LevelMeter[] levelMeters_;
- private PdArray levelMeterArray_;
-
- [MenuItem("SoundVision/Pd console %#p")]
- static void Init()
- {
- var window = (PdConsole)GetWindow(typeof(PdConsole));
- window.Show();
- }
-
- private void Awake()
- {
- var foundObjects = FindObjectsOfType(typeof(PdBackend));
- if (foundObjects.Length != 1)
- return;
-
- pdBackend_ = (IPdBackend) foundObjects[0];
- dspToggle_ = new EditorToggle();
-
- onDspToggleStateChanged_ = () =>
- {
- if (pdBackend_.State)
- {
- levelMeterArray_ = new PdArray("levelmeters", NumChannels);
- for (var i = 0; i < NumChannels; ++i)
- levelMeters_[i] = new LevelMeter(i, levelMeterArray_);
- }
- else
- levelMeterArray_.Dispose();
- };
-
- pdBackend_.StateChanged += onDspToggleStateChanged_;
- togglePresenter_ = new TogglePresenter(dspToggle_, pdBackend_);
- levelMeters_ = new LevelMeter[NumChannels];
-
-
- }
-
- private void OnDestroy()
- {
- levelMeterArray_?.Dispose();
- dspToggle_.ToggleStateChanged -= onDspToggleStateChanged_;
- }
-
- private void OnGUI ()
- {
- if(!ValidatePdBackend())
- return;
-
- EditorGUILayout.Space();
- dspToggle_.State = EditorGUILayout.Toggle("Pure Data Process", dspToggle_.State);
-
- if(!CheckProcessingState())
- return;
-
- EditorGUILayout.Space();
- EditorGUILayout.BeginHorizontal();
-
- levelMeterArray_.Update();
- foreach (var levelMeter in levelMeters_)
- levelMeter.Render();
-
- EditorGUILayout.EndHorizontal();
-
- Repaint();
-
- }
- private bool ValidatePdBackend()
- {
- if (pdBackend_ != null)
- return true;
- EditorGUILayout.LabelField("No Pd backend found in the scene");
- return false;
- }
-
- private bool CheckProcessingState()
- {
- if (pdBackend_.State)
- return true;
- EditorGUILayout.LabelField("Pd process is currently inactive");
- return false;
- }
-
- }
-
-}
diff --git a/UnityProject/Assets/Editor/PdSpectrumBindEditor.cs b/UnityProject/Assets/Editor/PdSpectrumBindEditor.cs
index 6b04cd4..75c30e8 100644
--- a/UnityProject/Assets/Editor/PdSpectrumBindEditor.cs
+++ b/UnityProject/Assets/Editor/PdSpectrumBindEditor.cs
@@ -11,7 +11,6 @@ namespace cylvester
private readonly string[] channels = {
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"
};
- private int selectedSpectrum_;
private ISpectrumGenerator spectrumGenerator_;
private IRectangularSelection rectangularSelection_;
private Rect paintSpace_;
@@ -26,7 +25,6 @@ namespace cylvester
{
var behaviour = (PdSpectrumBind)target;
-
if (Event.current.isMouse && Event.current.button == 0)
{
switch (Event.current.type)
@@ -46,7 +44,7 @@ namespace cylvester
GUILayout.Label("PureData Inputs", EditorStyles.boldLabel);
- selectedSpectrum_ = EditorGUILayout.Popup("Input Channel", selectedSpectrum_, channels);
+ behaviour.channel = EditorGUILayout.Popup("Input Channel", behaviour.channel, channels);
GUILayout.Space(5);
GUILayout.Label("Spectrum Extractor", EditorStyles.boldLabel);
@@ -54,7 +52,8 @@ namespace cylvester
if (Event.current.type == EventType.Repaint)
{
paintSpace_ = paintSpace;
- spectrumGenerator_.Update(ref rectangularSelection_.Selection);
+ behaviour.PdArray.Update();
+ spectrumGenerator_.Update(behaviour.PdArray.Data, ref rectangularSelection_.Selection);
GUI.DrawTexture(paintSpace_, spectrumGenerator_.Spectrum);
}
diff --git a/UnityProject/Assets/Editor/SpectrumGenerator.cs b/UnityProject/Assets/Editor/SpectrumGenerator.cs
index c272682..7ea5518 100644
--- a/UnityProject/Assets/Editor/SpectrumGenerator.cs
+++ b/UnityProject/Assets/Editor/SpectrumGenerator.cs
@@ -5,7 +5,7 @@ namespace cylvester
interface ISpectrumGenerator
{
Texture2D Spectrum { get; }
- void Update(ref Rect selectionRect);
+ void Update(float[] fftData, ref Rect selectionRect);
}
public class SpectrumGenerator : ISpectrumGenerator
@@ -20,20 +20,24 @@ namespace cylvester
height_ = height;
}
- public void Update(ref Rect selectionRect)
+ public void Update(float[] fftData, ref Rect selectionRect)
{
- for (var y = 0; y < texture_.height; y++)
+ for (var x = 0; x < texture_.width; x++)
{
- for (var x = 0; x < texture_.width; x++)
+ var magnitude = fftData[x];
+ for (var y = 0; y < texture_.height; y++)
{
+
var alpha = 0.4f;
if ((selectionRect.x < x && x < (selectionRect.x + selectionRect.width)) &&
(selectionRect.y < y && y < (selectionRect.y + selectionRect.height)))
{
alpha = 1f;
}
- var color = new Color(Random.value, Random.value, Random.value, alpha);
- texture_.SetPixel(x, height_-y, color);
+
+ var color = y > magnitude ? Color.white : Color.gray;
+ color.a = alpha;
+ texture_.SetPixel(x, height_, color);
}
}
texture_.Apply();
diff --git a/UnityProject/Assets/Editor/TogglePresenter.cs b/UnityProject/Assets/Editor/TogglePresenter.cs
deleted file mode 100644
index b6d1f41..0000000
--- a/UnityProject/Assets/Editor/TogglePresenter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-
-namespace cylvester
-{
- public interface ITogglePresenter
- {
- }
-
- public class TogglePresenter : ITogglePresenter, IDisposable
- {
- private readonly IEditorToggle editorToggle_;
-
- private readonly Action onToggleChanged_;
-
- public TogglePresenter(IEditorToggle toggle, IPdBackend pdBackend)
- {
- editorToggle_ = toggle;
-
- onToggleChanged_ = () =>
- {
- pdBackend.State = editorToggle_.State;
- };
-
- editorToggle_.ToggleStateChanged += onToggleChanged_;
-
- }
-
- public void Dispose()
- {
- editorToggle_.ToggleStateChanged -= onToggleChanged_;
- }
- }
-}
\ No newline at end of file
diff --git a/UnityProject/Assets/Editor/TogglePresenter.cs.meta b/UnityProject/Assets/Editor/TogglePresenter.cs.meta
deleted file mode 100644
index d756c1a..0000000
--- a/UnityProject/Assets/Editor/TogglePresenter.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a612dbdf74c948728e59ddede1c1f6d9
-timeCreated: 1569673646
\ No newline at end of file
diff --git a/UnityProject/Assets/Scenes/Examples/PdBackendDemo/PdBackendDemo.unity b/UnityProject/Assets/Scenes/Examples/PdBackendDemo/PdBackendDemo.unity
index 63ea294..faf2bdb 100644
--- a/UnityProject/Assets/Scenes/Examples/PdBackendDemo/PdBackendDemo.unity
+++ b/UnityProject/Assets/Scenes/Examples/PdBackendDemo/PdBackendDemo.unity
@@ -295,7 +295,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 987772532}
- m_Enabled: 0
+ m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3ba69cee3466a304d9d570268f717413, type: 3}
m_Name:
diff --git a/UnityProject/Assets/Scripts/PdConnection/PdBackend.cs b/UnityProject/Assets/Scripts/PdConnection/PdBackend.cs
index 9b4668f..bc75685 100644
--- a/UnityProject/Assets/Scripts/PdConnection/PdBackend.cs
+++ b/UnityProject/Assets/Scripts/PdConnection/PdBackend.cs
@@ -6,40 +6,70 @@ namespace cylvester
{
public interface IPdBackend
{
- bool State { set; get; }
- event Action StateChanged;
+ string MainPatch { get; set; }
+ int NumInputChannels { get; set;}
+
+ bool State { get; set; }
+ void UpdateShmem();
+ IPdArray LevelMeterArray { get; }
}
[ExecuteInEditMode]
public class PdBackend : MonoBehaviour, IPdBackend
{
- [SerializeField] string mainPatch = "";
- [SerializeField] int inchannels = 2;
-
- private Action onToggled_;
+ public string mainPatch = "analyzer.pd";
+ public int inchannels = 2;
+ private Action onToggled_;
+ private PdArray levelMeterArray_;
+ private UdpSender udpSender_;
+ private bool state_;
+
+ private const int NumMaxInputChannels = 16;
+
+ public IPdArray LevelMeterArray => levelMeterArray_;
+
+ public string MainPatch { get => mainPatch; set => mainPatch = value; }
+ public int NumInputChannels { get => inchannels -1; set => inchannels = value + 1; }
+
+ public bool State
+ {
+ get => state_;
+ set
+ {
+ if (state_ == value)
+ return;
+
+ var bytes = new byte[1];
+ bytes[0] = state_ ? (byte)0 : (byte)1;
+ udpSender_.SendBytes(bytes);
+ state_ = value;
+ }
+ }
+
private void OnEnable()
{
PdProcess.Instance.Start(mainPatch, inchannels);
Thread.Sleep(500);
+
+ levelMeterArray_ = new PdArray("levelmeters", NumMaxInputChannels);
+ udpSender_ = new UdpSender("127.0.0.1", 54637);
}
private void OnDisable()
{
PdProcess.Instance.Stop();
+ levelMeterArray_?.Dispose();
+ udpSender_?.Dispose();
}
- public bool State
+ public void UpdateShmem()
{
- set
- {
- enabled = value;
- if(StateChanged != null)
- StateChanged.Invoke();
- }
- get => enabled;
+ levelMeterArray_.Update();
+
}
+
+
- public event Action StateChanged;
}
}
\ No newline at end of file
diff --git a/UnityProject/Assets/Scripts/PdConnection/PdProcess.cs b/UnityProject/Assets/Scripts/PdConnection/PdProcess.cs
index 3538225..1909f52 100644
--- a/UnityProject/Assets/Scripts/PdConnection/PdProcess.cs
+++ b/UnityProject/Assets/Scripts/PdConnection/PdProcess.cs
@@ -16,9 +16,10 @@ namespace cylvester
private static PdProcess instance_ = null;
private Process pdProcess_;
- private PdProcess() // cannot be instantiate normally
+ private PdProcess()
{
- }
+ } // cannot be instantiate normally
+
public static PdProcess Instance => instance_ ?? (instance_ = new PdProcess());
@@ -40,7 +41,6 @@ namespace cylvester
throw new Exception("Pd process failed to start");
}
Debug.Log("Pd Process started");
-
}
public void Stop()
@@ -49,6 +49,5 @@ namespace cylvester
pdProcess_ = null;
Debug.Log("Pd Process stopped");
}
-
}
}
\ No newline at end of file
diff --git a/UnityProject/Assets/Scripts/PdConnection/PdSpectrumBind.cs b/UnityProject/Assets/Scripts/PdConnection/PdSpectrumBind.cs
index b985f1d..2c78576 100644
--- a/UnityProject/Assets/Scripts/PdConnection/PdSpectrumBind.cs
+++ b/UnityProject/Assets/Scripts/PdConnection/PdSpectrumBind.cs
@@ -4,28 +4,30 @@ namespace cylvester
{
public interface IPdSpectrumBind
{
+ IPdArray PdArray { get; }
float TrimmedEnergy { get; }
}
+ [ExecuteInEditMode]
public class PdSpectrumBind : MonoBehaviour, IPdSpectrumBind
{
public int channel;
public int startBin;
public int endBin;
- [SerializeField] private float topClip;
- [SerializeField] private float bottomClip;
- [SerializeField] private float trimmedEnergy = 0f;
-
+ public float topClip;
+ public float bottomClip;
+ public float trimmedEnergy = 0f;
+
public float TrimmedEnergy => trimmedEnergy;
- private void Start()
+ private PdArray pdArray_;
+ public IPdArray PdArray => pdArray_;
+
+ private void Awake()
{
-
+ pdArray_ = new PdArray("fft_" + channel, 512);
}
- private void Update()
- {
-
- }
+
}
}
\ No newline at end of file
diff --git a/UnityProject/Assets/Scripts/PdConnection/UdpSender.cs b/UnityProject/Assets/Scripts/PdConnection/UdpSender.cs
new file mode 100644
index 0000000..f18b19f
--- /dev/null
+++ b/UnityProject/Assets/Scripts/PdConnection/UdpSender.cs
@@ -0,0 +1,34 @@
+using System;
+
+namespace cylvester
+{
+ interface IUdpSender : IDisposable
+ {
+ void SendBytes(byte[] data);
+ }
+
+ public class UdpSender : IDisposable
+ {
+ private readonly string remoteHost_;
+ private readonly int remotePort_;
+ private System.Net.Sockets.UdpClient udpClient_;
+
+ public UdpSender(string remoteHost, int remotePort)
+ {
+ remoteHost_ = remoteHost;
+ remotePort_ = remotePort;
+ udpClient_ = new System.Net.Sockets.UdpClient();
+ }
+
+ public void SendBytes(byte[] data)
+ {
+ udpClient_.Send(data, data.Length, remoteHost_, remotePort_);
+ }
+
+ public void Dispose()
+ {
+ udpClient_.Close();
+ udpClient_ = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/UnityProject/Assets/Scripts/PdConnection/UdpSender.cs.meta b/UnityProject/Assets/Scripts/PdConnection/UdpSender.cs.meta
new file mode 100644
index 0000000..259ddba
--- /dev/null
+++ b/UnityProject/Assets/Scripts/PdConnection/UdpSender.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1f65f75415684cef9649e0eaa0fcbfc7
+timeCreated: 1569772195
\ No newline at end of file
diff --git a/UnityProject/Assets/StreamingAssets/pd/patch/analyzer.pd b/UnityProject/Assets/StreamingAssets/pd/patch/analyzer.pd
index a0b9edb..0298cc0 100644
--- a/UnityProject/Assets/StreamingAssets/pd/patch/analyzer.pd
+++ b/UnityProject/Assets/StreamingAssets/pd/patch/analyzer.pd
@@ -1,5 +1,4 @@
-#N canvas 550 301 727 406 10;
-#X msg 307 54 \; pd dsp 1;
+#N canvas 1334 361 827 452 10;
#X obj 187 61 loadbang;
#X obj 80 273 adc~ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16;
#N canvas 0 50 450 250 (subpatch) 0;
@@ -72,7 +71,7 @@
#X obj 45 42 r shmemupdate;
#X obj 42 105 table levelmeters 16;
#X connect 1 0 0 0;
-#X restore 608 25 pd shmems;
+#X restore 654 34 pd shmems;
#N canvas 763 290 686 441 window 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array hann 1024 float 1;
@@ -211,32 +210,39 @@
0.000244498 0.000150442 9.39965e-005 3.75807e-005 1.87755e-005;
#X coords 0 1 1023 0 300 100 1 0 0;
#X restore 39 32 graph;
-#X restore 611 47 pd window;
-#X connect 1 0 0 0;
-#X connect 1 0 5 0;
+#X restore 657 56 pd window;
+#X msg 478 110 \; pd dsp \$1;
+#X msg 274 17 test;
+#X obj 479 83 netreceive -u -b 54637;
+#N canvas 927 320 450 300 udpmessage 0;
+#X text 60 33 0 ... dsp;
+#X restore 660 100 pd udpmessage;
+#X connect 0 0 4 0;
+#X connect 0 0 7 0;
+#X connect 0 0 16 0;
#X connect 1 0 8 0;
-#X connect 2 0 9 0;
-#X connect 2 1 9 1;
-#X connect 2 2 9 2;
-#X connect 2 3 9 3;
-#X connect 2 4 9 4;
-#X connect 2 5 9 5;
-#X connect 2 6 9 6;
-#X connect 2 7 9 7;
-#X connect 2 8 9 8;
-#X connect 2 9 9 9;
-#X connect 2 10 9 10;
-#X connect 2 11 9 11;
-#X connect 2 12 9 12;
-#X connect 2 13 9 13;
-#X connect 2 14 9 14;
-#X connect 2 15 9 15;
-#X connect 5 0 4 0;
-#X connect 7 0 6 1;
+#X connect 1 1 8 1;
+#X connect 1 2 8 2;
+#X connect 1 3 8 3;
+#X connect 1 4 8 4;
+#X connect 1 5 8 5;
+#X connect 1 6 8 6;
+#X connect 1 7 8 7;
+#X connect 1 8 8 8;
+#X connect 1 9 8 9;
+#X connect 1 10 8 10;
+#X connect 1 11 8 11;
+#X connect 1 12 8 12;
+#X connect 1 13 8 13;
+#X connect 1 14 8 14;
+#X connect 1 15 8 15;
+#X connect 4 0 3 0;
+#X connect 6 0 5 1;
+#X connect 6 0 5 0;
+#X connect 6 0 8 0;
+#X connect 6 1 7 0;
#X connect 7 0 6 0;
-#X connect 7 0 9 0;
-#X connect 7 1 8 0;
-#X connect 8 0 7 0;
+#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
-#X connect 12 0 13 0;
+#X connect 17 0 15 0;
diff --git a/UnityProject/Assets/StreamingAssets/pd/patch/core.pd b/UnityProject/Assets/StreamingAssets/pd/patch/core.pd
index 03a019d..ef19537 100644
--- a/UnityProject/Assets/StreamingAssets/pd/patch/core.pd
+++ b/UnityProject/Assets/StreamingAssets/pd/patch/core.pd
@@ -6,8 +6,11 @@
#X obj 57 239 tabwrite levelmeters;
#X obj 85 135 spectrum \$1;
#X obj 229 240 table fft_\$1 512;
+#X obj 228 190 r shmemupdate;
+#X obj 228 216 shmem fft_\$1 512;
#X connect 0 0 4 0;
#X connect 1 0 0 0;
#X connect 1 0 5 0;
#X connect 2 0 3 0;
#X connect 3 0 4 1;
+#X connect 7 0 8 0;
diff --git a/UnityProject/ProjectSettings/ProjectSettings.asset b/UnityProject/ProjectSettings/ProjectSettings.asset
index 210d654..e6c4fa8 100644
--- a/UnityProject/ProjectSettings/ProjectSettings.asset
+++ b/UnityProject/ProjectSettings/ProjectSettings.asset
@@ -527,7 +527,16 @@ PlayerSettings:
webGLCompressionFormat: 1
webGLLinkerTarget: 1
webGLThreadsSupport: 0
- scriptingDefineSymbols: {}
+ scriptingDefineSymbols:
+ 1: EXTOSC
+ 7: EXTOSC
+ 13: EXTOSC
+ 19: EXTOSC
+ 21: EXTOSC
+ 25: EXTOSC
+ 26: EXTOSC
+ 27: EXTOSC
+ 28: EXTOSC
platformArchitecture: {}
scriptingBackend:
Standalone: 0