<div dir="ltr">The easiest way to accomplish sample-precise starting/stopping is actually inlining the WAV recording into your script. E.g. <div><br></div><div><div>dac => Gain g => WvOut w => blackhole;<br></div>
<div>"file.wav" => w.wavFilename;</div><div>// temporary workaround to automatically close file on remove-shred</div><div>null @=> w;</div></div><div><br></div><div>// your code goes here</div><div>SinOsc s => dac;</div>
<div>2::second => now;</div><div><br></div><div>// end of code</div><div><br></div><div>The WvOut will get shut down and closed whenever the script itself ends, leaving you with a file thats exactly the running length of the script. </div>
<div><br></div><div>spencer</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 1:22 PM, Brian Sorahan <span dir="ltr"><<a href="mailto:bsorahan@haivision.com" target="_blank">bsorahan@haivision.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Seems like the main script could signal an event when it is done (as opposed to going into an infinite loop).<div>
You could make a shared class that has a static Event member.</div><div>
e.g.</div><div><br></div><b>Shared.ck</b><br>--------------<br>public class Shared {<br>    static Event @ event;<br>}<br>new Event @=> Shared.event;<div>--------------</div><div><br></div><div><b><a href="http://main.ck" target="_blank">main.ck</a></b></div>


<div>-----------</div><div>// send audio to dac</div><div>Shared.event.signal();</div>-----------<div><br></div><div><b><a href="http://rec.ck" target="_blank">rec.ck</a></b></div><div>--------</div><div>// record audio from dac<br>
<div>
Shared.event => now;</div>
--------</div><div><br></div><div>Then you just have to load Shared.ck before the other two scripts.</div><div>Hope that helps!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Brian</div></font></span></div>
<div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">
On Thu, Jan 23, 2014 at 2:45 PM, Leonard Ritter <span dir="ltr"><<a href="mailto:leonard.ritter@duangle.com" target="_blank">leonard.ritter@duangle.com</a>></span> wrote:<br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi there,<br>
<br>
I wrote this to Ge Wang on Twitter before but he's not been there<br>
since October, so I thought I'd better write here.<br>
<br>
I've used ChucK a few years ago and had quite some fun with it. I<br>
would like to use it as part of the game we are currently developing.<br>
The goal is to allow sounds to be customized to individual<br>
installations of the game, where they would then be played back by<br>
OpenAL to provide for positional 3D audio.<br>
<br>
As part of my prototyping, I wanted to write a simple Python script<br>
that is able to batch convert a stack of ck files to WAV, ideally<br>
sample precise (no leading or trailing silence).<br>
<br>
I thought that <a href="http://rec.ck" target="_blank">rec.ck</a> would be perfect for achieving that but it seems<br>
I can't figure out a way to have recording end precisely when the main<br>
script is done playing, instead of recording indefinitely and waiting<br>
for abortion via the Ctrl+C key.<br>
<br>
Is there such a method? I'd be very thankful for advice.<br>
<br>
Cheers,<br>
Leonard<br>
--<br>
Leonard und Sylvia Ritter, Duangle, GbR<br>
<br>
Ritter<br>
Altpieschen 9,<br>
01127 Dresden<br>
<br>
<a href="mailto:Leonard.Ritter@duangle.com" target="_blank">Leonard.Ritter@duangle.com</a><br>
<br>
<a href="http://www.duangle.com" target="_blank">www.duangle.com</a><br>
Geschäftsführung: Sylvia Ritter, Leonard Ritter<br>
_______________________________________________<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" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br></div>