Hello! I'm relatively new to programming and to ChucK in particular. I have an issue in which, whenever a new shred is introduced to the virtual machine (chuck --loop running in a terminal....also happens on miniAudicle) I get significant artifacts. I've tried using the command line option for increasing buffer size to no avail. I'm running ChucK on Windows 7 Pro 64-bit. Audio drivers are Realtek (may not be the latest version). I get the same issue on mu laptop running Windows 7 Home Premium 64-bit. Do I need to bite the bullet and shell out for a dedicated sound card? Could it potentially be a driver issue? I'm at a bit of a loss. Thanks for any help!
Just a guess, but if you are outputing signal to the dac in more than one shred you'll have to normalize output gain - otherwise the sound will clip. Compare how these two examples sound, (use two shreds doing the same of each example): // example 1 SinOsc s => dac; 440 => s.freq; 2::second => now; // example 2 SinOsc s => dac; 0.5 => s.gain; // normalize gain 440 => s.freq; 2::second => now; Hope to have helped.
Thanks, that seems to work for 2 shreds, but adding any more continues to give me the dreaded clipping artifacts. Any advice here? My current project will be using at least 5 shreds, probably more.
________________________________
From: Lucas Zawacki
2012/4/14 [chriswicks]
Thanks, that seems to work for 2 shreds, but adding any more continues to give me the dreaded clipping artifacts. Any advice here? My current project will be using at least 5 shreds, probably more.
Then instead of cutting the gain to 1/2, you need to cut it to 1/5.
Two more questions regarding this issue:
1. Does anyone have any ideas/methods/tricks on how to address the gain changes algorithmically so that it automatically adjusts when new shreds are added to the VM?
2. My collaborator for this project uses OSX and doesn't experience the same clipping/artifacts that I do. I installed Ubuntu Linux on the same hardware config as I was using Windows 7 and I was able to add many, many more shreds without any noticeable clipping. Can anybody speak to this?
Thanks!
________________________________
From: forrest curo
On Sun, Apr 15, 2012 at 11:57 AM, [chriswicks]
1. Does anyone have any ideas/methods/tricks on how to address the gain changes algorithmically so that it automatically adjusts when new shreds are added to the VM?
You may have luck using Dyno. Put a shared one in-between all your shreds and the dec and call limit() on it (or tweak the parameters yourself :).
2. My collaborator for this project uses OSX and doesn't experience the same clipping/artifacts that I do. I installed Ubuntu Linux on the same hardware config as I was using Windows 7 and I was able to add many, many more shreds without any noticeable clipping. Can anybody speak to this?
The OS does its own clipping between ChucK and the sound card. OS X usually does a fine job of scaling down audio that is well out of bounds, but different operating systems do it in different ways. On OS X I've found that limiting gain in ChucK is basically unnecessary. -- Tom Lieber http://AllTom.com/ http://infinite-sketchpad.com/
On 15 Apr 2012, at 18:26, Tom Lieber wrote:
2. My collaborator for this project uses OSX and doesn't experience the same clipping/artifacts that I do. I installed Ubuntu Linux on the same hardware config as I was using Windows 7 and I was able to add many, many more shreds without any noticeable clipping. Can anybody speak to this?
The OS does its own clipping between ChucK and the sound card. OS X usually does a fine job of scaling down audio that is well out of bounds, but different operating systems do it in different ways. On OS X I've found that limiting gain in ChucK is basically unnecessary.
That seems to be something new for OS X 10.7. The file diatonic.ck (link below), by which one can play as many notes as the computer keyboard admits, used to require setting g.gain < 1.0 on OS X 10.6.8 to avoid clipping, but when now trying in 10.7.3, it does not seem to be needed. In 10.6, OS X switched to using floating point numbers, which avoids the clipping problem at the OS level. So either 10.7 is doing a better job, or perhaps Chuck 1.2.1.4-beta-1 has switched to that to? Hans https://www-lagring.telia.se/Shares/Home.aspx?ShareID=f2f70b60-a7f7-4d15-9c3...
Actually, never mind that last question. It seems as though the lower the gain, the more shreds I can go without artifacts (although the lower the volume per shred). Is this more or less on point? Thanks again!
________________________________
From: Lucas Zawacki
Yes, the dac will clip if it the sum of the gain is not within [-1,1] so for the sine waves in my example you can expect them to contain values in [-2,2] and thus the gain of each one is multiplied by .5 You'll need to adapt the gain of each shred accordingly. Other option would be to use compression with the Dyno ugen.
participants (6)
-
[chriswicks]
-
Chris Wicks
-
forrest curo
-
Hans Aberg
-
Lucas Zawacki
-
Tom Lieber