<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Also, to follow up, I’ve adapted the multiple instance C example to C++ using ofxPd & openFrameworks and I’m seeing basically the same output. People have been chomping at the bit for this, so we’ll let it loose and see what happens next. :D<div class=""><br class=""></div><div class=""><a href="https://github.com/danomatika/ofxPd/tree/master/pdMultiExample/src" class="">https://github.com/danomatika/ofxPd/tree/master/pdMultiExample/src</a><div class=""><br class=""><div class="">
--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com" class="">danomatika.com</a><br class=""><div class=""><a href="http://robotcowboy.com" class="">robotcowboy.com</a></div>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 27, 2015, at 5:17 PM, Dan Wilcox <<a href="mailto:danomatika@gmail.com" class="">danomatika@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Is there any major overhead with pd_setinstance()? I ask as I’m thinking how to incorporate it into the C++ wrapper where each PdBase C++ instance refers to a separate pd instance, so that would basically mean alot of pd_setinstance() calls, basically one in every pdBase member function.<div class=""><br class=""><div class="">
--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a><br class=""><div class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a></div>

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 26, 2015, at 3:00 PM, Dan Wilcox <<a href="mailto:danomatika@gmail.com" class="">danomatika@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Ok, now tracking 0.46 branch. Thanks.<div class=""><br class=""><div class="">
--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a><br class=""><div class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a></div>

</div>
<br class=""><div style="" class=""><blockquote type="cite" class=""><div class="">On Apr 24, 2015, at 10:25 PM, Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Finally but the bullet and tried this...</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I made a branch, 0.46, adn committeed that and one other minor bug fix.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">The commit is 905695a350bf44d906fbb8cde905fa0b81d12b57</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Too early in the game to make a 0.46-7 but I think if you track the 0.46 branch</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">you'll be OK.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">cheers</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Miller</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Thu, Apr 23, 2015 at 12:01:49AM -0400, Dan Wilcox wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Actually yeah, looks good. Is there anyway this particular patch can be backported to the 0.46-6 release? Or will there be a 0.46-7 coming up soon? I ask because I’m having libpd checkout pure-data release tags. Not a huge deal if not, since this is still in testing.<br class=""><br class="">Just to confirm:<br class=""><br class="">Current git log for the pure-data sources I’m using:<br class=""><br class=""><blockquote type="cite" class="">danomatika:pure-data dano$ git log<br class="">commit 35151c473827260c86cc864cc4cd058b24e67139<br class="">Author: Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>><br class="">Date:   Wed Apr 22 14:06:36 2015 -0700<br class=""><br class="">   make list of signals local to a pd instance to fix libpd crasher<br class=""></blockquote><br class=""><br class="">Performed:<br class=""><br class="">cd libpd<br class="">make clobber<br class="">make<br class="">cd samples/c/pdtest_multi<br class="">make clobber<br class="">make<br class="">./pdtest_multi test.pd ./<br class=""><br class="">Got:<br class=""><br class=""><blockquote type="cite" class="">start 80c04a90<br class="">stop 80c04a90<br class="">continue start 80c04a90<br class="">stop 80c04a90<br class="">print: 0<br class="">1003-frequency: bang<br class="">start 80c04a90<br class="">stop 80c04a90<br class="">continue start 80c04a90<br class="">start 80c04db0<br class="">stop 80c04db0<br class="">continue start 80c04db0<br class="">stop 80c04db0<br class="">print: 0<br class="">1004-frequency: bang<br class="">start 80c04db0<br class="">stop 80c04db0<br class="">continue start 80c04db0<br class="">1003-frequency: 1<br class="">1004-frequency: 2<br class="">1.000000 1.000000 0.999999 0.999999 0.999998 0.999998 0.999997 0.999997<span class="Apple-converted-space"> </span><br class="">1.000000 1.000000 0.999998 0.999998 0.999996 0.999996 0.999995 0.999995<span class="Apple-converted-space"> </span><br class="">print: 1<br class="">0.999944 0.999944 0.999943 0.999943 0.999942 0.999942 0.999941 0.999941<span class="Apple-converted-space"> </span><br class="">print: 1<br class="">0.999815 0.999815 0.999810 0.999810 0.999804 0.999804 0.999799 0.999799<span class="Apple-converted-space"> </span><br class="">print: 2<br class="">print: 2<br class=""></blockquote><br class="">I got the same response with building libpd with & without -03.<br class=""><br class="">--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a> <<a href="http://danomatika.com/" class="">http://danomatika.com/</a>><br class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a> <<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>><br class=""><blockquote type="cite" class="">On Apr 22, 2015, at 8:27 PM, Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>> wrote:<br class=""><br class="">Hmm... and (just checking) - you did a make clean and rebuilt everything?<br class="">The pd_instance structure changed....<br class=""><br class="">I can't get it to fail over here any more...<br class=""><br class="">cheers<br class="">Miller<br class=""><br class="">On Wed, Apr 22, 2015 at 05:30:20PM -0400, Dan Wilcox wrote:<br class=""><blockquote type="cite" class="">Thanks. Unfortunately still a crash, but now at a different place. I also confirmed that it still runs fine when libpd is compiled with -O3 aka make DEBUG=true.<br class=""><br class="">#0  signal_cleanup [inlined] () at /Users/dano/src/pd/libpd/pure-data/src/d_ugen.c:364<br class="">#1  0x0000000100026680 in ugen_stop () at d_ugen.c:562<br class="">#2  0x000000010002670e in ugen_start () at d_ugen.c:569<br class="">#3  0x000000010003197e in glob_dsp (dummy=0x100102e00, s=0x0, argc=<value temporarily unavailable, due to optimizations>, argv=0x100102e20) at g_canvas.c:1086<br class="">#4  0x000000010006d286 in pd_typedmess (x=0x1000a5760, s=0x0, argc=1055232, argv=0x100102e20) at m_class.c:699<br class="">#5  0x0000000100096fb8 in libpd_message [inlined] () at /Users/dano/src/pd/libpd/libpd_wrapper/z_libpd.c:236<br class="">#6  0x0000000100096fb8 in libpd_finish_message (recv=<value temporarily unavailable, due to optimizations>, msg=0x100000f67 "dsp") at z_libpd.c:562<br class="">#7  0x0000000100000b8f in main ()<br class=""><br class="">In detail:<br class=""><br class="">#0  signal_cleanup [inlined] () at /Users/dano/src/pd/libpd/pure-data/src/d_ugen.c:364<br class="">364<span class="Apple-tab-span" style="white-space: pre;">     </span><span class="Apple-converted-space"> </span>       pd_this->pd_signals = sig->s_nextused;<br class="">(gdb) frame 1<br class="">#1  0x0000000100026680 in ugen_stop () at d_ugen.c:562<br class="">364<span class="Apple-tab-span" style="white-space: pre;">   </span><span class="Apple-converted-space"> </span>       pd_this->pd_signals = sig->s_nextused;<br class="">(gdb) frame 2<br class="">#2  0x000000010002670e in ugen_start () at d_ugen.c:569<br class="">569<span class="Apple-tab-span" style="white-space: pre;">  </span><span class="Apple-converted-space"> </span>   ugen_stop();<br class="">(gdb) frame 3<br class="">#3  0x000000010003197e in glob_dsp (dummy=0x100102e00, s=0x0, argc=<value temporarily unavailable, due to optimizations>, argv=0x100102e20) at g_canvas.c:1086<br class="">1086<span class="Apple-tab-span" style="white-space: pre;">    </span><span class="Apple-converted-space"> </span>   ugen_start();<br class="">(gdb) frame 4<br class="">#4  0x000000010006d286 in pd_typedmess (x=0x1000a5760, s=0x0, argc=1055232, argv=0x100102e20) at m_class.c:699<br class="">699<span class="Apple-tab-span" style="white-space: pre;">  </span><span class="Apple-converted-space"> </span>           else (*((t_messgimme)(m->me_fun)))(x, s, argc, argv);<br class="">(gdb) frame 5<br class="">#5  0x0000000100096fb8 in libpd_message [inlined] () at /Users/dano/src/pd/libpd/libpd_wrapper/z_libpd.c:236<br class="">236<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span> pd_typedmess(dest, gensym(msg), n, v);<br class="">(gdb) frame 6<br class="">#6  0x0000000100096fb8 in libpd_finish_message (recv=<value temporarily unavailable, due to optimizations>, msg=0x100000f67 "dsp") at z_libpd.c:562<br class="">236<span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-converted-space"> </span> pd_typedmess(dest, gensym(msg), n, v);<br class="">(gdb) frame 7<br class="">#7  0x0000000100000b8f in main ()<br class=""><br class="">--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a><span class="Apple-converted-space"> </span><<a href="http://danomatika.com/" class="">http://danomatika.com/</a>> <<a href="http://danomatika.com/" class="">http://danomatika.com/</a><span class="Apple-converted-space"> </span><<a href="http://danomatika.com/" class="">http://danomatika.com/</a>>><br class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a><span class="Apple-converted-space"> </span><<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>> <<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a><span class="Apple-converted-space"> </span><<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>>><br class=""><blockquote type="cite" class="">On Apr 22, 2015, at 5:12 PM, Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>> wrote:<br class=""><br class="">OK ... I think I fixed it... pull newest from git and try.<br class=""><br class="">thanks<br class="">M<br class=""><br class="">On Wed, Apr 22, 2015 at 12:35:10PM -0700, Miller Puckette wrote:<br class=""><blockquote type="cite" class="">Aha - sometimes things crash on OSX because of "minor" buffer overruns that<br class="">linux just soldiers past.  I'll break out a mac and try again...<br class=""><br class="">M<br class=""><br class="">On Wed, Apr 22, 2015 at 03:03:09AM -0400, Dan Wilcox wrote:<br class=""><blockquote type="cite" class="">Weird. It crashes for me on OSX when libpd is built with -O3 and the program is built with or without -O3.<br class=""><br class="">*Note: I just finished reorganizing the libpd samples by language name. If you do a pull, the multi instance test is now located in samples/c/pdtest_multi<span class="Apple-converted-space"> </span><br class=""><br class="">Rebuilding and running it again yields:<br class=""><br class="">Program received signal EXC_BAD_ACCESS, Could not access memory.<br class="">Reason: 13 at address: 0x0000000000000000<br class="">outlet_float (x=0x3f7ffc2a3f7ffc38, f=0) at m_obj.c:388<br class="">388<span class="Apple-tab-span" style="white-space: pre;"> </span><span class="Apple-converted-space"> </span>   for (oc = x->o_connections; oc; oc = oc->oc_next)<br class=""><br class="">#0  outlet_float (x=0x3f7ffc2a3f7ffc38, f=0) at m_obj.c:388<br class="">#1  0x000000010006f0b9 in outlet_bang (x=<value temporarily unavailable, due to optimizations>) at m_obj.c:363<br class="">#2  0x00000001000953f9 in metro_tick (x=0x10021ad90) at x_time.c:162<br class="">#3  0x0000000100071010 in sched_tick () at m_sched.c:418<br class="">#4  0x0000000100096733 in libpd_process_float (ticks=1, inBuffer=<value temporarily unavailable, due to optimizations>, outBuffer=<value temporarily unavailable, due to optimizations>) at z_libpd.c:185<br class="">#5  0x0000000100000d67 in main ()<br class=""><br class="">some frame detail:<br class=""><br class="">(gdb) frame 0<br class="">#0  outlet_float (x=0x3f7ffc2a3f7ffc38, f=0) at m_obj.c:388<br class="">388<span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-converted-space"> </span>   for (oc = x->o_connections; oc; oc = oc->oc_next)<br class="">(gdb) frame 1<br class="">#1  0x000000010006f0b9 in outlet_bang (x=<value temporarily unavailable, due to optimizations>) at m_obj.c:363<br class="">363<span class="Apple-tab-span" style="white-space: pre;">  </span><span class="Apple-converted-space"> </span>       pd_bang(oc->oc_to);<br class="">(gdb) frame 2<br class="">#2  0x00000001000953f9 in metro_tick (x=0x10021ad90) at x_time.c:162<br class="">162<span class="Apple-tab-span" style="white-space: pre;">   </span><span class="Apple-converted-space"> </span>   outlet_bang(x->x_obj.ob_outlet);<br class="">(gdb) frame 3<br class="">#3  0x0000000100071010 in sched_tick () at m_sched.c:418<br class="">418<span class="Apple-tab-span" style="white-space: pre;">  </span><span class="Apple-converted-space"> </span>       (*c->c_fn)(c->c_owner);<br class="">(gdb) frame 4<br class="">#4  0x0000000100096733 in libpd_process_float (ticks=1, inBuffer=<value temporarily unavailable, due to optimizations>, outBuffer=<value temporarily unavailable, due to optimizations>) at z_libpd.c:185<br class="">185<span class="Apple-tab-span" style="white-space: pre;">   </span><span class="Apple-converted-space"> </span> PROCESS(,)<br class="">(gdb) frame 5<br class="">#5  0x0000000100000d67 in main ()<br class=""><br class="">--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a> <<a href="http://danomatika.com/" class="">http://danomatika.com/</a>><br class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a> <<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>><br class=""><blockquote type="cite" class="">On Apr 22, 2015, at 12:15 AM, Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>> wrote:<br class=""><br class="">I think it was optimized since I had already made libpd, not from the<br class="">sampes/.../multi directory.  But anyhow I re-did it as you suggest with<br class="">the same result....  can't make it fail...<br class=""><br class="">cheers<br class="">M<br class=""><br class="">On Wed, Apr 22, 2015 at 12:03:28AM -0400, Dan Wilcox wrote:<br class=""><blockquote type="cite" class="">You ran it without the optimizations since I added the debug option. Remove DEBUG=true from line 33 in the Makefile: <a href="https://github.com/libpd/libpd/blob/master/samples/c_samples/multi/Makefile#L33" class="">https://github.com/libpd/libpd/blob/master/samples/c_samples/multi/Makefile#L33</a> <<a href="https://github.com/libpd/libpd/blob/master/samples/c_samples/multi/Makefile#L33" class="">https://github.com/libpd/libpd/blob/master/samples/c_samples/multi/Makefile#L33</a>> and do a full clean before rebuilding:<br class=""><br class="">cd ../../../ && make clobber && cd - && make<br class="">--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a> <<a href="http://danomatika.com/" class="">http://danomatika.com/</a>><br class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a> <<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>><br class=""><blockquote type="cite" class="">On Apr 21, 2015, at 11:57 PM, Miller Puckette <<a href="mailto:msp@ucsd.edu" class="">msp@ucsd.edu</a>> wrote:<br class=""><br class="">Hi Dan et al -<br class=""><br class="">I gave this a try:<br class=""><br class="">git clone <a href="https://github.com/libpd/libpd.git" class="">https://github.com/libpd/libpd.git</a><br class=""><br class="">[copies pd sources into libpd/pure-data]<br class=""><br class="">cd libpd<br class="">make<br class=""><br class="">cd samples/c_samples/multi/<br class="">make<br class="">./multi_pdtest multi_test.pd `pwd`<br class=""><br class="">and got output:<br class=""><br class="">print: 0<br class="">1003-frequency: bang<br class="">print: 0<br class="">1004-frequency: bang<br class="">1003-frequency: 1<br class="">1004-frequency: 2<br class="">1.000000 1.000000 0.999999 0.999999 0.999998 0.999998 0.999997 0.999997<span class="Apple-converted-space"> </span><br class="">1.000000 1.000000 0.999998 0.999998 0.999996 0.999996 0.999995 0.999995<span class="Apple-converted-space"> </span><br class="">print: 1<br class="">0.999944 0.999944 0.999943 0.999943 0.999942 0.999942 0.999941 0.999941<span class="Apple-converted-space"> </span><br class="">print: 1<br class="">0.999815 0.999815 0.999810 0.999810 0.999804 0.999804 0.999799 0.999799<span class="Apple-converted-space"> </span><br class="">print: 2<br class="">print: 2<br class=""><br class="">This on Fedora 21, 64 bits, Intel hardware.  <br class=""><br class="">I guess something subtle is happening, maybe in Pd and unrelated to libpd?<br class=""><br class="">cheers<br class="">Miller<br class=""><br class="">On Tue, Apr 21, 2015 at 06:00:15PM -0400, Dan Wilcox wrote:<br class=""><blockquote type="cite" class="">Howdy Miller,<br class=""><br class="">Following up from the dev list last year, I added your multi instance test to the c samples included with libpd: <a href="https://github.com/libpd/libpd/tree/master/samples/c_samples/multi" class="">https://github.com/libpd/libpd/tree/master/samples/c_samples/multi</a> <<a href="https://github.com/libpd/libpd/tree/master/samples/c_samples/multi" class="">https://github.com/libpd/libpd/tree/master/samples/c_samples/multi</a>><br class=""><br class="">The one thing I want to double check is the changes to z_libpd.c you mentioned in <a href="http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html:" class="">http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html:</a> <<a href="http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html:" class="">http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html:</a>><br class=""><br class=""><blockquote type="cite" class="">Here's how I modified libpd_wrapper/z_libpd.c:<br class=""><br class="">55d54<br class=""><   sys_time = 0;<br class="">110c109<br class=""><   sched_tick(sys_time + sys_time_per_dsp_tick);<br class="">---<br class=""><blockquote type="cite" class=""><br class=""></blockquote>sched_tick();<br class=""><br class="">130c129<br class=""><     sched_tick(sys_time + sys_time_per_dsp_tick); \<br class="">---<br class=""><blockquote type="cite" class=""><br class=""></blockquote>sched_tick(); \<br class=""></blockquote><br class=""><br class="">Currently, that line is <a href="https://github.com/libpd/libpd/blob/master/libpd_wrapper/z_libpd.c#L171" class="">https://github.com/libpd/libpd/blob/master/libpd_wrapper/z_libpd.c#L171</a> <<a href="https://github.com/libpd/libpd/blob/master/libpd_wrapper/z_libpd.c#L171" class="">https://github.com/libpd/libpd/blob/master/libpd_wrapper/z_libpd.c#L171</a>> and I’m getting a segfault if I replace it with sched_tick(); AND set gcc optimization to -O3<br class=""><br class="">Here’s a gdb backtrace:<br class=""><br class="">#0  0x0000000100091f2f in outlet_float (x=0x3f7ffc2a3f7ffc38, f=0.999937057) at m_obj.c:388<br class="">#1  0x00000001000ac572 in pdfloat_bang (x=0x10021ac20) at x_connective.c:89<br class="">#2  0x0000000100093d58 in pd_bang (x=0x10021ac20) at m_pd.c:267<br class="">#3  0x0000000100091ddd in outlet_bang (x=0x10021ae20) at m_obj.c:363<br class="">#4  0x00000001000c45e4 in metro_tick (x=0x10021ada0) at x_time.c:162<br class="">#5  0x0000000100095021 in sched_tick () at m_sched.c:418<br class="">#6  0x00000001000c5d4d in libpd_process_float (ticks=1, inBuffer=0x7fff5fbffa50, outBuffer=0x7fff5fbff750) at z_libpd.c:173<br class="">#7  0x0000000100000d18 in main ()<br class=""><br class="">If I don’t optimize, it works fine:<br class=""><br class="">print: 0<br class="">1003-frequency: bang<br class="">print: 0<br class="">1004-frequency: bang<br class="">1003-frequency: 1<br class="">1004-frequency: 2<br class="">1.000000 1.000000 0.999999 0.999999 0.999998 0.999998 0.999997 0.999997<span class="Apple-converted-space"> </span><br class="">1.000000 1.000000 0.999998 0.999998 0.999996 0.999996 0.999995 0.999995<span class="Apple-converted-space"> </span><br class="">print: 1<br class="">0.999944 0.999944 0.999943 0.999943 0.999942 0.999942 0.999941 0.999941<span class="Apple-converted-space"> </span><br class="">print: 1<br class="">0.999815 0.999815 0.999810 0.999810 0.999804 0.999804 0.999799 0.999799<span class="Apple-converted-space"> </span><br class="">print: 2<br class="">print: 2<br class=""><br class="">--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a> <<a href="http://danomatika.com/" class="">http://danomatika.com/</a>><br class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a> <<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>><br class=""><blockquote type="cite" class="">On Apr 21, 2015, at 10:56 AM, Kjetil Matheussen <<a href="mailto:k.s.matheussen@gmail.com" class="">k.s.matheussen@gmail.com</a>> wrote:<br class=""><br class="">But for libpd, are you sure you need to add anything? Can't just the user<br class="">call the pdinstance_new and pd_setinstance functions directly?<br class=""><br class=""><a href="http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html" class="">http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html</a> <<a href="http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html" class="">http://lists.puredata.info/pipermail/pd-dev/2014-05/019832.html</a>><br class=""><br class=""><br class="">(BTW. When I wrote about libpds, I hadn't forgotten about the support for pd instances,<br class="">but since I didn't have all details in my head then, I didn't mention it. I should have though.)<br class=""><br class=""><br class="">On Tue, Apr 21, 2015 at 4:42 PM, Dan Wilcox <<a href="mailto:danomatika@gmail.com" class="">danomatika@gmail.com</a> <<a href="mailto:danomatika@gmail.com" class="">mailto:danomatika@gmail.com</a>>> wrote:<br class="">This should be possible with the current version of libpd which includes Miller’s multiple instance updates, see <a href="http://lists.puredata.info/pipermail/pd-dev/2014-05/019839.html" class="">http://lists.puredata.info/pipermail/pd-dev/2014-05/019839.html</a> <<a href="http://lists.puredata.info/pipermail/pd-dev/2014-05/019839.html" class="">http://lists.puredata.info/pipermail/pd-dev/2014-05/019839.html</a>><br class=""><br class="">I just haven’t gotten around to adding libpd-specific wrapper functions for this yet, but Miller provides code in that dev list exchange.<br class=""><br class="">--------<br class="">Dan Wilcox<br class="">@danomatika<br class=""><a href="http://danomatika.com/" class="">danomatika.com</a> <<a href="http://danomatika.com/" class="">http://danomatika.com/</a>><br class=""><a href="http://robotcowboy.com/" class="">robotcowboy.com</a> <<a href="http://robotcowboy.com/" class="">http://robotcowboy.com/</a>><br class=""><blockquote type="cite" class="">On Apr 21, 2015, at 6:00 AM, <a href="mailto:pd-dev-request@lists.iem.at" class="">pd-dev-request@lists.iem.at</a> <<a href="mailto:pd-dev-request@lists.iem.at" class="">mailto:pd-dev-request@lists.iem.at</a>> wrote:<br class=""><br class="">From: Oliver Greschke <<a href="mailto:info@o-g-sus.de" class="">info@o-g-sus.de</a> <<a href="mailto:info@o-g-sus.de" class="">mailto:info@o-g-sus.de</a>>><br class="">Subject: [PD-dev] Can somebody help to create a desktop / VST / AU version of a PD / libPD / app ?<br class="">Date: April 21, 2015 at 3:15:44 AM EDT<br class="">To: <a href="mailto:pd-dev@lists.iem.at" class="">pd-dev@lists.iem.at</a> <<a href="mailto:pd-dev@lists.iem.at" class="">mailto:pd-dev@lists.iem.at</a>><br class=""><br class=""><br class="">Hi,<br class="">I am the creator of the Elastic Drums iOS app (with great PD help from Matt Davey).<br class="">It’s made with PureData, libPD and Objective-C.<br class="">I got asked a couple of times now, if there will be ever a standalone desktop version or even better Plugin (VST, AU) version of the app.<br class=""><br class="">As far as I know, there are not ready to use workarounds to do so. Which is sad, because I can imagine a lot of fantastic plugins emerging from PD<br class=""><br class="">Has somebody here some experience with doing such ports?<br class="">Then please contact me.<br class=""><br class="">Cheers,<br class="">Oliver<br class=""><br class=""><a href="mailto:info@o-g-sus.de" class="">info@o-g-sus.de</a> <<a href="mailto:info@o-g-sus.de" class="">mailto:info@o-g-sus.de</a>><br class=""></blockquote><br class="">_______________________________________________<br class="">Pd-dev mailing list<br class=""><a href="mailto:Pd-dev@lists.iem.at" class="">Pd-dev@lists.iem.at</a> <<a href="mailto:Pd-dev@lists.iem.at" class="">mailto:Pd-dev@lists.iem.at</a>><br class=""><a href="http://lists.puredata.info/listinfo/pd-dev" class="">http://lists.puredata.info/listinfo/pd-dev</a> <<a href="http://lists.puredata.info/listinfo/pd-dev" class="">http://lists.puredata.info/listinfo/pd-dev</a>><br class=""><br class=""><br class=""></blockquote><br class=""></blockquote><br class=""><blockquote type="cite" class="">_______________________________________________<br class="">Pd-dev mailing list<br class=""><a href="mailto:Pd-dev@lists.iem.at" class="">Pd-dev@lists.iem.at</a><br class=""><a href="http://lists.puredata.info/listinfo/pd-dev" class="">http://lists.puredata.info/listinfo/pd-dev</a><br class=""></blockquote><br class=""></blockquote><br class=""></blockquote></blockquote><br class=""></blockquote><br class="">_______________________________________________<br class="">Pd-dev mailing list<br class=""><a href="mailto:Pd-dev@lists.iem.at" class="">Pd-dev@lists.iem.at</a><br class=""><a href="http://lists.puredata.info/listinfo/pd-dev" class="">http://lists.puredata.info/listinfo/pd-dev</a></blockquote></blockquote></blockquote></blockquote></blockquote></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></body></html>