--midi-key-cps=4 --midi-velocity=5 ; by Sean Costello, August 23-26, 1999 ; GUI and some additions by Josep M Comajuncosas, July 2001 ; CsoundQt version by Andres Cabrera 2010 sr = 44100 ksmps = 128 nchnls = 2 0dbfs = 1 gasig2 init 0 ; global variable to send pulse waves to ensemble section ga2 init 0 ; global variable to send output of ensemble to reverb instr 1 ; Used to generate simple sawtooth-like waveforms ifreq = 440 * 2 ^((p4 -69)/12) print ifreq iharms=(sr*.4) / ifreq ; Limits number of harmonics in bandlimited ; pulse waveform asig gbuzz 1, ifreq, iharms, 1, .9, 2 kenv madsr 1, 0,1,1.5 aout = kenv * asig * .45 ; The output of instr 19 is sent to the "ensemble" chorusing ; section. None of the dry signal will be heard in the output. gasig2 = gasig2 + aout endin instr 22 ; Ensemble section. Takes static sawtooth waves, ; and produces an animated flanged/chorused/vibratoed ; output. The phase shifter follows the output ; of the ensemble. kVcf1 invalue "Vcf1" kVcf2 invalue "Vcf2" kLfoWave invalue "LfoWave" kLfoDepth invalue "LfoDepth" kLfoFreq invalue "LfoFreq" kPhFreq invalue "PhFreq" kPhFdbk invalue "PhFdbk" kPhQ invalue "PhQ" kPhStages invalue "PhStages" kPhSep invalue "PhSep" ivib = p4 * .00025 ; Determines amount of pitch change/vibrato/ ; chorusing. A value of 1 gives moderately thick ; chorusing, without excessive vibrato. Vary this ; according to taste. ;LFOs ktimea oscil 4, 0.33, 1 ktimeb oscil 4, 0.33, 1, .333 ktimec oscil 4, 0.33, 1, .667 ktimed oscil 1, 5.5, 1 ktimee oscil 1, 5.5, 1, .333 ktimef oscil 1, 5.5, 1, .667 ktime1 = (ktimea + ktimed) * ivib ktime2 = (ktimeb + ktimee) * ivib ktime3 = (ktimec + ktimef) * ivib ;Chorus adummy delayr .030 asig1 deltap3 ktime1 + .012 asig2 deltap3 ktime2 + .012 asig3 deltap3 ktime3 + .012 delayw gasig2 aVcfIn = (asig1 + asig2 + asig3) * .01 ;Vcf klow limit 1-kVcf2,0,1 kband mirror kVcf2,0,1 khigh limit kVcf2-1,0,1 alow, ahigh, aband svfilter aVcfIn, kVcf1, 10 aPhaserIn mac klow,alow,kband,aband,khigh,ahigh outs aband, aband ;Lfo lfo: ilfowave = 10+i(kLfoWave) klfofrq oscil kLfoDepth, kLfoFreq, ilfowave,-1 rigoto end ;rireturn igoto skip0 if ilfowave == kLfoWave kgoto skip0 reinit lfo skip0: kmod = kPhFreq*(1+klfofrq) kmod limit kmod,20,sr/4 ;Phaser phaser: istages = i(kPhStages) aphs phaser2 aPhaserIn, kmod, kPhQ, istages, 2, kPhSep, kPhFdbk aout2=(aPhaserIn + aphs) * .5 rireturn igoto skip1 if istages == kPhStages kgoto skip1 reinit phaser skip1: ga2 = ga2 + aout2 gasig2 = 0 end: endin instr 99 ; Simple implementation of Feedback Delay Network (FDN) ; reverb, as described by John Stautner and Miller ; Puckette, "Designing Multi-Channel Reverberators," kRevWet invalue "RevWet" kRevSize invalue "RevSize" kRevColor invalue "RevColor" atap multitap ga2, 0.00043, 0.0215, 0.00268, 0.0298, 0.00485, 0.0572, 0.00595, 0.0708, 0.00741, 0.0797, 0.0142, 0.134, 0.0217, 0.181, 0.0272, 0.192, 0.0379, 0.346, 0.0841, 0.504 aRvb_FreeL, aRvb_FreeR freeverb ga2, ga2, kRevSize, kRevColor outs aRvb_FreeL*kRevWet + ga2*(1-kRevWet), aRvb_FreeR*kRevWet + ga2*(1-kRevWet) ga2 = 0 endin f1 0 32768 10 1 ; Sine wave for delay line modulation f2 0 8192 9 1 1 .25 ; Cosine wave for gbuzz ;several shapes for the lfo f10 0 32768 10 1;sine f11 0 32768 7 0 15360 1 2048 -1 15360 0;saw up f12 0 32768 7 0 15360 -1 2048 1 15360 0;saw down f13 0 32768 7 0 8192 1 8192 0 8192 -1 8192 0;triangle ; freeverb time constants, as direct (negative) sample, with arbitrary gains f71 0 16 -2 -1116 -1188 -1277 -1356 -1422 -1491 -1557 -1617 0.8 0.79 0.78 0.77 0.76 0.75 0.74 0.73 f72 0 16 -2 -556 -441 -341 -225 0.7 0.72 0.74 0.76 ; Global instrument for ensemble/phaser effect. p4 sets amount ; of pitch change in chorusing. f0 3600 i22 0 3600 .9 ; Global instrument for reverb. i99 0 3600 .93 1.2 1 7000 1 e 674 160 419 351 true 42 46 50 5 123 197 183 {accac81c-0549-4f39-89bd-f30ebc1cabe5} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 border 5 1 6 15 225 102 {87b86b69-2ccf-49f8-a740-12da6b43bbc1} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 border 5 1 238 15 159 102 {5fc6ec37-76f4-4ed4-bd1b-61859b587c8f} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 border 5 1 LfoWave 14 70 112 28 {3dd45672-e874-4f17-af99-0d7f46ee1043} true 0 0 Sine 0 Saw Down 1 Saw Up 2 Triangle 3 3 false 180 83 41 24 {726f5238-9d67-4c2a-a3e1-56b428488266} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 135 83 41 24 {c91e5dc1-52a8-4f32-989e-58a3fb112d44} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 LfoDepth 178 37 40 43 {55d4da74-c0fa-4bea-abe5-ae64d7232af5} true 0 -3 0.00000000 1.00000000 0.93000001 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false LfoFreq 135 37 40 43 {2c434385-4be7-4f8f-bef3-0e0b3892bfad} true 0 -3 0.00100000 20.00000000 18.20009041 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false 342 83 41 24 {fc151be8-3cbc-433e-b501-19855883065e} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 297 83 41 24 {9100d64e-fe82-4c38-b24e-881d33134bb2} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 257 83 41 24 {52b7f52b-ea05-4ba3-9913-037b8357bc12} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 RevColor 340 37 40 43 {c4e6f6b1-59cf-4eb6-8d93-4aa0c46f6ca3} true 0 -3 0.00000000 1.00000000 0.98000002 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false RevSize 296 37 40 43 {874550d5-aa2c-4eaa-b0fd-0aec3075a0c4} true 0 -3 0.05000000 0.99000000 0.92420000 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false RevWet 252 37 40 43 {d5658549-3527-409e-a69c-eb98c38a8092} true 0 -3 0.00000000 1.00000000 0.94000000 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false 60 263 41 24 {35c15a8b-a512-4d9e-b7c5-57e566276fc7} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 128 269 41 24 {ccc15056-4707-4134-8c7f-0c92e81b4fbf} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 126 202 41 24 {153be116-2470-4657-bc01-f125c50262ed} true 0 -3 center top Arial 10 3 0 0 0 255 255 255 noborder 1 0 83 202 41 24 {4b078edb-bad8-400f-8f3f-b7773ae24415} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 35 202 41 24 {059d7a58-e93e-4f19-bbc1-39c3c883b98f} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 PhStages 62 241 37 24 {95465008-7833-49b2-a298-3991593482bc} true 0 -3 left Arial 18 0 0 0 255 255 255 16.00000000 1.00000000 1.00000000 16.00000000 border 1 1 false PhSep 126 227 40 43 {d2011f69-e261-4299-a5a5-aa2cd78f210f} true 0 -3 0.25000000 4.00000000 3.54999995 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false PhQ 126 156 40 43 {83b17987-41d6-4f70-9c25-6943e9f35d59} true 0 -3 0.25000000 4.00000000 3.81250000 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false PhFdbk 82 156 40 43 {c67fe76f-be50-46fa-8e13-21164d40b28f} true 0 -3 -0.99000000 0.95000000 0.89179999 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false PhFreq 38 156 40 43 {7781cd16-eaab-49e7-bf6f-95f7f9981766} true 0 -3 200.00000000 8000.00000000 7376.00000000 lin continuous 0.01000000 false 245 124 0 #512900 0 #512900 true true false 209 123 190 183 {49e3af03-7eca-401a-9592-aaa23125258a} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 border 5 1 Vcf1 232 147 145 150 {54d46c69-3b11-4f33-934f-e487e18fb8d5} true 0 0 Vcf2 100.00000000 10000.00000000 0.00000000 2.00000000 7883.44824219 0.31999999 crosshair 1 0.00000000 jump noborder #00ff00 255 85 0 false 42 46 50 true 14 47 41 24 {c97db846-5e62-45a4-b830-22a562d3695c} true 0 -3 left top Arial 10 3 0 0 0 255 255 255 noborder 1 0 3.00000000 0.93000001 18.20009041 0.98000002 0.92420000 0.94000000 16.00000000 3.54999995 3.81250000 0.89179999 7376.00000000 7883.44824219 0.31999999 0.00000000 0.56000000 2.00090003 0.14000000 0.20039999 0.19000000 1.00000000 0.77499998 0.77499998 -0.05880000 1292.00000000 1533.79309082 1.79999995 ;type ;inst ;start ;dur ;note ;veloc i 1 0 1.25 57 100 i 1 1 1.5 47 100 i 1 2 1 35 100 i 1 3 0.75 58 100 i 1 4 1.75 51 100 i 1 5 0.5 36 100 i 1 6 2 52 100 i 1 0 15 32 100