By the way - I just looked, and you can save a great deal of trouble using the "array max" object (new in Pd 0.25) - no need for 'until' horror.
(just put the abs~ of the signal into the table).
But "env~" seems incomplete to me if it's only going to compute RMS.
cheers M
On Sun, Mar 09, 2014 at 09:36:31PM +0100, Roman Haefeli wrote:
On Son, 2014-03-09 at 12:23 -0300, Alexandre Torres Porres wrote:
As far as Vanilla goes it does seem like a great solution. Thanks a lot for that, seems to do the trick!
But was really hoping for or even asking for a [peakenv~] like object.
Why does it have to be an extra class and why not an abstraction? I consider abstractions more accessible as you can adapt them on the fly. Personally, I'd prefer abstractions (where the performance penalty isn't too huge).
Yo, I attached an abstraction that extracts both, rms and peak level from the incoming signal. The peak output tries to emulate the behavior of VU meters of analogue mixing desks that have some kind of a fall back delay.
Roman
#N canvas 486 155 295 293 10; #X obj 17 12 inlet~; #N canvas 1064 100 194 249 peak_of_32 0; #X obj 14 70 f; #X obj 63 78 + 1; #X obj 14 44 t b a; #X obj 14 114 sel 0; #X obj 71 122 moses; #X obj 121 124 t a; #X obj 14 150 t b b; #X msg 118 146 0; #X obj 14 175 f; #X obj 14 197 outlet; #X obj 14 16 inlet; #X obj 14 92 mod 32; #X connect 0 0 11 0; #X connect 1 0 0 1; #X connect 2 0 0 0; #X connect 2 1 4 0; #X connect 3 0 6 0; #X connect 4 1 5 0; #X connect 4 1 8 1; #X connect 5 0 4 1; #X connect 6 0 8 0; #X connect 6 1 7 0; #X connect 7 0 4 1; #X connect 8 0 9 0; #X connect 10 0 2 0; #X connect 11 0 1 0; #X connect 11 0 3 0; #X restore 93 77 pd peak_of_32; #X obj 93 120 rmstodb; #N canvas 1064 380 198 399 inertia 0; #X msg 96 111 0; #X obj 15 140 f; #X obj 55 141 + 1; #X obj 69 85 t a b; #X obj 15 248 f; #X obj 49 249 * 0.5; #X obj 15 12 inlet; #X obj 15 313 outlet; #X obj 15 37 t b a; #X obj 42 61 moses; #X obj 15 270 t a a; #X obj 139 196 t a; #X obj 15 175 t b a; #N canvas 590 409 162 222 magic 0; #X obj 26 17 inlet; #X obj 26 179 outlet; #X msg 26 112 1 $1; #X obj 26 134 -; #X obj 26 158 max 0.9; #X obj 26 62 max 0; #X obj 26 41 - 15; #X obj 26 88 * 0.002; #X connect 0 0 6 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 1 0; #X connect 5 0 7 0; #X connect 6 0 5 0; #X connect 7 0 2 0; #X restore 54 205 pd magic; #X connect 0 0 1 1; #X connect 1 0 2 0; #X connect 1 0 12 0; #X connect 2 0 1 1; #X connect 3 0 4 1; #X connect 3 1 0 0; #X connect 4 0 5 0; #X connect 4 0 10 0; #X connect 5 0 4 1; #X connect 6 0 8 0; #X connect 8 0 1 0; #X connect 8 1 9 0; #X connect 9 1 3 0; #X connect 10 0 7 0; #X connect 10 1 11 0; #X connect 11 0 9 1; #X connect 12 0 4 0; #X connect 12 1 13 0; #X connect 13 0 5 1; #X restore 93 98 pd inertia; #N canvas 603 218 325 344 peak_per_block 0; #X obj 204 15 table $0.peak 64; #X obj 17 32 tabsend~ $0.peak; #X obj 17 63 bang~; #X msg 49 139 64; #X obj 49 117 t b b; #X msg 89 148 0; #X obj 49 161 until; #X obj 49 184 f; #X obj 106 185 + 1; #X obj 49 206 tabread $0.peak; #X obj 49 257 moses; #X obj 107 258 t a; #X obj 17 292 f; #X obj 49 231 abs; #X obj 17 87 t b b; #X obj 17 313 outlet; #X obj 17 10 inlet~; #X connect 2 0 14 0; #X connect 3 0 6 0; #X connect 4 0 3 0; #X connect 4 1 5 0; #X connect 5 0 7 1; #X connect 5 0 10 1; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 0 9 0; #X connect 8 0 7 1; #X connect 9 0 13 0; #X connect 10 1 11 0; #X connect 10 1 12 1; #X connect 11 0 10 1; #X connect 12 0 15 0; #X connect 13 0 10 0; #X connect 14 0 12 0; #X connect 14 1 4 0; #X connect 16 0 1 0; #X restore 93 56 pd peak_per_block; #X obj 16 244 outlet; #X obj 16 84 - 100; #X obj 16 62 env~ 4096; #X obj 16 106 t b a; #X obj 93 142 - 100; #X obj 16 181 pack f f; #X obj 16 152 f; #X obj 16 128 del 0; #N canvas 690 175 211 142 NETPD 0; #X msg 9 15 version 0 1 0; #X restore 161 16 pd NETPD 2 0; #N canvas 154 288 158 285 overdrive 0; #X obj 15 43 > 1; #X obj 15 65 sel 1; #X msg 43 109 0; #X msg 15 100 1; #X obj 15 132 change; #X obj 15 154 sel 1 0; #X msg 75 176 64 64 64; #X msg 15 228 color $1 -1; #X obj 15 202 netpd-rgb2iem; #X msg 15 176 200 0 0; #X obj 43 89 del 300; #X obj 15 16 inlet; #X obj 15 250 outlet; #X connect 0 0 1 0; #X connect 1 0 3 0; #X connect 1 0 10 0; #X connect 2 0 4 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 9 0; #X connect 5 1 6 0; #X connect 6 0 8 0; #X connect 7 0 12 0; #X connect 8 0 7 0; #X connect 9 0 8 0; #X connect 10 0 2 0; #X connect 11 0 0 0; #X restore 171 163 pd overdrive; #X connect 0 0 4 0; #X connect 0 0 7 0; #X connect 1 0 3 0; #X connect 1 0 14 0; #X connect 2 0 9 0; #X connect 3 0 2 0; #X connect 4 0 1 0; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 8 0 12 0; #X connect 8 1 11 1; #X connect 9 0 10 1; #X connect 10 0 5 0; #X connect 11 0 10 0; #X connect 12 0 11 0; #X connect 14 0 5 0;
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list