Extra "ports" of juce-based plugins using the distrho build system
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.

129 lines
3.7KB

  1. <Cabbage>
  2. form caption("Scantable synthesizer") size(552, 340), colour("black"),pluginID("sca1")
  3. rslider bounds(15, 10, 100, 100) channel("init"), range(50,59,50), caption("Initial"), colour("white"), midictrl(1, 1)
  4. rslider bounds(120, 10, 100, 100) channel("semi"), range(-24,12,-12), caption("Coarse"), colour("white")
  5. rslider bounds(225, 10, 100, 100) channel("detune"), range(-2,2,0), caption("detune"), colour("white")
  6. rslider bounds(330, 10, 100, 100) channel("cutoff"), range(60,22000,4500), caption("Lowpass"), colour("white")
  7. rslider bounds(435, 10, 100, 100) channel("spread"), range(0, 1, .5), caption("Stereo image"), colour("white")
  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(.04, .3, .6, .6), text("Lfo Amp"), colour("white"), channel("lfoamp"), range(0,20, 0)
  16. rslider bounds(.5, .3, .6, .6), text("Lfo Rate"), colour("white"), channel("lforate"), range(.1,20, 0)
  17. }
  18. groupbox bounds(410, 120, 130, 100), text("LFO filter"), plant("lfofilter"){
  19. rslider bounds(0.04, .3, .6, .6), text("Lfo Amp"), colour("white"), channel("lfoamp2"), range(0,2000, 0)
  20. rslider bounds(0.5, .3, .6, .6), text("Lfo Rate"), colour("white"), channel("lforate2"), range(0,20, 0)
  21. }
  22. keyboard pos(15, 240), size(520, 60)
  23. </Cabbage>
  24. <CsoundSynthesizer>
  25. <CsOptions>
  26. -d -n -+rtmidi=null -M0 -b1024 -m0d
  27. </CsOptions>
  28. <CsInstruments>
  29. ; Initialize the global variables.
  30. sr = 44100
  31. ksmps = 64
  32. nchnls = 2
  33. 0dbfs = 1
  34. ;Author: Giorgio Zucco (2012)
  35. ;scantable
  36. gitemp ftgen 2000, 0, 128, -7, 1, 128, 1
  37. gitemp ftgen 3000, 0, 128, -7, 0, 64, 100, 64, 0
  38. gitemp ftgen 4000, 0, 128, -7, 1, 128, 1
  39. gitemp ftgen 5000, 0, 128, -7, 0, 128, 0
  40. gitemp ftgen 29, 0, 4096, 10, 1
  41. ;************************************************
  42. instr 1
  43. ;channel
  44. kcondfn init 50
  45. ksemi1 chnget "semi"
  46. kdetune chnget "detune"
  47. kcut chnget "cutoff"
  48. kreso chnget "reso"
  49. kspread chnget "spread"
  50. iatt chnget "att"
  51. idec chnget "dec"
  52. isus chnget "sus"
  53. irel chnget "rel"
  54. klfoamp chnget "lfoamp"
  55. klforate chnget "lforate"
  56. klfoamp2 chnget "lfoamp2" ;lfo x filter
  57. klforate2 chnget "lforate2"
  58. ;midi
  59. imidinn notnum
  60. iamp ampmidi 1
  61. kbend pchbend 0,2 ;pitch bend
  62. ;lfo
  63. klfo lfo klfoamp,klforate,2
  64. kfreq1 = cpsmidinn(imidinn+kbend+int(ksemi1))+klfo ;controllo midi
  65. kfreq2 = cpsmidinn(imidinn+kbend+kdetune+int(ksemi1))+klfo
  66. kcondfn chnget "init"
  67. ktrig changed kcondfn
  68. if ktrig = 1 then
  69. reinit play
  70. endif
  71. play:
  72. asig1 scantable iamp,kfreq1,i(kcondfn),2000,3000,4000,5000
  73. asig2 scantable iamp,kfreq2,i(kcondfn),2000,3000,4000,5000
  74. ;filter
  75. klfofilter lfo klfoamp2,klforate2,3
  76. afilt1 clfilt asig1,kcut+klfofilter,0,8
  77. afilt2 clfilt asig2,kcut+klfofilter,0,8
  78. ;master
  79. aL clip afilt1,0,0dbfs
  80. aR clip afilt2,0,0dbfs
  81. aoutL = ((aL * kspread) + (aR * (1 - kspread))) *.5
  82. aoutR = ((aL * (1-kspread)) + (aR * kspread)) *.5
  83. kadsr madsr iatt,idec,isus,irel
  84. outs aoutL*kadsr,aoutR*kadsr
  85. endin
  86. </CsInstruments>
  87. <CsScore>
  88. ;Initial Condition/State
  89. f50 0 128 7 0 30 0 2 1 2 0 30 0 30 0 2 -1 2 0 30 0
  90. f51 0 128 7 0 30 0 2 1 2 0 30 0
  91. f52 0 128 10 1 0 1 0 1
  92. f53 0 128 10 1 .9 .8 .7 .6 .5 .4 .3 .2
  93. f54 0 128 10 1 0 2 1 0 0 1 0 2 1
  94. f55 0 128 10 1 1 0 1 2 1 0 1 2 1 0
  95. f56 0 128 7 0 128 0
  96. f57 0 128 7 0 64 1 64 0
  97. f58 0 128 10 1 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1
  98. f59 0 128 7 0 32 1 32 0 32 1 32 0
  99. ;f0 3600
  100. i1 0 36000
  101. </CsScore>
  102. </CsoundSynthesizer>