<br><br><div><span class="gmail_quote">On 1/15/07, <b class="gmail_sendername">Wegwerf Adresse</b> &lt;<a href="mailto:w3gw3rfadr3553@googlemail.com">w3gw3rfadr3553@googlemail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello list,<br><br>my first posting, I am not so much a musician as rather interested in hoe our digital technology advances. ChucK caught my attention with its interesting mixture between programming and creativity.</blockquote>
<div><br><br>Hi, Chris, you wouldn&#39;t be Dutch by any chance? (I noticed the &quot;hoe&quot; above...)<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;">
<br>I would like to generate this piece on a soundcard-less server, preferably without my intervention (via cron).
</blockquote><div><br>Sounds like a good plan.<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 found the &#39;--silent&#39; option to suppress audio output and a file 
<a href="http://rec-auto.ck" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rec-auto.ck</a> to record into a wav file.</blockquote><div><br><br>Exelent, you are nearly there already.<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;"> But that way the recording-to-file doesn&#39;t stop, it keep growing bigger.
<br>I also could not find anything in the docs.</blockquote><div><br>Right. So; what we need is something to stop the recording to the file and indeed preferably something to stop chuck completely. What you could do is start chuck in a non-looped way (&quot;chuck --silent 
<a href="http://filename.ck">filename.ck</a> <a href="http://record.ck">record.ck</a>&quot; would do). Now if something would remove all shreds from the VM chuck would shut-down and in this process should close the recorded file.
<br><br>So if your <a href="http://record.ck">record.ck</a> would machine.add() a shred who&#39;s sole purpose would be to wait for -say- ten minutes (of ChucK time), then remove all shreds (and itself at the end too) then you&#39;d be in business. 
<br><br>Now it gets a bit hard because it&#39;s not always obvious what the ID of the last shred is and we need a ID to remove shreds. If for your sounds you can easily establish the ID of the highest shred I&#39;d recommend something like this;
<br><br>10::minute =&gt; now;<br>//kill all lower id&#39;s then self<br>for(0 =&gt; n; n&lt; me.id(); n++) Machine.remove(n);<br>//then everything higher<br>for( (me.id() + 1) =&gt; n; n &lt; highest_shred_id; n++) Machine.remove
(n);<br>//somebody has to turn the light out...<br>m.exit();<br><br>Don&#39;t spork this as a function; if you do it will be killed when the parent that sporked it is killed.<br><br>When you don&#39;t know the&nbsp; ID of the highest shred that&#39;s not a child (killing parents kills their childeren) then it gets a bit harder. what you could try is 
Std.system() which send a request to the OS. &quot;Std.system( chuck --kill)&quot; should make chuck request that the system kill it. Theoretically. I think I saw some weird behaviour coming from Std.system and IMHO &quot;
Std.system( chuck --kill)&quot; is pushing the envelope of what&#39;s sensible to do (but it&#39;s kinda fun because of that).<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So what is a good, reliable way to create music files?</blockquote><div><br><br>I believe that official policy is still that ChucK shouldn&#39;t be used in anything aplication that requiers reliability, including but not limited to nuclear reactor management, public performance and especially alarm-clocks.
<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;">&gt; I want my computer to create a file every other week and use it as an alarm clock in the morning. ;) 
</blockquote><div><br>I recommend making sure your algorithems *always* generate a sound. Silence is a sound too, or so I was told, but silence isn&#39;t a alarm-clock. ;-)<br></div><br><br>Kas.</div>