;Written by Iain McCurdy, 2009 ; 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: ; Add table(s) for exp slider ; Add limits for min/max frequencies ;my flags on Ubuntu: -dm0 -iadc -odac -+rtaudio=jack -b16 -B4096 -+rtmidi=null sr = 44100 ;SAMPLE RATE ksmps = 64 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO) 0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH giExp10000 ftgen 0, 0, 129, -25, 0, 20.0, 128, 10000.0 ;TABLE FOR EXP SLIDER instr 10 ;GUI klimit init 0 idelta = 10.0 ktrig metro 10 if (ktrig == 1) then gkInGain invalue "Input_Gain" gkGateThresh invalue "Gate_Threshold" kmincps invalue "Min_Freq" gkmincps tablei kmincps, giExp10000, 1 kmaxcps invalue "Max_Freq" gkmaxcps tablei kmaxcps, giExp10000, 1 if gkmincps > gkmaxcps - idelta then gkmincps = gkmaxcps - idelta klimit = 1 else klimit = 0 endif outvalue "Min_Freq_Value", gkmincps outvalue "Max_Freq_Value", gkmaxcps outvalue "Limit", klimit endif endin instr 1 aL inch 1 ;READ FIRST/LEFT AUDIO INPUT TO THE COMPUTER aL = aL * gkInGain ;RESCALE AUDIO SIGNAL USING INPUT GAIN CONTROL ;;;;;;;;;AUDIO GATE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; afollow follow2 aL, .0001, .03 ;CREATE A AMPLITUDE FOLLOWING UNIPOLAR SIGNAL kfollow downsamp afollow ;DOWNSAMPLE TO CREATE A K-RATE VERSION OF THE AMPLITUDE FOLLOWING SIGNAL kgate = (kfollow f 1 0 1024 10 1 .2 .15 .1 .2 .1 .05 .02 .01 ;A RICH TONE - USED BY THE PITCH TRACKING SYNTHESIZER f 2 0 131072 10 1 ;A SINE WAVE ;INSTR | START | DURATION i 10 0 3600 ;GUI AND AUDIO INPUTS 72 179 400 200 true 241 226 185 2 2 514 300 {aa607456-d368-4d59-8497-d16d608404c3} true 0 0 center Liberation Sans 18 3 0 0 0 158 220 158 border 5 2 519 2 566 300 {cebe7e5c-304d-4db6-8da2-0e27c0616bab} true 0 0 center Liberation Sans 18 3 0 0 0 158 220 158 border 5 2 520 18 563 280 {c24a85f3-363e-476e-81da-37729ad65bb7} true 0 0 left Liberation Sans 14 3 0 0 0 158 220 158 noborder 1 1 8 180 180 30 {63ab529c-3f14-4886-8215-fd6e8f1a37ce} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Max_Freq 8 163 500 27 {a7c37920-a18a-446b-8b66-6a1119503da0} true 0 0 0.00000000 1.00000000 0.55200000 lin continuous -1.00000000 false Max_Freq_Value 448 180 60 30 {b453c0e4-809f-4074-94fd-506ebb68f3b8} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 73 180 30 {93cc32a5-c161-4212-baeb-c28b120f89a8} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Input_Gain 8 56 500 27 {107836e5-a726-4a83-83b5-c368481d9a48} true 0 0 0.00000000 2.00000000 1.00000000 lin continuous -1.00000000 false Input_Gain 448 73 60 30 {71f0e6eb-f79d-4cd7-80f7-a22cc355e64f} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 109 180 30 {e193ffd3-920b-40d4-9eaa-bd11dad75bff} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Gate_Threshold 8 92 500 27 {e4aa4e7b-5b74-4a61-8bd7-4beea2c0bb93} true 0 0 0.00000000 0.30000000 0.01980000 lin continuous -1.00000000 false Gate_Threshold 448 109 60 30 {dc879380-3a9e-4939-b482-a0b4ee46dac5} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 8 145 180 30 {866a933e-0c0d-493a-84af-29f3557f8e4a} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Min_Freq 8 128 500 27 {fbbd0dd3-c206-4214-aa5e-10d42b909252} true 0 0 0.00000000 1.00000000 0.26800000 lin continuous -1.00000000 false Min_Freq_Value 448 145 60 30 {31c3cb1b-308f-47cd-9396-c81d85a1c30a} true 0 0 right Liberation Sans 9 3 0 0 0 255 255 255 noborder 1 1 6 6 100 30 {78037c31-527b-4eba-beba-f939296eb729} true 0 0 event 1.00000000 On / Off / i1 0 -1 true false rms 8 226 500 10 {6d7a1ba4-fb93-4386-9ab8-498172ff97e3} true 0 0 0.00000000 1.00000000 0.00000000 1.00000000 0.04192121 0.00000000 fill 1 0.00000000 jump 0 234 0 false 0 0 0 8 234 60 30 {6e554bee-8b48-4edd-b180-7d48199200ef} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 cps 8 261 500 10 {8ea565dd-f7f8-491d-a403-ffe0ea30dda6} true 0 0 0.00000000 5.00000000 0.00000000 1.00000000 2.24476480 0.00000000 fill 1 0.00000000 jump 0 234 0 false 0 0 0 8 269 60 30 {13f39f2d-425c-4a77-a2dc-9569d9048cfa} true 0 0 left Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1 Limit 438 199 70 20 {4862a393-c371-4b97-b288-d6561f337911} true 0 0 0.00000000 1.00000000 0.00000000 1.00000000 0.00000000 0.00000000 fill 1 0.00000000 jump 255 0 0 false 0 0 0 438 198 70 20 {98a2d52e-ef0c-4b6a-879a-2e7bc94bc844} true 0 0 center Liberation Sans 10 3 0 0 0 255 255 255 noborder 1 1