<div dir="ltr"><div><div><div>Hello Vitalije,<br><br></div>If clipping as Perry describes below is not the problem, or if you would like more flexibility in routing audio out of ChucK to other applications, I would suggest looking in to jack<br><br><a href="http://jackaudio.org/">http://jackaudio.org/</a><br><br></div>After you have jackd configured and running with a few applications (say a mixer/router such as patchage or QjackCtl and something to record with, e.g. jack_capture or ardour), then you could recompile ChucK for jack and route ChucK audio out to your recording app via the jack router.<br><br>That said, I&#39;ve never had very good luck with jack on ubuntu/linux mint distributions, probably because PulseAudio has its evil tentacles all over the place and is nearly possible to remove.  If anyone has suggestions for a linux distribution that runs jack + ardour + chuck well without any headaches I would welcome them.  I typically run ChucK on linux out to a hardware mixer and into my DAW on another computer.<br><br></div><div>On OSX there is an audio routing utility called SoundFlower or you can try JackOSX.<br></div><div><br></div>   michael <br><div><div><div><div><div><div class="gmail_extra"><br><a href="http://jackaudio.org/applications/">http://jackaudio.org/applications/</a><br><a href="http://drobilla.net/software/patchage/">http://drobilla.net/software/patchage/</a><br><a href="http://qjackctl.sourceforge.net/">http://qjackctl.sourceforge.net/</a><br><a href="https://ardour.org/">https://ardour.org/</a><br><a href="http://rogueamoeba.com/freebies/soundflower/">http://rogueamoeba.com/freebies/soundflower/</a><br><a href="http://www.jackosx.com/">http://www.jackosx.com/</a><br><br><br><div class="gmail_quote">On Sat, Jan 24, 2015 at 1:54 PM, Perry Cook <span dir="ltr">&lt;<a href="mailto:prc@cs.princeton.edu" target="_blank">prc@cs.princeton.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It&#39;s likely just overloading and clipping on the output file.  WvOut<br>
and WvOut2 must quantize to 16 bits to write out the file.  So<br>
numbers that are greater than +/- 1.0 will overload.  If this is<br>
really the problem (likely), then there&#39;s an easy fix.  There&#39;s a<br>
method called fileGain() that sets an extra gain before the file<br>
is written out.  The default is of course 1.0, but you can change<br>
it to anything.  Example useage:<br>
<br>
<br>
MyPatch =&gt; WvOut bob =&gt; blackhole;<br>
&quot;mywavfile.wav&quot; =&gt; bob.wavFilename;<br>
<br>
0.5 =&gt; bob.fileGain;       // This is your friend for writing non-clipped files<br>
<br>
while (now &lt; then)  {<br>
    // do whatever;<br>
}<br>
<br>
bob.closeFile();<br>
<br>
<br>
Hope this helps.  If not let us know and we&#39;ll dig deeper.<br>
<br>
PRC<br>
<br>
<br>
&gt; On Jan 24, 2015, at 9:00 AM, <a href="mailto:chuck-users-request@lists.cs.princeton.edu">chuck-users-request@lists.cs.princeton.edu</a> wrote:<br>
&gt;<br>
&gt; Send chuck-users mailing list submissions to<br>
&gt;       <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
&gt;<br>
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;       <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>
&gt;       <a href="mailto:chuck-users-request@lists.cs.princeton.edu">chuck-users-request@lists.cs.princeton.edu</a><br>
&gt;<br>
&gt; You can reach the person managing the list at<br>
&gt;       <a href="mailto:chuck-users-owner@lists.cs.princeton.edu">chuck-users-owner@lists.cs.princeton.edu</a><br>
&gt;<br>
&gt; When replying, please edit your Subject line so it is more specific<br>
&gt; than &quot;Re: Contents of chuck-users digest...&quot;<br>
&gt;<br>
&gt;<br>
&gt; Today&#39;s Topics:<br>
&gt;<br>
&gt;   1. WvOut  sample size (????????? ????????)<br>
&gt;<br>
&gt;<br>
&gt; ----------------------------------------------------------------------<br>
&gt;<br>
&gt; Message: 1<br>
&gt; Date: Fri, 23 Jan 2015 20:22:21 +0100<br>
&gt; From: ????????? ????????      &lt;<a href="mailto:vitalije@kviziracija.net">vitalije@kviziracija.net</a>&gt;<br>
&gt; To: <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
&gt; Subject: [chuck-users] WvOut  sample size<br>
&gt; Message-ID: &lt;<a href="mailto:54C29F6D.8070701@kviziracija.net">54C29F6D.8070701@kviziracija.net</a>&gt;<br>
&gt; Content-Type: text/plain; charset=utf-8; format=flowed<br>
&gt;<br>
&gt; Hello,<br>
&gt; I am a new member of this list.<br>
&gt; I have made some ChucK program that sounds good when performed by ChucK<br>
&gt; VM. However, when I record this music through WvOut in to file and later<br>
&gt; play recorded file using system player, I hear some cracks (distortions,<br>
&gt; noise).<br>
&gt; It seems to me that it is some conversion taking place during recording.<br>
&gt; In  the documentation of WvOut class it is suggested that MATLAB file<br>
&gt; format will write 64-bit floats. But even with that precision I get the<br>
&gt; same sound in file. I have looked in to the source code and found that<br>
&gt; every method of WvOut class (WvOut_ctrl_&lt;filetype&gt;Filename) opens file<br>
&gt; with the same 16-bit sample-size (Stk::STK_SINT16).<br>
&gt;<br>
&gt; I have tried naively to change that parameter into Stk::STK_SINT32, and<br>
&gt; recompiled successfully ChucK, but the quality of recorded sound was not<br>
&gt; improved. Actually, file was again 16-bit signed encoded.<br>
&gt;<br>
&gt; What can I do to improve quality of recording.<br>
&gt;<br>
&gt; My computer is amd-64 Ubuntu 14.04. I have compiled ChucK with &#39;make<br>
&gt; linux-alsa&#39; command.<br>
&gt;<br>
&gt; PS: I tried to record sound from system sound-card by using some other<br>
&gt; programs for recording, but with no success. Either ChucK could not<br>
&gt; access sound-card or a recording program could not access sound-card. It<br>
&gt; seems that ChucK insists on having exclusive rights over sound-card and<br>
&gt; doesn&#39;t want to share it with other programs. Even if in my browser is<br>
&gt; opened some site that uses sound, ChucK refuses to start.<br>
&gt;<br>
&gt; Vitalije<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; chuck-users mailing list<br>
&gt; <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
&gt; <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
&gt;<br>
&gt;<br>
&gt; End of chuck-users Digest, Vol 114, Issue 4<br>
&gt; *******************************************<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>
</blockquote></div><br></div></div></div></div></div></div></div>