On 9/2/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;">
Hi,</blockquote><div><br>Hi Arthur, welcome! I&#39;ll try to help you with some of this, we&#39;ll see how far we get. Some of it looks a bit odd to me.<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;">
<br>I have written a demo application to let Chuck be controlled through<br>Processing. See my blog post: <a href="http://visiblearea.com/blog/bin/view/">http://visiblearea.com/blog/bin/view/</a><br>VisibleArea/ProcessingandChucK
</blockquote><div><br>Cool stuff.<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;">The demo now plays audio files, but it would be easy to change this
<br>to let it create and play custom audio.<br><br>- It should be possible to start and stop the ChucK VM in Processing,<br>but no stop handlers are called at closing the app, leaving the VM in<br>the air. I understand this is an issue with Java applets.
</blockquote><div><br>Yes, this is a bit mysterious to me. The way to go about this would be staring ChucK using either &quot;chuck --loop&quot; or by feeding it a file like this; &quot;ChucK <a href="http://myfile.ck">myfile.ck
</a>&quot; using a file that will keep running. The ChucK VM should exit after you give the system a command to &quot;chuck --kill&quot; or after the last shred has been removed from it (if it&#39;s not set to --loop). If it doesn&#39;t properly exit after either then that would probably be a bug. I don&#39;t see how applets would affect this as this would be something between the OS and ChucK, ChucK shouldn&#39;t be affected by what sort of thing send those system calls. Strange.
<br><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;">- I would have liked to use 1 FilePlayer class that is loaded only<br>once into the VM, but I have not found a way to do this. Either:
<br>&nbsp;&nbsp;&nbsp;&nbsp;1) call &#39;chuck <a href="http://fileplayer.ck">fileplayer.ck</a>&#39; before demo files are called causes<br>errors on running the demo files that FilePlayer is unknown<br>&nbsp;&nbsp;&nbsp;&nbsp;2) for every demo file call &#39;chuck 
<a href="http://fileplayer.ck">fileplayer.ck</a><br>chuckdemo.ck:all:sorts:of:params&#39; causes an error that FilePlayer is<br>already in the global VM space and this will stop the demo file from<br>running</blockquote><div>
<br>I looked at your code for a bit and noticed you wrote a public class in one file, then redefined the class in another... Maybe it would be best if I&#39;d review how public classes should work in ChucK.<br><br>A public class is usable by everything in the whole VM. So; in order to use it you define it once and run this code. If the class enters the VM without errors then it should be fine, if it isn&#39;t acessible afterwards the first thing I&#39;d verify in your situation is wether you aren&#39;t accidentally starting a second instance of the ChucK VM (which wouldn&#39;t yet have this class defined). Because of the way public classes work right now they can only be defined once and trying to define them again will result in errors. I&#39;m not sure how the VM will deal with a non-public class of the same name getting defined in other files, generally I simply wouldn&#39;t do that as it&#39;s asking for confusion and trouble.
<br><br>Beyond that it&#39;s hard for me to say what exactly is going wrong because I don&#39;t have Processing on this computer right now and it&#39;s hard to tell exactly what&#39;s happening in what order by just quickly reading your code. Most likely it&#39;s just something small and silly, because of what you wrote above I have a hunch it might have something to do with starting and stopping the VM.
<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;"><br>- How can I use the analysis tools to create an equalizer-like display?</blockquote>
<div><br>I&#39;d like to know stuff like that too. The analysis stuff is very, very new, I have yet to poke around in it. I&#39;m planning to try to write some functions that would deal with the arrays those produce in order to try to find the highest peaks in the spectrum and so on but FFT on such a practical and low level is very new to me.
<br>&nbsp;<br><br>Hope this was of some use to you, I&#39;m sure we&#39;ll get to the bottom of this, likely it&#39;s just a very minor misunderstanding.<br><br>Yours,<br>Kas.<br></div><br></div>