<div dir="ltr"><div>I'm glad you asked! It's done in a slightly convoluted, potentially fragile, possibly un-scalable way.</div><div><br></div><div>When a user loads a .pd file, pre-proccessing is done on the .pd text to generate _two_ new .pd files, one for execution, and one for display The two communicate with each other. </div><div>This split is done at:</div><div><a href="https://github.com/monkeyswarm/MobMuPlat/blob/master/MobMuPlat-iOS/MobMuPlat/PdGui/MMPPdPatchDisplayUtils.m#L16">https://github.com/monkeyswarm/MobMuPlat/blob/master/MobMuPlat-iOS/MobMuPlat/PdGui/MMPPdPatchDisplayUtils.m#L16</a></div><div><br></div><div>1) The "engine" patch is the patch that is actually opened by libpd and generates audio. The processing replaces each gui object with a Pd abstraction I made (termed a "shim" in the code) that has a send/receive relationship (with an auto-generated handle) with the MobMuPlat- layer GUI code.</div><div>So a line (this is the toggle in the "MMPExamples-NativeGUI.pd" file).</div><div>#X obj 253 440 tgl 45 0 /demoToggleSend /demoToggleReceive I'm_using_send_and_receive</div><div>becomes</div><div>#X obj 253 440 MMPPdGuiFiles/MMPPdGuiShim 15-gui-send 15-gui-rec /demoToggleSend /demoToggleReceive;</div><div>"15-gui-send" and "15-gui-receive" are the handles for send/receive with the user-visible gui object.</div><div>Note that existing send/receive behavior is kept intact (with /demoToggleSend and /demoToggleReceive)</div><div>There's a few flavors of this shim (in <a href="http://github.com/monkeyswarm/MobMuPlat/tree/master/MobMuPlat-iOS/MobMuPlat/PdGui">github.com/monkeyswarm/MobMuPlat/tree/master/MobMuPlat-iOS/MobMuPlat/PdGui</a>): a main one for most GUI objects, a special one for a "bang", and a special one for a message object.</div><div><br></div><div>2) The "GUI" patch is a simpler process, it just, for every GUI object, sets the send/receive handles to the same auto-generated handles generated for the matching "engine" shim that should communicate with it. After processing, this pd patch is then read and rendered to native-app-layer GUI widgets.</div><div><br></div><div>I've tested this to work for using the "internal" (object property) send/receive labels, attaching to send/receive objects, using "set", one-to-many and many-to-one communication. However there's probably some use case I've overlooked (or some fun way to make it stack overflow when it shouldn't). Let me know...!</div><div><br></div><div>Separate questions for everyone: </div><div>1) you may notice that the current version does not render connection lines. While the patch text lists all the connections (and inlet/outlet indices for them), the app doesn't know how many inlets/outlets each object has. I haven't delved too deeply for it yet, but is there an interface somewhere that will return that information? e.g. here's an atom line for an object and its parameters, tell me how many inlets/outlets. If so, then connection lines could be rendered correctly. (Without it, I could still render conneciton lines, but if there are empty inlets/outlets after a connection then they would not be shown.)</div><div><br></div><div>2) Is showing the full set of patch objects (and, eventually, connection lines) even desirable? (Rather than just rendering the gui objects). I'm thinking of an option that would switch their display on/off. (But leave GUI objects, including message boxes)</div><div><br></div><div>Thanks for input, Dan I.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 10:55 PM, Dan Wilcox <span dir="ltr"><<a href="mailto:danomatika@gmail.com" target="_blank">danomatika@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 style="word-wrap:break-word">How are you doing this?<div><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">--------<br>Dan Wilcox<br><a href="https://twitter.com/danomatika" target="_blank">@danomatika</a><br><a href="http://danomatika.com" target="_blank">danomatika.com</a><br><div><a href="http://robotcowboy.com" target="_blank">robotcowboy.com</a></div></div>

</div>
<br><div><blockquote type="cite"><div>On Jan 7, 2016, at 9:19 AM, <a href="mailto:pd-list-request@lists.iem.at" target="_blank">pd-list-request@lists.iem.at</a> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);float:none;display:inline!important">- Unlike PdParty/PdDroidParty, you don't need to define send/receive values for every GUI object. Just drop in your PureData patch, with normal object connections, and it should work. (send/receive communication should also still work as well).</span></div></blockquote></div><br></div></div></blockquote></div><br></div>