hi,
even if nobody on the list has complained, still my `balance' example, (meant to be just a hint, not a solution), if taken literally, was a shameful crap.
followed by a division, instead of subtracting dbs _before_ making only _one_ conversion (due to the pecularity of Pd's db scale, the proper solution must also contain a [+ 100] object). To add to my shame, I still do not know, which way is really better one, because 0db - 0db gives the multiplier equal 1, which is bad (line~ starts from 1 on sound beginning), while 0/0 gives 0, which is really nice...
indeed, since adding smoothing is as simple, as replacing [*~ 1] object with [*~] and inserting a [line~] between this and [dbtorms].
To lighten my burden of shame, here are the two solutions. Each of
the two abstractions, [balance-sub~], and [balance-div~], has three
arguments: one is the size in samples of envelope follower's analysis
window, second is the number of samples between envelope follower's
ticks', and third is the smoothing time in msecs (the defaults are: 1024, window/2, and zero). Its left inlet is the main signal, right inlet is the reference signal, and outlet is the
balanced' signal.
Now, back to work...
Krzysztof
Btw. doc/5.reference/env~.pd is missing...
#N canvas 338 6 441 411 12; #X obj 167 106 -; #X obj 167 180 dbtorms; #X obj 167 141 + 100; #X obj 100 22 inlet~; #X obj 238 22 inlet~; #X obj 145 340 outlet~; #X obj 167 260 line~; #X obj 145 301 *~; #X obj 167 220 pack 0 $3; #X obj 120 61 env~ $1 $2; #X obj 238 61 env~ $1 $2; #X connect 0 0 2 0; #X connect 1 0 8 0; #X connect 2 0 1 0; #X connect 3 0 7 0; #X connect 3 0 9 0; #X connect 4 0 10 0; #X connect 6 0 7 1; #X connect 7 0 5 0; #X connect 8 0 6 0; #X connect 9 0 0 1; #X connect 10 0 0 0;
#N canvas 338 6 389 396 12; #X obj 120 104 dbtorms; #X obj 100 22 inlet~; #X obj 238 22 inlet~; #X obj 100 311 outlet~; #X obj 122 231 line~; #X obj 100 272 *~; #X obj 122 191 pack 0 $3; #X obj 120 61 env~ $1 $2; #X obj 238 61 env~ $1 $2; #X obj 238 104 dbtorms; #X obj 122 154 /; #X connect 0 0 10 1; #X connect 1 0 5 0; #X connect 1 0 7 0; #X connect 2 0 8 0; #X connect 4 0 5 1; #X connect 5 0 3 0; #X connect 6 0 4 0; #X connect 7 0 0 0; #X connect 8 0 9 0; #X connect 9 0 10 0; #X connect 10 0 6 0;