Hallo,
I'm trying to build a pure-Pd compressor/limiter effect. I followed a chapter in the Csound book a bit (by Marc Resibois), but somehow it's still a bit strange. I would appreciate if someone could test out the attachemend and maybe even enhance it?
Frank Barknecht _ ______footils.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect.
Attached is a slightly better version, which now uses a snapshot~ to get the current gain, which then is compared to the target gain to calculate the next gain. Now it seems to be possible to actually compress audio with it, if you set a low threshold (~ 0.2), a sharp attack (~1ms), and comp1 to some small value (or 1/comp1 to a large one) while keeping comp1 at 1.
Testing and comments would be cool!
Frank Barknecht Do You RjDj.me? _ ______footils.org__
On Wed, 2008-10-15 at 17:24 +0200, Frank Barknecht wrote:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect.
Attached is a slightly better version, which now uses a snapshot~ to get the current gain, which then is compared to the target gain to calculate the next gain. Now it seems to be possible to actually compress audio with it, if you set a low threshold (~ 0.2), a sharp attack (~1ms), and comp1 to some small value (or 1/comp1 to a large one) while keeping comp1 at 1.
Testing and comments would be cool!
yo.. this really interests me. i will test and comment it soon (when i have little time). in the meanwhile i would like to ask: what is the idea of having two ratios (c1 and c2 are ratios, aren't they?)? and if both are ratios: how comes, that there is only one threshold? i may be misunderstanding the basic idea of it.
roman
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Hallo, Roman Haefeli hat gesagt: // Roman Haefeli wrote:
On Wed, 2008-10-15 at 17:24 +0200, Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect.
yo.. this really interests me. i will test and comment it soon (when i have little time). in the meanwhile i would like to ask: what is the idea of having two ratios (c1 and c2 are ratios, aren't they?)? and if both are ratios: how comes, that there is only one threshold? i may be misunderstanding the basic idea of it.
Well, [compress~] is a bad name and will be changed: The abstraction I posted is multi-purpose (like Zexy's [limiter~]) and can also be used as a noise gate, a limiter or an expander. For this, two different transfer functions for signals below or above the threshold are used.
comp1 is the ratio of the compression curve above the threshold. It's the slope of a staight line there as you may know from the usual compressor diagrams that show input vs. output level.
comp2 is a bit more complicated: It describes the gain curve that is applied to the signal if its below the threshold and follows a x^(1/comp2) curve. If comp2 == 1 you get a straight line with a 1/1 ratio and no gain change for signals below the threshold.
If comp2 is below 1 you get a parabolic curve, i.e. f(x) = x^2 for comp2 = 0.5 This means that softer signals get attenuated more: a noise gate.
If comp2 is larger then 1 the curve is ... what's it a sqrt-like curve called in english? Well, for comp2==2, you get the sqrt-curve exactly, so softer signals below the threshold get a gain that makes them louder, until at the threshold point they get passed through unchanged, after which the comp1-curve kicks in again.
I've read in the Csound book that this is called an expander.
Frank Barknecht Do You RjDj.me? _ ______footils.org__
Frank,
I attach a simple compressor that I made, it is doing most of its calculations in dB. This one doesn't have the nonlinear compression below the threshold as yours and for simplicity I left out the delay, also the attack and decay calculations are simplified. I use it for teaching, so I think the calculations for the compression factor are pretty clear and intuitive.
Günter
Frank Barknecht wrote:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect.
Attached is a slightly better version, which now uses a snapshot~ to get the current gain, which then is compared to the target gain to calculate the next gain. Now it seems to be possible to actually compress audio with it, if you set a low threshold (~ 0.2), a sharp attack (~1ms), and comp1 to some small value (or 1/comp1 to a large one) while keeping comp1 at 1.
Testing and comments would be cool!
Ciao
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 83 0 855 414 10; #X obj 270 107 - 80; #X floatatom 270 62 5 0 0 0 - - -; #X obj 270 131 moses 0; #X obj 316 154 / 4; #X floatatom 354 69 5 0 0 2 tresh - -; #X floatatom 402 68 5 1 100 2 ratio - -; #X obj 316 175 + 80; #X obj 316 196 -; #X obj 316 237 dbtorms; #X floatatom 316 257 8 0 0 0 - - -; #X obj 316 216 + 100; #X obj 270 81 t f f; #X obj 354 15 inlet; #X obj 402 14 inlet; #X msg 270 255 1; #X text 203 160 linear; #X obj 270 315 outlet; #X obj 270 23 inlet; #X text 318 108 calculate the compression factor; #X text 354 153 apply the ratio; #X text 341 130 compress if we are over 0; #X text 351 196 get the difference in level to the original; #X text 370 218 convert dB to factor (in pd 0 dB == 100); #X connect 0 0 2 0; #X connect 1 0 11 0; #X connect 2 0 14 0; #X connect 2 1 3 0; #X connect 3 0 6 0; #X connect 4 0 0 1; #X connect 4 0 6 1; #X connect 5 0 3 1; #X connect 6 0 7 0; #X connect 7 0 10 0; #X connect 8 0 9 0; #X connect 9 0 16 0; #X connect 10 0 8 0; #X connect 11 0 0 0; #X connect 11 1 7 1; #X connect 12 0 4 0; #X connect 13 0 5 0; #X connect 14 0 16 0; #X connect 17 0 1 0;
#N canvas 247 457 613 464 10; #X obj 90 417 dac~; #X obj 184 68 random 100; #X obj 115 161 *~; #X obj 183 134 vline~; #X msg 183 112 $1 20 , 0 200 10; #X obj 184 47 metro 500; #X msg 184 24 bang; #X floatatom 116 36 5 0 0 0 - - -; #X obj 116 66 osc~ 110; #X floatatom 224 202 5 1 100 2 ratio - -; #X floatatom 179 201 5 0 100 2 thresh - -; #X obj 184 91 / 100; #X obj 114 373 *~; #X obj 136 329 line~; #X obj 136 253 moses 1; #X obj 136 297 pack 0 20; #X obj 212 299 pack 0 200; #X obj 136 199 env~; #X obj 136 229 compress; #X floatatom 273 202 5 0 0 2 attack - -; #X floatatom 323 202 5 0 0 2 decay - -; #X text 297 69 compress: calculate compression ratio; #X connect 1 0 11 0; #X connect 2 0 12 0; #X connect 2 0 17 0; #X connect 3 0 2 1; #X connect 4 0 3 0; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 8 0; #X connect 8 0 2 0; #X connect 9 0 18 2; #X connect 10 0 18 1; #X connect 11 0 4 0; #X connect 12 0 0 0; #X connect 12 0 0 1; #X connect 13 0 12 1; #X connect 14 0 15 0; #X connect 14 1 16 0; #X connect 15 0 13 0; #X connect 16 0 13 0; #X connect 17 0 18 0; #X connect 18 0 14 0; #X connect 19 0 15 1; #X connect 20 0 16 1;
Just trying on a few drum loops. Results not very good. It seems too pumpy and jittery, hard to set up any useful parameters imho.
Perhaps a bit more smoothing/lag and finer tuning of the gain reduction stages would help.
2c.
andy
On Wed, 15 Oct 2008 17:24:43 +0200 Frank Barknecht fbar@footils.org wrote:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect.
Attached is a slightly better version, which now uses a snapshot~ to get the current gain, which then is compared to the target gain to calculate the next gain. Now it seems to be possible to actually compress audio with it, if you set a low threshold (~ 0.2), a sharp attack (~1ms), and comp1 to some small value (or 1/comp1 to a large one) while keeping comp1 at 1.
Testing and comments would be cool!
Ciao
Frank Barknecht Do You RjDj.me? _ ______footils.org__
On Wed, 2008-10-15 at 17:24 +0200, Frank Barknecht wrote:
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect.
Attached is a slightly better version, which now uses a snapshot~ to get the current gain, which then is compared to the target gain to calculate the next gain. Now it seems to be possible to actually compress audio with it, if you set a low threshold (~ 0.2), a sharp attack (~1ms), and comp1 to some small value (or 1/comp1 to a large one) while keeping comp1 at 1.
Testing and comments would be cool!
yo... late comment, but still a comment :-)
i tried it on a bad quality voice recording (with some background noise, which makes it easier for me to hear, how the compressor behaves). it turned out, that i ended up using similar settings as you proposed in the post above to get compressorlike results. and yes, at least for voice it works pretty well, i'd say.
with c2 set to ~2 i could achieve a noise gate (or more correct: downwards expander) with voice compressor at the same time. however, i had the impression, that the release time doesn't seem to affect the gate. when c2 is set to 1, i clearly hear the difference between 10 and 1000 ms release time. when i set c2 to > 1 and release time to a high value, the abstraction still very quickly kicks in to suppress background noise. is this because both, c1 and c2, share the same [pd attack-release] section? i checked again by watching the $0-diff table and it seems, that attack and release times are swapped for c2, compared to what you usually would expect from a downward expander/gate. on a raising signal, the gain should be corrected in 'attack' time, while on a muting signal, the gain should follow in 'release' time. in your implementation it is the other way around. i am not quite sure, how this could be fixed. probably c1 and c2 need a separate [pd attack-release] section?
i also encountered, that the c1 ratio is not a straight line, but rather curve on a logarithmic (dB) scale (except when it is 1, of course), while the c2 ratio is a straight line. i know some vst compressor plugins - the C1 from waves in particular - that show similar behaviour. i always wondered about the formula for those curves. it's cool to have that now in pd as well.
i added an input/output graph to compress~-help.pd, which helped me to understand what the abstraction actually does. see attachment.
roman
On Tue, Oct 14, 2008 at 07:39:26PM +0200, Frank Barknecht wrote:
I'm trying to build a pure-Pd compressor/limiter effect. I followed a chapter in the Csound book a bit (by Marc Resibois), but somehow it's still a bit strange. I would appreciate if someone could test out the attachemend and maybe even enhance it?
Hey Frank,
Funny, I've been thinking about compression a lot lately. Here are a few abstractions I've been sort of experimenting with. These are pretty rough but can definately make your beats find The Fatness; I have used them in live shows to make people's ears do backflips. I have a much better compressor design in my head that I plan on making for s-abstractions, and I will post if and when I do. Thx to yourself and Gunter for the cool patches to help with that!
Greetz from sunny Perugia,
Chris.
Chris McCormick wrote:
rough but can definately make your beats find The Fatness; I have used them in live shows to make people's ears do backflips. I have a much
hey,
do you have any recordings of your live sets available to download anywhere?
cheers
On Sun, Oct 19, 2008 at 09:04:57PM +0200, Damian Stewart wrote:
rough but can definately make your beats find The Fatness; I have used them in live shows to make people's ears do backflips. I have a much
do you have any recordings of your live sets available to download anywhere?
Hi Damian,
I have a live set recorded in two parts here: http://www.sciencegirlrecords.com/chr15m/page/discography/live
The quality is really pretty shoddy; way too loud and clipped. I haven't played live for a while, but I'm hoping to get some stuff recorded better after I get to London and hopefully play some gigs.
Chris.