On 9/3/07, <b class="gmail_sendername">Arthur Clemens</b> &lt;<a href="mailto:arthur@visiblearea.com">arthur@visiblearea.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div><span class="q"><br></span><div>No, this is just because of the way applets are quit in Java. If &#39;chuck --kill&#39; is sent the processed are killed normally, so ChucK behaves predictable</div></div>
</div></blockquote><div><br>Ok, so the issue is that ChucK keeps running when Processing is killed? If that&#39;s a real problem you could try to make ChucK poll processing over OSC every second or so and if it isn&#39;t running ChucK could send a system command to kill ChucK.
<br><br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div>The public class not used in the demo, but I kept the file because that is the way I would ideally solve it.
</div></div></div></blockquote><div><br>That&#39;s what I suspected now.<br>&nbsp;</div>&lt;snip&gt;<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div><div>So even if &#39;<a href="http://fileplayer.ck" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">fileplayer.ck</a>&#39; is called earlier, it is added last to the VM. First the&nbsp;
<a href="http://chuckdemo.ck" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">chuckdemo.ck</a> files are run and they do not know any&nbsp;FilePlayer class at that time.</div><div>Note that the order varies at each run. Sometimes the&nbsp;FilePlayer class is added second or third, sometimes first.
</div><div><br></div><div>I don&#39;t know if this is because of the way Java calls the processes, or if class initialization in ChucK happens after file processing.</div></div></div></blockquote><div><br>This is very odd, I&#39;m inclined to suspect Processing is sending the commands in the wrong order. What you could do is start ChucK using this;
<br><br>chuck --loop <a href="http://fileplayer.ck">fileplayer.ck</a><br><br>That should force it to be added at the right moment.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div><div>So I would be fine if I could call for each file:&nbsp;&#39;chuck -add <a href="http://fileplayer.ck" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">fileplayer.ck</a>&nbsp;chuckdemo.ck:with:a:lot:of:params
&#39;, but after the first file ChucK is bailing out:</div><div><span style="white-space: pre;">        </span>[<a href="http://fileplayer.ck" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">fileplayer.ck</a>
]:line(1): class/type &#39;FilePlayer&#39; is already defined in namespace &#39;global&#39;</div><div>why can&#39;t it just ignore this?</div></div></div></blockquote><div><br>Because (right now) you can&#39;t re-define existing public classes.
<br><br>I don&#39;t quite understand why it won&#39;t add the second file after running the first has failed, there might be a good reason for that but I don&#39;t see it.<br>&nbsp;</div>I&#39;d sugest you try the sugestion of adding the public class to the VM at the time you start the VM, that should force the order to be the right way around, let&#39;s see where that gets us.
<br><br>Yours,<br>Kas.<br></div>