[chuck-users] Feature request: compression
signal.automatique at gmail.com
Sun Jul 30 10:12:18 EDT 2006
On 7/30/06, Ollie Glass <ollieglaskovik at gmail.com> wrote:
> I'd love a compression effect in ChucK. Any chance of adding one as
> an object, or can anyone make one with a script?
Yes, you could make one but I never tried making a compressor without a pre
build envelope follower. Having a envelope follower would be nice.
The basic idea is this; you set the "treshold level" by defining some
value. If the envelope follower (that tracks the input signal) goes over
that level you start multiplying the signal's gain by some value that's less
then 1 (yet more then what would push it below this treshold). How strongly
you do this forms the compressor's "ratio", b.t.w.
The tricky bit is that if you do this dynamic (signal dependant) gain
controll too rapidly you get a overdrive/ saturator type thing. If you do it
too slowly you get a compressor that's not very usefull. Those settings form
the attack and release of the compressor.
Anyway, that's roughly it; a variable gain, a envelope follower and a way to
compare the envelope follower to values (this can also get you a expander or
a leveling amp or whatever). The one bit we are missing to DIY these is the
envelope follower so I think I'd instead propose having one of those. I'm
certain somebody more at home in DSP then I am could do one i'n a few lines
but I also suspect those would be cpu heavy lines.
If nobody else gives it a go I'll refresh my memory and try in a few days.
Oh, and once more; sample rate multiplications work way faster if done with
a gain set to multiply instead of a code loop, I'd strongly recomend that
anybody trying to build a compressor uses that because the alternative is
three or four times as expensive.
Hope that helps a little?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the chuck-users