You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.2KB

  1. <Cabbage>
  2. form caption("Granular synthesizer") size(428, 220), colour("black"), pluginID("gra1")
  3. rslider bounds(0, 0, 80, 80) channel("random"), range(1, 2000, 200), caption("Random freq"), colour("white"), midictrl(1, 1)
  4. rslider bounds(85, 0, 80, 80) channel("size"), range(0.005,.2, .02), caption("Grain size"), colour("white"), midictrl(1, 2)
  5. rslider bounds(170, 0, 80, 80) channel("density"), range(1, 10, 1), caption("Density"), colour("white"), midictrl(1, 3)
  6. rslider bounds(255, 0, 80, 80) channel("reverb"), range(0, 1, 0), caption("Reverb"), colour("white"), midictrl(1, 4)
  7. rslider bounds(340, 0, 80, 80) channel("freq"), range(0,30, 0), caption("Flanger"), colour("white"), midictrl(1, 5)
  8. combobox bounds(50, 90, 160, 20), channel("func1"), value(14), colour("darkgrey"), text("wt1","wt2","wt3","wt4","wt5","wt6","wt7","wt8","wt9","wt10","wt11","wt12","wt13","wt14")
  9. combobox bounds(220, 90, 160, 20), channel("func2"), value(5), colour("darkgrey"), text("wt1","wt2","wt3","wt4","wt5","wt6","wt7","wt8","wt9","wt10","wt11","wt12","wt13","wt14")
  10. keyboard pos(0, 130), size(420, 50)
  11. </Cabbage>
  12. <CsoundSynthesizer>
  13. <CsOptions>
  14. -d -n -+rtmidi=NULL -M0 --midi-key-cps=5 --midi-velocity-amp=4
  15. ;-n -d -+rtmidi=NULL -M0
  16. </CsOptions>
  17. <CsInstruments>
  18. ;Author: Giorgio Zucco (2012)
  19. sr = 44100
  20. ksmps = 64
  21. nchnls = 2
  22. 0dbfs = 1
  23. gasig1 init 0
  24. gasig2 init 0
  25. giadd ftgen 14,0,8193,9,1,1,0,1.02,.28,0,.98,.14,0,4,.22,0,7,.39,0 ;bell
  26. gihanning ftgen 200,0,8192,-20,2 ;Hanning
  27. gibarlett ftgen 300,0,8192,-20,3 ;Bartlett (Triangle)
  28. instr 1
  29. gkfn1 chnget "func1";grain waveform
  30. gkfn2 chnget "func2";grain waveform
  31. ;grain
  32. kcps = p5*.5 ;grain freq
  33. kfmd chnget "random";variazione random in Hz.
  34. kgdur chnget "size" ;durata dei grani in secondi
  35. iovrlp chnget "density" ;numero di grani sovrapposti
  36. kfreq chnget "freq"
  37. iwfn1 = 200 ;inviluppo a1
  38. iwfn2 = 300 ;inviluppo a2
  39. ;adsr
  40. iatt = 0.2
  41. idec = 1
  42. isus = 1
  43. irel = .5
  44. a1 grain2 kcps,kfmd,kgdur,iovrlp,gkfn1,iwfn1
  45. a2 grain2 kcps*2,kfmd,kgdur,iovrlp,gkfn2,iwfn2
  46. adel1 randh .009,kfreq
  47. adel2 randh .009,kfreq
  48. klfo poscil .01,.1,4 ;Lfo
  49. afl1 flanger a1,adel1+klfo,.9
  50. afl2 flanger a2,adel2+klfo,.9
  51. kadsr mxadsr iatt,idec,isus,irel
  52. aleft clip (a1+afl1)*.1,2,.8
  53. aright clip (a2+afl2)*.1,2,.8
  54. outs (aleft)*kadsr,(aright)*kadsr
  55. vincr gasig1,(aleft)*kadsr
  56. vincr gasig2,(aright)*kadsr
  57. endin
  58. instr 3
  59. klevel chnget "reverb"
  60. al,ar reverbsc gasig1*.5,gasig2*.5,.85,16000,sr,0
  61. kpan1 randomi 0,1,4
  62. kpan2 randomi 0,1,8
  63. aout1,aout2 pan2 al,kpan1
  64. aout3,aout4 pan2 ar,1-kpan2
  65. outs (aout1+aout2)*klevel,(aout3+aout4)*klevel
  66. clear gasig1,gasig2
  67. endin
  68. </CsInstruments>
  69. <CsScore>
  70. f1 0 1024 10 1
  71. f2 0 4096 10 1 0 .111 0 .04 0 .02 0 .012 ;Triangular1
  72. f3 0 4096 10 1 0 .111 0 .04 0 .02 0 .012 0 .009 0 .007;Triangular 2
  73. f5 0 4096 10 1 0 0.3 0 0.2 0 0.14 0 0.1 0 0.09 0 0.07 0 0.06 0 0.05 ;square
  74. f4 0 4096 10 1 0 .333333 0 .2 0 .142857 0 .111111 0 .090909 0 .076923 ; Square
  75. f6 0 4096 10 1 1 1 1 .7 .5 .3 .1 ;pulse
  76. f7 0 4096 10 1 0 0 1;sine+4
  77. f8 0 4096 10 1 0 0 0 1;sine+5
  78. f9 0 4096 10 1 0 0 0 0 1;sine+6
  79. f10 0 4096 10 1 0 0 0 0 0 1;sine+7
  80. f11 0 4096 10 1 0 0 0 0 0 0 1;sine+8
  81. f12 0 4096 10 1 0 0 0 0 0 0 0 1;sine+9
  82. f13 0 4096 10 1 0 0 0 0 0 0 0 0 1;sine+10
  83. f0 36000
  84. i3 0 36000
  85. </CsScore>
  86. </CsoundSynthesizer>