Ejemplo n.º 1
0
        public virtual void LoadbangTest()
        {
            _pd.Messaging.Bind("foo");
            string value = "";

            _pd.Messaging.Print += delegate(object sender, PrintEventArgs e) {
                value += e.Symbol.Value;
            };
            using (Patch patch = _pd.LoadPatch(@"../../test_csharp.pd")) {
                ;
            }
            Assert.AreEqual("print: hello\n", value);
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Function to load patch in pure data
    /// </summary>
    /// <param name="name">Is a full path of the .pd patch to load. </param>
    /// <returns> References ID of patch in pure data. </returns>
    public int OpenNewPdPatch(string name)
    {
        Patch patch = PD.LoadPatch(name);

        _loadedPatches.Add(patch);
        return(patch.DollarZero);
    }
Ejemplo n.º 3
0
 //Set up the instance of Pure-data
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
         PD = new Pd(numberOfInputChannel, numberOfOutputChannel, AudioSettings.outputSampleRate);
         //Uses this to get prints of Pure Data
         PD.Messaging.Print += delegate(object sender, PrintEventArgs e) {
             Debug.Log(e.Symbol.Value);
         };
         manager = PD.LoadPatch(APIPath("pdManager.pd"));
         if (MixerChannel == null)
         {
             Debug.LogWarning("Not found mixer channel...");
         }
         createPdMixer();
         if (pdDsp)
         {
             PD.Start();
         }
     }
     else if (!Instance.Equals((object)this))
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets up communication with libPd.
 /// </summary>
 void SetUpPd()
 {
     // Init new Pd instance
     _pd = new Pd(0, 2, SampleRate);
     // Open Pd patch
     _patch = _pd.LoadPatch("../../../pd/test.pd");
     // Subscribe to receiver
     _pd.Messaging.Float += Pd_Float;
     _pd.Messaging.Bind(CursorReceiver);
     // Start audio
     _pd.Start();
 }
Ejemplo n.º 5
0
 public void NotNullOnExistingTest()
 {
     using (Patch patch = _pd.LoadPatch(@"../../test_csharp.pd")) {
         Assert.NotNull(patch);
     }
 }
Ejemplo n.º 6
0
 public void Init()
 {
     _pd    = new Pd(_inputs, _outputs, _sampleRate);
     _patch = _pd.LoadPatch(@"../../test_csharp.pd");
     _pd.Start();
 }