max v2; #N vpatcher 50 40 530 532; #P window setfont Times 10.; #P comment 300 396 163 1310730 Then normalizes the signal back to 1.; #P comment 307 367 147 1310730 Compresses the signal according to the threshold and ratio specified; #P comment 316 350 128 1310730 Expects an audio signal <= 1.; #P comment 340 333 78 1310730 Basic compressor; #P window setfont "Fixedwidth Serif" 10.; #P newex 161 376 115 1441802 expr pow(10.\\\,$f1); #P newex 172 351 32 1441802 i $4; #P newex 144 330 38 1441802 t f b; #P newex 93 309 32 1441802 i $5; #P newex 65 284 38 1441802 t f b; #N comlet (int) release time; #P inlet 342 54 15 0; #N comlet (int) attack time; #P inlet 292 54 15 0; #N comlet (float) compression ratio (inverted); #P inlet 234 78 15 0; #N comlet (float) compression threshold; #P inlet 178 78 15 0; #P window setfont Times 10.; #P comment 327 40 53 1310730 release time; #P comment 330 26 39 1310730 (Arg. 5); #P comment 276 40 51 1310730 attack time; #P comment 279 26 39 1310730 (Arg. 4); #P comment 219 40 57 1310730 compression ratio (inverted); #P comment 222 26 39 1310730 (Arg. 3); #P comment 162 40 57 1310730 compression threshold; #P comment 165 26 39 1310730 (Arg. 2); #P comment 115 40 47 1310730 time resolution (latency); #P comment 116 26 39 1310730 (Arg. 1); #N comlet (int) time resolution (latency); #P inlet 128 78 15 0; #P comment 63 444 141 1310730 compressed and normalized signal; #N comlet (signal) compressed and normalized signal; #P outlet 48 443 15 0; #P window setfont "Fixedwidth Serif" 10.; #P newex 48 422 123 1441802 *~ 1.; #P newex 48 399 27 1441802 *~; #P newex 65 376 38 1441802 line~; #P newex 65 263 27 1441802 1.; #P newex 65 242 89 1441802 sel 1.; #P window setfont Times 10.; #P comment 5 64 103 1310730 signal to be compressed; #N comlet (signal) signal to be comressed; #P inlet 48 78 15 0; #P window setfont "Fixedwidth Serif" 10.; #P newex 161 242 108 1441802 * 1.; #P newex 161 221 98 1441802 expr log10($f1); #P newex 161 200 73 1441802 expr 1./$f1; #P newex 144 309 134 1441802 expr 1./pow(10.\\\,$f1); #P newex 65 200 68 1441802 maximum 0.; #P newex 65 221 93 1441802 / 1.; #P newex 101 175 103 1441802 maximum 0.000001; #P newex 144 284 82 1441802 * 1.; #P newex 144 263 98 1441802 expr log10($f1); #P newex 65 121 82 1441802 t f b b; #P newex 137 150 32 1441802 f $3; #P newex 101 150 32 1441802 f $2; #P newex 65 100 73 1441802 peakamp~ $1; #P connect 13 0 18 0; #P connect 18 0 19 0; #P connect 19 0 20 0; #P fasten 13 0 0 0 53 96 70 96; #P connect 0 0 3 0; #P connect 3 0 8 0; #P connect 8 0 7 0; #P connect 7 0 15 0; #P connect 15 0 16 0; #P connect 16 0 37 0; #P connect 37 0 17 0; #P fasten 39 0 17 0 149 351 70 351; #P connect 17 0 18 1; #P connect 37 1 38 0; #P connect 38 0 17 1; #P fasten 40 0 17 1 177 372 98 372; #P connect 3 1 1 0; #P connect 1 0 6 0; #P fasten 36 0 38 1 347 305 120 305; #P fasten 33 0 1 1 183 142 128 142; #P fasten 6 0 8 1 106 196 128 196; #P connect 22 0 0 1; #P connect 3 2 2 0; #P connect 15 1 4 0; #P connect 4 0 5 0; #P connect 5 0 9 0; #P connect 9 0 39 0; #P fasten 6 0 7 1 106 196 153 196; #P fasten 34 0 2 1 239 146 164 146; #P fasten 6 0 10 0 106 196 166 196; #P connect 10 0 11 0; #P connect 11 0 12 0; #P connect 12 0 41 0; #P connect 41 0 19 1; #P connect 39 1 40 0; #P fasten 35 0 40 1 297 347 199 347; #P fasten 2 0 5 1 142 171 221 171; #P fasten 2 0 12 1 142 171 264 171; #P pop;