<div dir="ltr"><div>maybe: call the file with something like <a href="http://rec.ck">rec.ck</a> but with arguments.</div><div>(my <a href="http://rec.ck">rec.ck</a> is called <a href="http://wav_writer_wgain.ck">wav_writer_wgain.ck</a>) </div>

<div><br></div>> chuck <a href="http://your_main_track.ck">your_main_track.ck</a> wav_writer_wgain.ck:duration:wav_name:gain<div><br></div><div><a href="https://github.com/zeffii/ChucK/blob/master/ck_files/wav_writer_wgain.ck">https://github.com/zeffii/ChucK/blob/master/ck_files/wav_writer_wgain.ck</a><br>

</div><div>where: </div><div>wav_name would be the desired output name</div><div>duration is seconds, </div><div>gain is 0.0 to 1.0 </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 10:34 PM, Leonard Ritter <span dir="ltr"><<a href="mailto:leonard.ritter@duangle.com" target="_blank">leonard.ritter@duangle.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the suggestions so far. These are interesting but they<br>
require retrofitting scripts, so aren't universally compatible with<br>
any ck ever written (which I hope you agree would be super super<br>
helpful). Is there no solution that requires no change to the ck to be<br>
converted?<br>
<div><div class="h5"><br>
On Thu, Jan 23, 2014 at 10:32 PM, Spencer Salazar<br>
<<a href="mailto:spencer@ccrma.stanford.edu">spencer@ccrma.stanford.edu</a>> wrote:<br>
> The easiest way to accomplish sample-precise starting/stopping is actually<br>
> inlining the WAV recording into your script. E.g.<br>
><br>
> dac => Gain g => WvOut w => blackhole;<br>
> "file.wav" => w.wavFilename;<br>
> // temporary workaround to automatically close file on remove-shred<br>
> null @=> w;<br>
><br>
> // your code goes here<br>
> SinOsc s => dac;<br>
> 2::second => now;<br>
><br>
> // end of code<br>
><br>
> The WvOut will get shut down and closed whenever the script itself ends,<br>
> leaving you with a file thats exactly the running length of the script.<br>
><br>
> spencer<br>
><br>
><br>
><br>
><br>
> On Thu, Jan 23, 2014 at 1:22 PM, Brian Sorahan <<a href="mailto:bsorahan@haivision.com">bsorahan@haivision.com</a>><br>
> wrote:<br>
>><br>
>> Seems like the main script could signal an event when it is done (as<br>
>> opposed to going into an infinite loop).<br>
>> You could make a shared class that has a static Event member.<br>
>> e.g.<br>
>><br>
>> Shared.ck<br>
>> --------------<br>
>> public class Shared {<br>
>>     static Event @ event;<br>
>> }<br>
>> new Event @=> Shared.event;<br>
>> --------------<br>
>><br>
>> <a href="http://main.ck" target="_blank">main.ck</a><br>
>> -----------<br>
>> // send audio to dac<br>
>> Shared.event.signal();<br>
>> -----------<br>
>><br>
>> <a href="http://rec.ck" target="_blank">rec.ck</a><br>
>> --------<br>
>> // record audio from dac<br>
>> Shared.event => now;<br>
>> --------<br>
>><br>
>> Then you just have to load Shared.ck before the other two scripts.<br>
>> Hope that helps!<br>
>><br>
>> Brian<br>
>><br>
>><br>
>> On Thu, Jan 23, 2014 at 2:45 PM, Leonard Ritter<br>
>> <<a href="mailto:leonard.ritter@duangle.com">leonard.ritter@duangle.com</a>> wrote:<br>
>>><br>
>>> 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">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">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>
>><br>
>><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>
><br>
><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>
<br>
<br>
<br>
</div></div>--<br>
<div class="HOEnZb"><div class="h5">--<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">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">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>
</div></div></blockquote></div><br></div>