<br><br><div><span class="gmail_quote">On 1/15/07, <b class="gmail_sendername">Wegwerf Adresse</b> <<a href="mailto:w3gw3rfadr3553@googlemail.com">w3gw3rfadr3553@googlemail.com</a>> 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't be Dutch by any chance? (I noticed the "hoe" above...)<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;">
<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> </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 '--silent' 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> </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'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 ("chuck --silent
<a href="http://filename.ck">filename.ck</a> <a href="http://record.ck">record.ck</a>" 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'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'd be in business.
<br><br>Now it gets a bit hard because it'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'd recommend something like this;
<br><br>10::minute => now;<br>//kill all lower id's then self<br>for(0 => n; n< me.id(); n++) Machine.remove(n);<br>//then everything higher<br>for( (me.id() + 1) => n; n < highest_shred_id; n++) Machine.remove
(n);<br>//somebody has to turn the light out...<br>m.exit();<br><br>Don'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't know the ID of the highest shred that'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. "Std.system( chuck --kill)" should make chuck request that the system kill it. Theoretically. I think I saw some weird behaviour coming from Std.system and IMHO "
Std.system( chuck --kill)" is pushing the envelope of what's sensible to do (but it'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't be used in anything aplication that requiers reliability, including but not limited to nuclear reactor management, public performance and especially alarm-clocks.
<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;">> 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't a alarm-clock. ;-)<br></div><br><br>Kas.</div>