Hello Vitalije,

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

http://jackaudio.org/

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.

That said, I'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.

On OSX there is an audio routing utility called SoundFlower or you can try JackOSX.

   michael

http://jackaudio.org/applications/
http://drobilla.net/software/patchage/
http://qjackctl.sourceforge.net/
https://ardour.org/
http://rogueamoeba.com/freebies/soundflower/
http://www.jackosx.com/


On Sat, Jan 24, 2015 at 1:54 PM, Perry Cook <prc@cs.princeton.edu> wrote:
It's likely just overloading and clipping on the output file.  WvOut
and WvOut2 must quantize to 16 bits to write out the file.  So
numbers that are greater than +/- 1.0 will overload.  If this is
really the problem (likely), then there's an easy fix.  There's a
method called fileGain() that sets an extra gain before the file
is written out.  The default is of course 1.0, but you can change
it to anything.  Example useage:


MyPatch => WvOut bob => blackhole;
"mywavfile.wav" => bob.wavFilename;

0.5 => bob.fileGain;       // This is your friend for writing non-clipped files

while (now < then)  {
    // do whatever;
}

bob.closeFile();


Hope this helps.  If not let us know and we'll dig deeper.

PRC


> On Jan 24, 2015, at 9:00 AM, chuck-users-request@lists.cs.princeton.edu wrote:
>
> Send chuck-users mailing list submissions to
>       chuck-users@lists.cs.princeton.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> or, via email, send a message with subject or body 'help' to
>       chuck-users-request@lists.cs.princeton.edu
>
> You can reach the person managing the list at
>       chuck-users-owner@lists.cs.princeton.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of chuck-users digest..."
>
>
> Today's Topics:
>
>   1. WvOut  sample size (????????? ????????)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 23 Jan 2015 20:22:21 +0100
> From: ????????? ????????      <vitalije@kviziracija.net>
> To: chuck-users@lists.cs.princeton.edu
> Subject: [chuck-users] WvOut  sample size
> Message-ID: <54C29F6D.8070701@kviziracija.net>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hello,
> I am a new member of this list.
> I have made some ChucK program that sounds good when performed by ChucK
> VM. However, when I record this music through WvOut in to file and later
> play recorded file using system player, I hear some cracks (distortions,
> noise).
> It seems to me that it is some conversion taking place during recording.
> In  the documentation of WvOut class it is suggested that MATLAB file
> format will write 64-bit floats. But even with that precision I get the
> same sound in file. I have looked in to the source code and found that
> every method of WvOut class (WvOut_ctrl_<filetype>Filename) opens file
> with the same 16-bit sample-size (Stk::STK_SINT16).
>
> I have tried naively to change that parameter into Stk::STK_SINT32, and
> recompiled successfully ChucK, but the quality of recorded sound was not
> improved. Actually, file was again 16-bit signed encoded.
>
> What can I do to improve quality of recording.
>
> My computer is amd-64 Ubuntu 14.04. I have compiled ChucK with 'make
> linux-alsa' command.
>
> PS: I tried to record sound from system sound-card by using some other
> programs for recording, but with no success. Either ChucK could not
> access sound-card or a recording program could not access sound-card. It
> seems that ChucK insists on having exclusive rights over sound-card and
> doesn't want to share it with other programs. Even if in my browser is
> opened some site that uses sound, ChucK refuses to start.
>
> Vitalije
>
>
> ------------------------------
>
> _______________________________________________
> chuck-users mailing list
> chuck-users@lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
> End of chuck-users Digest, Vol 114, Issue 4
> *******************************************

_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users