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.

136 lines
4.2KB

  1. <Cabbage>
  2. form caption("HiperSaw synthesizer") size(552, 330), colour("black"),pluginID("hip1")
  3. rslider bounds(15, 10, 100, 100) channel("detune"), range(0,1,.5), caption("Depth"), colour("orange"), midictrl(1, 1)
  4. rslider bounds(120, 10, 100, 100) channel("semi"), range(-12,12,-12), caption("Coarse"), colour("orange")
  5. rslider bounds(225, 10, 100, 100) channel("cutoff"), range(60,22000,12000), caption("Cutoff"), colour("orange")
  6. rslider bounds(330, 10, 100, 100) channel("reso"), range(.1,.99,.2), caption("Resonance"), colour("orange")
  7. rslider bounds(435, 10, 100, 100) channel("spread"), range(0, 1, .5), caption("Stereo image"), colour("orange")
  8. groupbox bounds(15, 120, 240, 100), text("ADSR amplitude"), plant("ADSR"){
  9. rslider bounds(.0, .3, .6, .6), text("A"), colour("orange"), channel("att"), range(0.01,3, .5)
  10. rslider bounds(.25, .3, .6, .6), text("D"), colour("orange"), channel("dec"), range(0,1, .5)
  11. rslider bounds(.5, .3, .6, .6), text("S"), colour("orange"), channel("sus"), range(0,1,.8)
  12. rslider bounds(.75, .3, .6, .6), text("R"), colour("orange"), channel("rel"), range(0.01,3, .2)
  13. }
  14. groupbox bounds(270, 120, 130, 100), text("LFO"), plant("lfo"){
  15. rslider bounds(0.05, .30, .60, .60), text("Lfo Amp"), colour("orange"), channel("lfoamp"), range(0,100, 0)
  16. rslider bounds(.5, .30, .60, .60), text("Lfo Rate"), colour("orange"), channel("lforate"), range(0,20, 0)
  17. ;rslider bounds(115, 30, 60, 60), text("S"), colour("orange"), channel("sus"), range(0,1,.8)
  18. ;rslider bounds(165, 30, 60, 60), text("R"), colour("orange"), channel("rel"), range(0.01,3, .2)
  19. }
  20. groupbox bounds(410, 120, 130, 100), text("LFO filter"), plant("lfofilter"){
  21. rslider bounds(0.05, .30, .60, .60), text("Lfo Amp"), colour("orange"), channel("lfoamp2"), range(0,1000, 0)
  22. rslider bounds(.5, .30, .60, .60), text("Lfo Rate"), colour("orange"), channel("lforate2"), range(0,10, 0)
  23. ;rslider bounds(115, 30, 60, 60), text("S"), colour("orange"), channel("sus"), range(0,1,.8)
  24. ;rslider bounds(165, 30, 60, 60), text("R"), colour("orange"), channel("rel"), range(0.01,3, .2)
  25. }
  26. keyboard pos(1, 240), size(550, 60)
  27. </Cabbage>
  28. <CsoundSynthesizer>
  29. <CsOptions>
  30. -d -n -+rtmidi=null -M0 -b1024 -m0d
  31. </CsOptions>
  32. <CsInstruments>
  33. ; Initialize the global variables.
  34. sr = 44100
  35. ksmps = 64
  36. nchnls = 2
  37. 0dbfs = 1
  38. ;Author: Giorgio Zucco (2012)
  39. ;UDO Hipersaw
  40. opcode Hipersaw2,a,kkki
  41. kamp,kcps,kdetune,ifunc xin
  42. krnd1 poscil kdetune,.1,ifunc
  43. krnd2 poscil kdetune,.2,ifunc
  44. krnd3 poscil kdetune,.3,ifunc
  45. krnd4 poscil kdetune,.4,ifunc
  46. krnd5 poscil kdetune,.5,ifunc
  47. krnd6 poscil kdetune,.6,ifunc
  48. krnd7 poscil kdetune,.7,ifunc
  49. krnd8 poscil kdetune,.8,ifunc
  50. a1 vco2 kamp,kcps,0
  51. a2 vco2 kamp,kcps+kdetune,0
  52. a3 vco2 kamp,kcps+(kdetune+krnd1)*.1,0
  53. a4 vco2 kamp,kcps+(kdetune+krnd2)*.1,0
  54. a5 vco2 kamp,kcps+(kdetune+krnd3)*.1,0
  55. a6 vco2 kamp,kcps+(kdetune+krnd4)*.1,0
  56. a7 vco2 kamp,kcps+(kdetune+krnd5)*.1,0
  57. a8 vco2 kamp,kcps+(kdetune+krnd6)*.1,0
  58. a9 vco2 kamp,kcps+(kdetune+krnd7)*.1,0
  59. a10 vco2 kamp,kcps+(kdetune+krnd8)*.1,0
  60. asum sum a1,a2,a3,a4,a5,a6,a7,a8,a9,a10
  61. xout asum*.3 ; write output
  62. endop
  63. instr 1
  64. ;channel
  65. kdrive chnget "detune"
  66. ksemi1 chnget "semi"
  67. kcut chnget "cutoff"
  68. kreso chnget "reso"
  69. kspread chnget "spread"
  70. iatt chnget "att"
  71. idec chnget "dec"
  72. isus chnget "sus"
  73. irel chnget "rel"
  74. klfoamp chnget "lfoamp"
  75. klforate chnget "lforate"
  76. klfoamp2 chnget "lfoamp2" ;lfo x filter
  77. klforate2 chnget "lforate2"
  78. ;midi
  79. imidinn notnum
  80. iamp ampmidi 1
  81. kbend pchbend 0,2 ;pitch bend
  82. kfreq1 = cpsmidinn(imidinn+kbend+int(ksemi1)) ;controllo midi
  83. kfreq2 = cpsmidinn(imidinn+kbend+int(ksemi1)) ;controllo midi + detune
  84. ;lfo
  85. klfo poscil klfoamp,klforate,1
  86. ;hipersaw waveform
  87. asig1 Hipersaw2 iamp,(kfreq1+klfo),kdrive*8,1
  88. asig2 Hipersaw2 iamp,(kfreq2+klfo),(1-kdrive*8),1
  89. ;filter
  90. klfofilter lfo klfoamp2,klforate2,3
  91. aout1 moogladder asig1,kcut+klfofilter,kreso
  92. aout2 moogladder asig2,kcut+klfofilter,kreso
  93. ;aout1 balance amoog1,asig1
  94. ;aout2 balance amoog2,asig2
  95. ;master
  96. aL clip aout1,0,.9
  97. aR clip aout2,0,.9
  98. aoutL = ((aL * kspread) + (aR * (1 - kspread))) *.5
  99. aoutR = ((aL * (1-kspread)) + (aR * kspread)) *.5
  100. kadsr mxadsr iatt,idec,isus,irel
  101. outs aoutL*kadsr,aoutR*kadsr
  102. endin
  103. </CsInstruments>
  104. <CsScore>
  105. f1 0 4096 10 1
  106. i1 0 36000
  107. </CsScore>
  108. </CsoundSynthesizer>