Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :)
i once made a compressor with (almost) plain pd (i think, it uses a few objectclasses from zexy). it is part of dynlib for netpd and is called [rcomp~].
roman
On Tue, 2007-11-27 at 16:08 -0800, Vreahli the Audio Bandit wrote:
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :) _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
I may be wrong, but might some of the waveshaping tutorials help with this? Is compressions essentially a form of waveshaping with an attack and decay envelope?
~Kyle
On Nov 27, 2007 6:24 PM, Roman Haefeli reduzierer@yahoo.de wrote:
i once made a compressor with (almost) plain pd (i think, it uses a few objectclasses from zexy). it is part of dynlib for netpd and is called [rcomp~].
roman
On Tue, 2007-11-27 at 16:08 -0800, Vreahli the Audio Bandit wrote:
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :) _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hm.. don't quite know, how to answer this, i'd say yes and no. basically 'waveshaping' means adding non-linear distortions to a signal, a process, which enriches the frequency spectrum of the signal (-> spectrum is altered). the goal of all dynamic processing fx as gates, compressors, limters, expanders is to only affect the dynamics of the signal, but not the spectrum. but yeah, they are somehow related: if you use very insane settings for a compressor, let's say 0ms for attack and decay, then you have actually a waveshaper. let's say you use very small values but not 0, then it is actually not exactly a waveshaper anymore, althouth the spectrum might still be altered. a waveshaper uses table look-up, so each input value has its corresponding output value, but a compressor with very short attack and decay is more kind of an 'adaptive waveshaper' (i am not that much an expert, so this term might not make any sense). however, what happens is more complex, because the current output value is not only dependent on the actual input value, but also on previous input values (and also if we are actually in 'attack' state or 'release' state).
roman
On Tue, 2007-11-27 at 18:50 -0600, Kyle Klipowicz wrote:
I may be wrong, but might some of the waveshaping tutorials help with this? Is compressions essentially a form of waveshaping with an attack and decay envelope?
~Kyle
On Nov 27, 2007 6:24 PM, Roman Haefeli reduzierer@yahoo.de wrote:
i once made a compressor with (almost) plain pd (i think, it uses a few objectclasses from zexy). it is part of dynlib for netpd and is called [rcomp~].
roman
On Tue, 2007-11-27 at 16:08 -0800, Vreahli the Audio Bandit wrote:
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :) _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
On Wed, 28 Nov 2007, Roman Haefeli wrote:
hm.. don't quite know, how to answer this, i'd say yes and no. basically 'waveshaping' means adding non-linear distortions to a signal, a process, which enriches the frequency spectrum of the signal (-> spectrum is altered).
Yes. Many waveshaping functions can be expressed as a sum of powers of the original signal. Each power of the signal is like convolving the spectrum repeatedly with itself. Any smoothly clipping waveshaper will be the sum of an infinite number of powers. Thus you're pretty much guaranteed to have an enriched spectrum as soon as you use a loud enough input.
a waveshaper uses table look-up, so each input value has its corresponding output value
a waveshaper can avoid using a table, and each input value would still have its corresponding output value. actually, i never think of waveshapers in terms of tables. that said, a plain table only gives you an output value for specific input values. [tabread4] pads the rest of input possibilities with a formula... so you pretty much never want to completely get rid of formulas anyway.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
On Wed, 28 Nov 2007 02:10:42 +0100 Roman Haefeli reduzierer@yahoo.de wrote:
hm.. don't quite know, how to answer this, i'd say yes and no. basically 'waveshaping' means adding non-linear distortions to a signal, a process, which enriches the frequency spectrum of the signal (-> spectrum is altered). the goal of all dynamic processing fx as gates, compressors, limters, expanders is to only affect the dynamics of the signal, but not the spectrum. but yeah, they are somehow related: if you use very insane settings for a compressor, let's say 0ms for attack and decay, then you have actually a waveshaper.
You can hear this when applying a traditional compressor to low frequency sounds like electric bass and 808 kick drum where the wavelength of the signal is comparable with the compressor changes. Each cycle gets treated as if it were a separate event. Where compressor and waveshaper diverge is at Gabor period, 20ms (50Hz), it's no coincidence that where perception of frequency vanishes at the lower bound perception of amplitude picks up.
let's say you use very small values but not 0, then it is actually not exactly a waveshaper anymore, althouth the spectrum might still be altered. a waveshaper uses table look-up, so each input value has its corresponding output value, but a compressor with very short attack and decay is more kind of an 'adaptive waveshaper' (i am not that much an expert, so this term might not make any sense). however, what happens is more complex, because the current output value is not only dependent on the actual input value, but also on previous input values (and also if we are actually in 'attack' state or 'release' state).
I suppose, technically, you could say it has become a filter since the current instantaneous output depends on the average of previous input values.
There are really two kinds of compressor. Feed forward compression places the averaging function parallel with the signal path and modifies the output gain. Look-ahead compression delays the signal path and calculates the gain reduction in anticipation. Each has its merits. The "attack" control on a traditional compressor actually does the opposite of what some people expect, it holds off the gain reduction to allow the initial transient through. That's desirable in mixing where you want to change the perception of loudness without needing a limiter since the apparent loudenss is a function of both amplitude and time - so you reduce the "body" of the sound while allowing the subtleties of the attack to come through and leave it clearly defined in the mix - good examples of use are for guitar, bass and drums. A feed forward method is superior here because we don't mess with the timing, which is what we want for percussive sounds. The other kind of use is averaging the overall level, as in vocal passages, in which case a look ahead compressor is better. Legato sounds like vocals and strings are less sensitive to being shifted a few milliseconds back but the levelling process benefits greatly from having a small amount of the signal to anticipate.
a.
On Wed, 28 Nov 2007, Andy Farnell wrote:
without needing a limiter since the apparent loudenss is a function of both amplitude and time - so you reduce the "body" of the sound while allowing the subtleties of the attack to come through and leave it clearly defined in the mix - good examples of use are for guitar, bass and drums.
In the case of guitar and bass, it depends on whether they're already quite clipped (limited) beforehand. If one use a fuzz pedal to get a 90's grunge sound or so, the attack is pretty much gone: you may get less attack than in a violin. If otoh you have an acoustic guitar on which you play any number of pulls on it, the pulls will have sharp loud attacks over a relatively quiet average volume, more so than harpsichord and piano (unless you open the box and pull the strings by hand).
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
On Nov 28, 2007 2:08 AM, Vreahli the Audio Bandit vreahli@gmail.com wrote:
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :)
[env~] gives such a level at control rate. It's also possible to re-block~ a subpatch to 1, calculate whatever average or level you like there, and pass it out; then [bang~] in the containing patch will grab a value from it once per block. It wouldn't be hard to have an audio-rate rms or peak calculator, then use [bang~] and [snapshot~] to read it, if [env~] isn't good enough for you.
-Chuckk
On Wed, 2007-11-28 at 02:57 +0200, Chuckk Hubbard wrote:
On Nov 28, 2007 2:08 AM, Vreahli the Audio Bandit vreahli@gmail.com wrote:
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :)
[env~] gives such a level at control rate. It's also possible to re-block~ a subpatch to 1, calculate whatever average or level you like there, and pass it out; then [bang~] in the containing patch will grab a value from it once per block. It wouldn't be hard to have an audio-rate rms or peak calculator, then use [bang~] and [snapshot~] to read it, if [env~] isn't good enough for you.
if you want to measure each sample, why converting the signal to messages then? why not staying in the audio domain? (staying in the audio domain is actually what [rcomp] does).
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
On Tue, 27 Nov 2007, Vreahli the Audio Bandit wrote:
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :)
You can square your signal using [*~] or other, to turn square-of-amplitude into DC. Then you can low-pass this with [lop~] or other, in order to get a moving average that is smoothly decaying. You can use this measurement of loudness (or any adjusted version of it) to control some waveshaping function or just another [*~].
If you just want a quick smooth clipping, try these:
[expr atan($v1*1.57079)/1.57079] (trigonometric clipping) [expr tanh($v1)] (hyperbolic clipping) [expr erf($v1)] (gaussian clipping)
All three do no gain on quiet sounds, but clip them in different ways when they get louder.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
hello,
here is a very cheap compressor-limiter.
cyrille
Vreahli the Audio Bandit a écrit :
Heya - I'm just curious - is it even possible to build a compressor in PD without coding it in C? The only way I can think of getting the overall loudness of a signal is by checking audio rate stuff - which won't work with control rate values. Just a curiosity. :)
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list