[chuck-users] prevent samples from clipping

Kassen signal.automatique at gmail.com
Thu Apr 28 09:50:46 EDT 2011

> Hey Tim!

> What's the best way to prevent samples from clipping in chuck?  My problem
> is that my bass samples are too long for the time advanced, which creates a
> rythmic popping sound.  Any advice would be appreciated.  Thank you,
It sounds a bit to me like you don't mean literal "clipping" (or excess
volume) but the kind of clicking sound (that can be quite similar) you get
as a wave form suddenly changes value, in this case to 0. Correct me if I'm

Now, assuming we're now on the same page, the most convenient way here is a
short fade-out; Envelope or ADSR will help you do that, or you could try
playing them back using LiSa which has a "rampDown" function build in. This
might mean that if you were previously advancing time by X you may now need
to use X - Y, where Y is the duration of the fade. This would be followed by
starting the fade, then advancing time by Y. If all you need is
click-removal a very short fade of 10 or so ms should do the trick, the
length of the fade that sounds best will probably depend on your material,
with material that contains prominent low frequencies requiring slightly
longer fades.
Depending on your needs and code there might be other or related clever
tricks you can also use to avoid these clicks, that's a bit hard to give
comments on from here.

Hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20110428/cb90d7df/attachment.htm>

More information about the chuck-users mailing list