Guest User

Untitled

a guest
May 11th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. ;
  2. ; Deep Bass Nine
  3. ; Copyright (C) 2013 Henrik Andersson <[email protected]>
  4. ;
  5. ; This program is free software: you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation, either version 3 of the License, or
  8. ; (at your option) any later version.
  9. ;
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ; GNU General Public License for more details.
  14. ;
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ;
  18.  
  19.  
  20. <CsoundSynthesizer>
  21.  
  22. <CsOptions>
  23. -odac -M0 -+rtaudio=alsa -+rtmidi=virtual
  24. </CsOptions>
  25.  
  26. <CsInstruments>
  27. sr = 44100
  28. kr = 4410
  29. ksmps = 10
  30. nchnls = 1
  31.  
  32. massign 0, 0
  33. massign 1, 1
  34.  
  35. ; Register control channels
  36. chn_k "Waveform", 1, 1, 0, 0, 1 ; 2 waveforms saw / square
  37. chn_k "Tuning", 1, 2, 0, -1, 1 ; 1 octave range
  38. chn_k "CutOffFreq", 1, 2, 500, 100, 5000
  39. chn_k "Resonance", 1, 2, 5, 1, 500
  40. chn_k "EnvMod", 1, 2, 0.5, 0, 1
  41. chn_k "Decay", 1, 2, 0.5, 0, 1
  42. chn_k "Accent", 1, 2, 0.5, 0, 1
  43. chn_k "Volume", 1, 2, 0.75, 0, 1
  44.  
  45. ; Set defaults
  46. chnset 0, "Waveform"
  47. chnset 0.00, "Tuning"
  48. chnset 200, "CutOffFreq"
  49. chnset 2, "Resonance"
  50. chnset 1.0, "EnvMod"
  51. chnset 0.5, "Decay"
  52. chnset 0.5, "Accent"
  53. chnset 0.75, "Volume"
  54.  
  55. instr Deep_Bass_Nine ; expects MIDI note inputs on channel 1
  56.  
  57. iW chnget "Waveform"
  58. iV chnget "Volume"
  59. iE chnget "EnvMod"
  60. iD chnget "Decay"
  61. iA chnget "Accent"
  62. iCOF chnget "CutOffFreq"
  63. iQ chnget "Resonance"
  64.  
  65. ifreq cpsmidi
  66. ivel ampmidi 1
  67. adec linsegr 0.0, 0.01, 1.0, 10.0 * iD , 0.0, 0.1, 0.0
  68. kdec linsegr 0.0, 0.01, 1.0, 10.0 * iD , 0.0, 0.1, 0.0
  69. a1 oscil 32767 * 0.8 * ivel * adec, ifreq, 1+iW
  70. a2 lowpass2 a1, iCOF * (1.0-((1.0-kdec)*iE)), iQ
  71. out a2
  72. endin
  73.  
  74. </CsInstruments>
  75.  
  76. <CsScore>
  77. f1 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 0.111 ; Saw
  78. f2 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 0.111 ; Square
  79.  
  80. i1 0 10000
  81. e
  82. </CsScore>
  83.  
  84. </CsoundSynthesizer>
Advertisement
Add Comment
Please, Sign In to add comment