Exemple #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);
        }
Exemple #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);
    }
Exemple #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);
     }
 }
 /// <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();
 }
Exemple #5
0
 public void NotNullOnExistingTest()
 {
     using (Patch patch = _pd.LoadPatch(@"../../test_csharp.pd")) {
         Assert.NotNull(patch);
     }
 }
Exemple #6
0
 public void Init()
 {
     _pd    = new Pd(_inputs, _outputs, _sampleRate);
     _patch = _pd.LoadPatch(@"../../test_csharp.pd");
     _pd.Start();
 }