<div dir="ltr"><div dir="ltr">Correct, Std.system does block concurrency. Depending on what you&#39;re trying to do there are a few workarounds..<div><br></div><div>- make any Std.system calls at the beginning of your ChucK script, before audio has started processing</div><div>- run the R scripts in the background using Std.system -- Std.system more or less directly calls system(3), and it seems as though &#39;&amp;&#39; works, though I havent personally tried this: <a href="https://stackoverflow.com/a/5691067">https://stackoverflow.com/a/5691067</a></div><div>- use OSC to communicate with a separate long-running script that runs whatever you need<br></div><div><br></div><div>Spencer</div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 31, 2020 at 3:33 AM federico lopez &lt;<a href="mailto:fede2001@gmail.com">fede2001@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi, <br></div><div>Is the ChucK thread disrupted by the execution time of a Std.system script call?</div><div><br></div><div>In the code below, sporking a fast script, e.g. Std.system(&quot;sleep 0&quot;), there is no noticeable disruption,  but sporking a time consuming version e.g. Std.system(&quot;sleep 3&quot;) there is a disruption in the other sporks.</div><div><br></div><div>I&#39;m trying to call R scripts using ChucK concurrency.<br></div><div><br></div>// test code, run with --caution-to-the-wind command-line flag<br>Noise n =&gt; Envelope e =&gt; dac;<br><br>fun void metro()<br>{<br>    while(true)<br>    {<br>        e.keyOn();<br>        10::ms =&gt; now;<br>        e.keyOff();<br>        990::ms =&gt; now;<br>        &lt;&lt;&lt; now, &quot;samples&quot; &gt;&gt;&gt;;<br>    }<br>}<br><br>fun void callSystem()<br>{<br>    while(true)<br>    {<br>        Std.system(&quot;sleep 0&quot;); // comment this to test<br>        //Std.system(&quot;sleep 3&quot;); // uncomment this to test<br>        1000::ms =&gt; now;<br>    }<br>}<br><br>spork~ metro();<br>spork~ callSystem();<br><div>while(true){10::ms =&gt; now;}</div><div><br></div><div>// end test code<br></div><div><br></div><div><br></div><br><div><br></div><div><br></div><br></div>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div>