<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>There is another catch with the CPU usage, which I only learned about while building a big libpd app. If you have subpatches within subpatches this is usually not a problem with control data. But, it really helps a lot within a patch if you put all the DSP objects on the same layer (i.e. without and audio subpatches).</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>Of course, the most CPU efficient patch will have no audio subpatches at all. I think the reason is that subpatch audio is calculated in a block within the subpatch, and this means a
 separate process from the master patch and takes more CPU time. I'm not 100% sure that's the case, but intuitively it seems to make sense.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>Cheers,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><span>Ed</span></div><div></div><div>&nbsp;</div><div>Ninja Jamm - a revolutionary new music remix app from Ninja Tune and Seeper, for iPhone and iPad<br>http://www.ninjajamm.com/</div><div><br><br></div><div>Gemnotes-0.2: Live music notation for Pure Data, now with dynamics!<br>http://sharktracks.co.uk/&nbsp;</div><br>
 <div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Mario Mey &lt;mariomey@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> J Oliver &lt;jaime.oliver2@gmail.com&gt; <br><b><span style="font-weight: bold;">Cc:</span></b> pd-list@iem.at <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, 6 August 2013, 3:15<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [PD] How to reduce CPU use on unused subpatches-abstracts?<br> </font> </div> <div class="y_msg_container"><br>Hi, J. Thanks for the response. Following some suggestion (from you, <br>Maelstorm, Servando Barreiro), I
 made some tests. I took the dare to <br>post your mail in the thread... maybe it's better to post there, if <br>anyone has the same problem or just wants to learn.<br><br>Here is the thread: <a href="http://puredata.hurleur.com/viewtopic.php?pid=37895" target="_blank">http://puredata.hurleur.com/viewtopic.php?pid=37895</a><br><br>I answer your mail right there. Could you take a look?<br><br>Anyway, as I writed there, I WILL CHECK IT AGAIN, AND I WILL DO SOME <br>OTHER TESTS.<br><br><br><br><br><br>El 05/08/13 10:36, J Oliver escribió:<br>&gt; Hi Mario,<br>&gt;<br>&gt; There is a thread somewhere about connections vs. s/r &amp; throw/catch, don't have time right now to search for it, but I'm sure it is there. If I remember correctly the overhead is not that big and you don't want to be connecting all that stuff by hand.<br>&gt;<br>&gt; In any case, there are other things to look for.<br>&gt;<br>&gt; If you are using graphics objects, or objects like
 env~ you might want to bring down the refresh rate. Are there any [metro 1] or similar objects lying around which you might have forgotten about?<br>&gt;<br>&gt; Do you have a lot of GOP? I am not sure this is entirely relevant, but it might be worth researching...<br>&gt;<br>&gt; Also, control operations do take some cpu. do you have a big control layer?<br>&gt;<br>&gt; J<br>&gt;<br>&gt;&gt; Thanks, Roman, but I'm already using [switch~] inside each FX, to stop processing the signal. I learned it some time ago, from here:<br>&gt;&gt;<br>&gt;&gt; <a href="http://puredata.hurleur.com/viewtopic.php?pid=35939#p35939" target="_blank">http://puredata.hurleur.com/viewtopic.php?pid=35939#p35939</a><br>&gt;&gt;<br>&gt;&gt; But I think that [receive~] and [throw~] are still using CPU.<br>&gt;&gt;<br>&gt;&gt; I didn't try to use inlet~ and outlet~, because I have to make 400 conections at hand... that's why I asking first. If it will work, I'll do it (or find a
 way to automatically do it)<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; El 05/08/13 09:29, Roman Haefeli escribió:<br>&gt;&gt;&gt; Hi Mario<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Check [switch~] and its help patch.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Roman<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On Mon, 2013-08-05 at 09:03 -0300, Mario Mey wrote:<br>&gt;&gt;&gt;&gt; Hi, there... I really need some help.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; I'm working on a looper-multi-effects (big) patch. It has more than,<br>&gt;&gt;&gt;&gt; more or less, 100 stereo FXs. They are all inside the patch as<br>&gt;&gt;&gt;&gt; abstracts. But, to avoid them to consume CPU, each one has a [switch~ 0]<br>&gt;&gt;&gt;&gt; if it is not working. So, there're only two FX at a time, where the DSP<br>&gt;&gt;&gt;&gt; is on. Something like this:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Main patch:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;
 adc~<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp;  \<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp;  [s $0-pre-r]<br>&gt;&gt;&gt;&gt; [s $0-pre-l]<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; [catch~ $0-post-l]<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp; &nbsp; &nbsp;  [catch~ $0-post-r]<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp; &nbsp; &nbsp; /<br>&gt;&gt;&gt;&gt; [dac~]<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; (the same for<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Each FX as file-abstracts (using [fx1 $0] to call them) inside the main<br>&gt;&gt;&gt;&gt; patch:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; [r $1-pre-l]&nbsp; &nbsp; &nbsp;  [r $1-pre-r]<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /<br>&gt;&gt;&gt;&gt; [The-FX-itself.....]<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<br>&gt;&gt;&gt;&gt; [throw~ $1-post-l] [throw~ $1-post-r]<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; [0(&nbsp; &nbsp; 
 [1(<br>&gt;&gt;&gt;&gt; |&nbsp; &nbsp; &nbsp;  /<br>&gt;&gt;&gt;&gt; [switch~]<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; This technics DOES work very well.&nbsp; Buuut... when having 100 FX at the<br>&gt;&gt;&gt;&gt; same time (even not working), the CPU increase 15-20%. I repeat,<br>&gt;&gt;&gt;&gt; there're only two FX working at the time. The rest are "turned-off".<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; For now, the CPU use is:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Ready-to-use, 2 FXs on, DSP on: 47%<br>&gt;&gt;&gt;&gt; Recorded and playing 8 stereo-banks, 2 FXs being used, DSP on: 60 - 62%<br>&gt;&gt;&gt;&gt; (I have quite a few XRUNS)<br>&gt;&gt;&gt;&gt; Ready-to-use, 2 FXs on, DSP off: 7%<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; As you can see, the non-signal processing is very low.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; What I think is that each FX is working when receiving and/or throwing<br>&gt;&gt;&gt;&gt; signal (200
 [receive~] and [throw~] objects)... even they are sending<br>&gt;&gt;&gt;&gt; and/or processing nothing.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Is there any other way to connect all the FXs to the main patch and to<br>&gt;&gt;&gt;&gt; have a lower CPU consumption?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Maybe [inlet~] and [outlet~] consume less CPU? (I should connect all the<br>&gt;&gt;&gt;&gt; FX at hand... or find a aumotated way to do it)<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Thanks a lot.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Mario Mey<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt; <a ymailto="mailto:Pd-list@iem.at" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>&gt;&gt;&gt;&gt; UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list"
 target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; <a ymailto="mailto:Pd-list@iem.at" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>&gt;&gt;&gt; UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; <a ymailto="mailto:Pd-list@iem.at" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>&gt;&gt; UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br><br><br>_______________________________________________<br><a ymailto="mailto:Pd-list@iem.at" href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>UNSUBSCRIBE and
 account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br><br></div> </div> </div> </blockquote></div>  </div></body></html>