<div dir="ltr">Hello all,<div>This is wonderful, thank you for contributing to this thread. Glad to see that Unity + PureData is active:</div><div><br></div><div>@wing: I also put together a unity+pd integration example; it has a bouncing ball withs sonification done in Pd; works on Android!  <a href="https://github.com/cmuartfab/libpd4unity-starter">https://github.com/cmuartfab/libpd4unity-starter</a>  I will take a look at your work also, thank you for sharing that.</div><div><br></div><div>@scott: I also tried Kalimba, but i have massive latency on Android, on the order of 300-500ms.  Did you have this experience?</div><div><br></div><div>@scott+@wing: can you give me an example or two of when you may need multiple instances of LibPd in one's unity project? Couldnt you just make a more complex Pd patch that has all the things you want happening in it?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 24, 2016 at 5:51 PM, Wing Sang Wong <span dir="ltr"><<a href="mailto:wilsoncomposer@gmail.com" target="_blank">wilsoncomposer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Scott,<br><br></div>The way I handle multiple instances is to open new patches via C# and store the dollar zero variable in a game object.<br><br>The PdAudioSource component can be attached to a prefab and you can instantiated the prefab via C#. PdAudioSource also stores the dollar zero variable of the associated patch, so you can directly send messages to a particular instance by calling methods in PdAudioSource. However, all send and receive objects in your patches need to start with a dollar zero (e.g. [send $0-Frequency], [receive $0-isPlaying]). <br><br>For audio signals, all patches need to have appropriate [throw~ ] objects (e.g. [throw~ out5] [throw~ out6]) in order to be heard. Audio signals from all instances will go through the [catch~ ] object in pdManager.pd, which is mapped to the Unity audio mixer. Getting audio input from Unity to libpd is a little bit tricky in this case. If someone need audio input from Unity, one might modify the OnAudioFilterRead method in PdStereo.cs.<br><br></div><div>My project isn't complete and I always welcome for suggestions or comments.<br></div><div><br></div>Best,<br></div>Wing<br></div>
<br>______________________________<wbr>_________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/<wbr>listinfo/pd-list</a><br>
<br></blockquote></div><br></div>