;Written by Iain McCurdy, 2006 ;Modified for QuteCsound by René, January 2011 ;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817 ;Notes on modifications from original csd: ;my flags on Ubuntu: -dm0 -iadc -odac -+rtaudio=jack -b16 -B4096 -+rtmidi=null sr = 44100 ;SAMPLE RATE ksmps = 8 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE nchnls = 1 ;NUMBER OF CHANNELS (1=MONO, 2=STEREO) 0dbfs = 1 ;MAXIMUM AMPLITUDE instr 1 ktrig metro 10 if (ktrig == 1) then gkgain invalue "Gain" gkthresh invalue "Threshold" gkatt invalue "Attack" gkrel invalue "Release" gkdelay invalue "Delay" gkatten invalue "Attenuation" gkmeter invalue "Meter" endif aL inch 1 ;READ AUDIO FROM LEFT CHANNEL INPUT aL = aL * gkgain ;AUDIO SIGNALS ARE SCALED BY THE GUI GAIN CONTROL kRMS rms aL ;RMS (ROOT MEAN SQUARE) OF THE AUDIO SIGNAL IS SCANNED kdB = dbamp(kRMS) ;RMS OF AMPLITUDE IS CONVERTED TO DECIBELS if (ktrig == 1) then outvalue "Meter", kdB ;UPDATE AMPLITUDE METER endif kgate = (kdB i 1 0 3600 ;INSTRUMENT 1 IS ACTIVE FOR 1 HOUR i 2 0 0 ;INIT 505 216 824 399 true 241 226 185 2 2 512 396 {aa607456-d368-4d59-8497-d16d608404c3} true 0 0 center Liberation Sans 18 3 0 0 0 147 154 255 border 5 2 8 64 180 30 {640b50b7-7200-4f81-8394-89d9843ae939} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Gain 8 41 500 27 {5585fa6f-0f63-4ac3-bf1b-809c2b1d9134} true 0 0 0.00000000 5.00000000 1.00000000 lin continuous -1.00000000 false Gain 448 64 60 30 {b731b52e-e14a-476a-a583-f3b2bd885539} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 517 2 302 396 {52d07e03-b10c-4a36-acd5-f2827b3ef558} true 0 0 center Liberation Sans 18 3 0 0 0 147 154 255 border 5 2 523 26 292 357 {887f16f8-2d28-4cd6-b66f-977a8c6f840e} true 0 0 left Liberation Sans 14 3 0 0 0 255 255 255 noborder 1 1 8 112 180 30 {88fd26ab-b3d0-4374-afeb-4bbf7501191f} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Threshold 8 89 500 27 {7781209e-ceb5-4684-a6c7-ac24fd0bfb47} true 0 0 -90.00000000 0.00000000 -30.00000000 lin continuous -1.00000000 false Threshold 448 112 60 30 {19c429fe-ac90-44b7-b5c0-f22a74fe4613} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 160 180 30 {95ab7a93-2fb1-48b1-b644-5de5fbec8c10} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Attack 8 137 500 27 {7d4b42e7-1928-490c-81d1-da1273f263db} true 0 0 0.00010000 2.00000000 0.01000000 lin continuous -1.00000000 false Attack 448 160 60 30 {ceb6b043-48c8-483a-afd0-789e7d185a1b} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 208 180 30 {73f000b0-8d21-44e4-9abb-431f797ff403} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Release 8 185 500 27 {c33866f6-c383-498a-9b03-6758892edf54} true 0 0 0.00010000 2.00000000 0.10000000 lin continuous -1.00000000 false Release 448 208 60 30 {7e60129f-b001-4cc3-8a1c-edb88e3f8dd9} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 256 180 30 {53a63bf3-316b-412d-807d-cf5b29cba8e9} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Delay 8 233 500 27 {dd0913fc-1d52-453c-969a-2608bbd892e8} true 0 0 0.00010000 2.00000000 0.01000000 lin continuous -1.00000000 false Delay 448 256 60 30 {a095c883-4007-439c-a6e4-0931648a1346} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 304 180 30 {10589c11-749b-42b0-89d2-8f7506eda97d} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Attenuation 8 281 500 27 {0a6cb9ee-8cdf-4542-97d6-bd204214dc96} true 0 0 -90.00000000 0.00000000 -40.00000000 lin continuous -1.00000000 false Attenuation 448 304 60 30 {58dc5624-5d64-49b3-a963-9829791a3725} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 Meter 8 343 500 24 {0c6b5def-91fd-4606-ac9c-69a22929b744} true 0 0 -90.00000000 0.00000000 0.00000000 1.00000000 -27.38463402 0.00000000 fill 1 0.00000000 jump 0 234 0 false 0 0 0 8 367 180 30 {1e70a9ff-d1d7-4700-b0a1-5315f2c9c277} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1