; Written by Aaron Krister Johnson, 2009 based on code by Ian McCurdy, 2006 ; Ported to CsoundQt by René, January 2011 ; Tested on Ubuntu 10.04 with csound-double cvs January 2011 (previous version have a bug in madsr opcode) and CsoundQt svn rev 800 ;my flags on Ubuntu: -dm0 -odac:plughw -b1024 -B2048 -+rtaudio=alsa -+rtmidi=alsa -Ma sr = 44100 ksmps = 128 nchnls = 2 massign 0, 2 ;all midi to instrument 2 instr 1 ;gui gkndxatt invalue "Index1_Attack" ; init .002 gkndxdec invalue "Index1_Decay" ; init 5 gkndxslev invalue "Index1_Sustain" ; init 0 gkndxrel invalue "Index1_Release" ; init .1 gkndxatt2 invalue "Index2_Attack" ; init .002 gkndxdec2 invalue "Index2_Decay" ; init 5 gkndxslev2 invalue "Index2_Sustain" ; init 0 gkndxrel2 invalue "Index2_Release" ; init .1 gkampatt invalue "Amp_Attack" ; init .002 gkampdec invalue "Amp_Decay" ; init 6 gkampslev invalue "Amp_Sustain" ; init 0 gkamprel invalue "Amp_Release" ; init .1 gkcutoff invalue "Filter_Cutoff" ; init 6000 gkreson invalue "Filter_Reso" ; init 1 gkpan invalue "Pan" ; init .5 gkchorus invalue "Chorus" ; init .333 gkvol invalue "Volume" ; init 1 gkmodratio invalue "Mod_ratio1" ; init 1 gkmodratio2 invalue "Mod_ratio2" ; init 2 gkindex invalue "Mod_index1" ; init 3 gkindex2 invalue "Mod_index2" ; init 2 endin instr 2 ;FM (PM) icps cpsmidi iamp ampmidi 1 i1div2pi = 0.1592 ipanR = i(gkpan) ipanL = 1-ipanR kvol = 20000*gkvol kpeakdev = iamp * gkindex * i1div2pi kpeakdev2 = iamp * gkindex2 * i1div2pi ;ENVELOPES kndxenv madsr i(gkndxatt), i(gkndxdec), i(gkndxslev) + .0000001, i(gkndxrel) kndxenv2 madsr i(gkndxatt2), i(gkndxdec2), i(gkndxslev2) + .0000001, i(gkndxrel2) kampenv madsr i(gkampatt), i(gkampdec), i(gkampslev) + .0000001, i(gkamprel) ;STEREO "CHORUS" ENRICHMENT USING JITTER kjitL jitter i(gkchorus)*3, 2, 5.3 kjitR jitter i(gkchorus)*3, 1.5, 5 ;MODULATORS aModulator oscil kpeakdev * kndxenv, icps * gkmodratio, 1 aModulator2 oscil kpeakdev2 * kndxenv2 , icps * gkmodratio2, 1 aCarrierL phasor icps + kjitL aCarrierR phasor icps + kjitR aCarrierL table aCarrierL + aModulator + aModulator2, 1, 1, 0, 1 aCarrierR table aCarrierR + aModulator + aModulator2, 1, 1, 0, 1 aSigL = aCarrierL * iamp * kampenv aSigR = aCarrierR * iamp * kampenv aFilterL bqrez aSigL, gkcutoff, gkreson aFilterR bqrez aSigR, gkcutoff, gkreson aFilterL balance aFilterL, aSigL aFilterR balance aFilterR, aSigR outs aFilterL * kvol * ipanL, aFilterR * kvol * ipanR endin instr 3 ;init outvalue "_SetPresetIndex", 0 ;call preset 0 endin f 1 0 65537 10 1 i 1 0 3600 ;gui i 3 1 0 ;init 206 182 762 357 true 115 57 0 Index1_Attack 9 80 60 60 {911b84a9-9d4c-47f8-afb2-73a92dafe2e0} true 0 0 0.00100000 8.00000000 0.00200000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 9 135 60 25 {6b68cc2d-5a27-4bb2-8294-dd807cadb857} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 69 135 60 25 {cbd82665-31ad-48a3-aba5-f9fd4e8fae6e} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Index1_Decay 69 80 60 60 {7d3bf49e-7f20-407f-b9a4-99e2fc15392c} true 0 0 0.00000000 15.00000000 5.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 129 135 60 25 {e6534b2f-b17d-48c8-bde3-8537286a946b} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Index1_Sustain 129 80 60 60 {0517db1e-e2a9-4e21-b131-5237a32eaa84} true 0 0 0.00000000 1.00000000 0.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 189 135 60 25 {3dc3998c-57d2-4d36-81d3-e08c689275ce} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Index1_Release 189 80 60 60 {642a7b5c-0b16-4551-afd2-d3a781a77c3b} true 0 0 0.00000000 15.00000000 0.10000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 55 50 150 25 {f686f455-5aaa-49fd-a571-cde60bfc3872} true 0 0 center top Liberation Sans 14 3 255 170 0 255 255 255 noborder 1 0 162 2 460 38 {7e8a6ff4-5d75-4728-a908-e01319f81f17} true 0 0 center top Liberation Sans 24 3 255 170 0 255 255 255 border 10 2 307 50 150 25 {9f4dcfc6-d937-4c05-9073-d30c9b94b4f2} true 0 0 center top Liberation Sans 14 3 255 170 0 255 255 255 noborder 1 0 Index2_Release 441 80 60 60 {91ea6619-d03f-438c-b70f-a87cfb94dca8} true 0 0 0.00000000 15.00000000 0.10000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 441 135 60 25 {a586a41a-3899-439e-886d-06e6c8384382} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Index2_Sustain 381 80 60 60 {d5b27309-17be-4c40-94d4-bcb8a7c4ad4f} true 0 0 0.00000000 1.00000000 0.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 381 135 60 25 {02684d8b-1e21-4151-8942-1473138f3f9f} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Index2_Decay 321 80 60 60 {d62880df-b7b3-45d1-93eb-eb7b92b27c53} true 0 0 0.00000000 15.00000000 5.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 321 135 60 25 {2c1f61b4-0501-490f-9d4e-683120c04e5c} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 261 135 60 25 {cd663376-2b91-47d7-beae-3dc7a197f36a} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Index2_Attack 261 156 60 25 {91205d89-e687-48e0-9f98-eef3d48d3e9b} true 0 0 center top Liberation Sans 10 3 255 170 0 255 255 255 false 1 0 Index2_Attack 261 80 60 60 {e4bf7cef-6d2c-4a47-8feb-f4a9521925b8} true 0 0 0.00100000 4.00000000 0.00200000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 560 50 150 25 {c1cc1d68-f38b-45f4-a172-01a875b1db38} true 0 0 center top Liberation Sans 14 3 255 170 0 255 255 255 noborder 1 0 Amp_Release 694 80 60 60 {2de5d575-ae6b-4222-a405-8cf855ca4540} true 0 0 0.00000000 15.00000000 0.10000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 694 135 60 25 {8561dc11-8894-4ffe-869e-6d377242bdcb} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Amp_Sustain 634 80 60 60 {b7e65561-152f-49ba-8648-d736a189ecf1} true 0 0 0.00000000 1.00000000 0.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 634 135 60 25 {3666178b-6c5f-4166-b887-8f1abb7d6f1e} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Amp_Decay 574 80 60 60 {117d83a7-a0c6-4f6e-8dbe-ea57190fdfce} true 0 0 0.00000000 15.00000000 6.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 574 135 60 25 {3f0e5ab2-195f-421e-8384-ab0233a37897} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 514 135 60 25 {e8aded63-c7e3-4ed6-86c2-1711e18ec8e1} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Amp_Attack 514 156 60 25 {6cf763f2-ac03-4ca4-a54c-a12f86818785} true 0 0 center top Liberation Sans 10 3 255 170 0 255 255 255 false 1 0 Amp_Attack 514 80 60 60 {d5774b21-06c7-4596-b1ff-ec2c7cefbd09} true 0 0 0.00100000 8.00000000 0.00200000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 261 74 240 2 {216349dc-8199-4b97-8726-efa51e366b5b} true 0 0 left top Liberation Sans 10 3 0 0 0 255 170 0 noborder 1 0 514 74 240 2 {abbe067d-7d44-4497-b795-afbaa2fc4e46} true 0 -3 left top Arial 10 3 0 0 0 255 170 0 noborder 1 0 10 74 240 2 {51f609fc-d85d-4fd3-93ac-70fa4f2c1d52} true 0 0 left top Liberation Sans 10 3 0 0 0 255 170 0 noborder 1 0 Filter_Cutoff 381 187 60 60 {7a5e84b3-d6b9-41ed-86e6-430837e87446} true 0 0 100.00000000 8000.00000000 6000.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 376 242 70 25 {1586121c-542b-4144-a452-dd4943ac15c3} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 438 242 70 25 {2c9e9b18-6fe9-4096-bdb8-83fa94effd0e} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Filter_Reso 441 187 60 60 {2ae12c59-ee34-4824-8e24-d2d559fe7210} true 0 0 1.00000000 100.00000000 1.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 513 242 60 25 {91b0fe27-5919-44f7-af73-02b24853ccac} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Pan 515 187 60 60 {6fd29d18-2365-4e34-ad60-90651072c64e} true 0 0 0.00000000 1.00000000 0.50000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 574 242 60 25 {4ebc3645-81a6-4746-b456-a8d6e3c335e3} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Chorus 575 187 60 60 {3132eb42-d99e-43e9-9957-22c978ba67a9} true 0 0 0.00000000 1.00000000 0.33300000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false Mod_ratio1 80 208 80 30 {405f1d03-2d6a-4e08-97aa-76e293f20365} true 0 0 center Liberation Sans 14 0 0 0 222 113 0 0.00100000 0.005 20 false 1 0 210 80 30 {c786fcb1-b6c1-4791-aae2-a61d52ce4522} true 0 0 right top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 0 246 80 30 {ffb2aada-7789-4921-bca3-0d387e02b975} true 0 0 right top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Mod_index1 80 244 80 30 {b6126384-8ca2-4857-8e58-f6cf1639ce03} true 0 0 center Liberation Sans 14 0 0 0 226 114 0 0.00100000 0.005 20 false 3 Mod_index2 255 245 80 30 {cbba6841-eb63-48f5-99d3-bd099d39def4} true 0 0 center Liberation Sans 14 0 0 0 232 117 0 0.00100000 0.005 20 false 2 175 246 80 30 {67fdeb64-4bef-432d-aed8-b1ff29b88655} true 0 0 right top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 175 210 80 30 {9e37c330-d2f9-40b9-a334-c78719f4a371} true 0 0 right top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 Mod_ratio2 255 209 80 30 {418766be-98a2-414b-a199-0b726040b63d} true 0 0 center Liberation Sans 14 0 0 0 232 117 0 0.00100000 0.005 20 false 2 Volume 693 187 60 60 {2bda857d-4de6-40eb-8db7-698052bd6bfa} true 0 0 0.00000000 1.00000000 1.00000000 lin continuous 0.01000000 false 245 124 0 #e87500 0 #512900 true true false 691 242 60 25 {afcf8893-b629-4c34-a82f-aaf46d0a2d72} true 0 0 center top Liberation Sans 12 3 255 170 0 255 255 255 noborder 1 0 6 295 745 90 {076a9f0e-162d-4c3d-91c7-05091e2c7425} true 0 0 -255.00000000 scope 2.00000000 1.00000000 1.00000000 1.00000000 0.00000000 NoTrigger 0.00200000 0.00200000 0.002 5.00000000 5.000 5.00000000 0.00000000 0.000 0.00000000 0.10000000 0.100 0.10000000 0.10000000 0.10000000 0.100 0.00000000 0.00000000 0.000 5.00000000 5.00000000 5.000 0.00200000 0.002 0.00200000 0.10000000 0.10000000 0.100 0.00000000 0.00000000 0.000 6.00000000 6.00000000 6.000 0.00200000 0.002 0.00200000 6000.00000000 6000.00000000 6000.000 1.00000000 1.000 1.00000000 0.50000000 0.500 0.50000000 0.33300000 0.333 0.33300000 1.00000000 3.00000000 2.00000000 2.00000000 1.00000000 1.00000000 1.000