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.

121 lines
5.0KB

  1. <Cabbage>
  2. form caption("Phaser") size(580, 90), pluginID("phsr")
  3. image bounds(0, 0, 580, 90), colour( 100, 110, 130), shape("rounded"), outline(black), line(4)
  4. label bounds(29, 8, 60, 10), text("INPUT"), fontcolour(0,10,30)
  5. combobox bounds(10, 18, 70, 20), channel("input"), value(1), text("Live","Tone","Noise")
  6. label bounds(19, 43, 60, 10), text("LFO SHAPE"), fontcolour(0,10,30)
  7. combobox bounds(10, 53, 70, 20), channel("shape"), value(1), text("Triangle","Sine","Square","Saw","Saw","Rand.Int","Rand.S&H")
  8. rslider bounds( 85, 10, 70, 70), text("Rate"), channel("rate"), range(0,14.00,0.5,0.5, 0.0001), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200), midiCtrl(1,1)
  9. rslider bounds(155, 10, 70, 70), text("Depth"), channel("depth"), range(0, 1.00, 0.5, 1, .01), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200)
  10. rslider bounds(225, 10, 70, 70), text("Freq."), channel("freq"), range(0, 1.00, 0.4, 1, .01), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200)
  11. rslider bounds(295, 10, 70, 70), text("Feedback"), channel("fback"), range(0, 1.00, 0.4, 1, .01), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200)
  12. rslider bounds(365, 10, 70, 70), text("Stages"), channel("stages"), range(1, 64,8, 1, 1), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200)
  13. rslider bounds(435, 10, 70, 70), text("Mix"), channel("mix"), range(0, 1.00,0.5, 1, .01), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200)
  14. rslider bounds(505, 10, 70, 70), text("Level"), channel("level"), range(0, 1.00, 1, 1, .01), colour(100,100,110), fontcolour(0,10,30), trackercolour(255,255,200)
  15. </Cabbage>
  16. <CsoundSynthesizer>
  17. <CsOptions>
  18. -d -n
  19. </CsOptions>
  20. <CsInstruments>
  21. sr = 44100
  22. ksmps = 32
  23. nchnls = 2
  24. 0dbfs = 1
  25. ;Author: Iain McCurdy (2012)
  26. ;http://iainmccurdy.org/csound.html
  27. opcode Phaser,a,akkkKki
  28. ain,krate,kdepth,kfreq,kstages,kfback,ishape xin ;READ IN INPUT ARGUMENTS
  29. if ishape=1 then
  30. klfo lfo kdepth*0.5, krate, 1 ;LFO FOR THE PHASER (TRIANGULAR SHAPE)
  31. elseif ishape=2 then
  32. klfo lfo kdepth*0.5, krate, 0 ;LFO FOR THE PHASER (SINE SHAPE)
  33. elseif ishape=3 then
  34. klfo lfo kdepth*0.5, krate, 2 ;LFO FOR THE PHASER (SQUARE SHAPE)
  35. elseif ishape=4 then
  36. klfo lfo kdepth*0.5, krate, 4 ;LFO FOR THE PHASER (SAWTOOTH)
  37. elseif ishape=5 then
  38. klfo lfo kdepth*0.5, krate, 5 ;LFO FOR THE PHASER (SAWTOOTH)
  39. elseif ishape=6 then
  40. klfo randomi -kdepth*0.5, kdepth*0.5, krate*8 ;LFO FOR THE PHASER (RANDOMI SHAPE)
  41. klfo portk klfo, 1/(krate*8) ;SMOOTH CHANGES OF DIRECTION
  42. elseif ishape=7 then
  43. klfo randomh -kdepth*0.5, kdepth*0.5, krate ;LFO FOR THE PHASER (RANDOMH SHAPE)
  44. endif
  45. aout phaser1 ain, cpsoct((klfo+(kdepth*0.5)+kfreq)), kstages, kfback ;PHASER1 IS APPLIED TO THE INPUT AUDIO
  46. xout aout ;SEND AUDIO BACK TO CALLER INSTRUMENT
  47. endop
  48. opcode PhaserSt,aa,aakkkKki
  49. ainL,ainR,krate,kdepth,kfreq,kstages,kfback,ishape xin ;READ IN INPUT ARGUMENTS
  50. if ishape=1 then
  51. klfo lfo kdepth*0.5, krate, 1 ;LFO FOR THE PHASER (TRIANGULAR SHAPE)
  52. elseif ishape=2 then
  53. klfo lfo kdepth*0.5, krate, 0 ;LFO FOR THE PHASER (SINE SHAPE)
  54. elseif ishape=3 then
  55. klfo lfo kdepth*0.5, krate, 2 ;LFO FOR THE PHASER (SQUARE SHAPE)
  56. elseif ishape=4 then
  57. klfo lfo kdepth*0.5, krate, 4 ;LFO FOR THE PHASER (SAWTOOTH)
  58. elseif ishape=5 then
  59. klfo lfo kdepth*0.5, krate, 5 ;LFO FOR THE PHASER (SAWTOOTH)
  60. elseif ishape=6 then
  61. klfo randomi -kdepth*0.5, kdepth*0.5, krate*8 ;LFO FOR THE PHASER (RANDOMI SHAPE)
  62. klfo portk klfo, 1/(krate*8) ;SMOOTH CHANGES OF DIRECTION
  63. elseif ishape=7 then
  64. klfo randomh -kdepth*0.5, kdepth*0.5, krate ;LFO FOR THE PHASER (RANDOMH SHAPE)
  65. endif
  66. aoutL phaser1 ainL, cpsoct((klfo+(kdepth*0.5)+kfreq)), kstages, kfback ;PHASER1 IS APPLIED TO THE INPUT AUDIO
  67. aoutR phaser1 ainR, cpsoct((klfo+(kdepth*0.5)+kfreq)), kstages, kfback ;PHASER1 IS APPLIED TO THE INPUT AUDIO
  68. xout aoutL,aoutR ;SEND AUDIO BACK TO CALLER INSTRUMENT
  69. endop
  70. instr 1
  71. kporttime linseg 0,0.001,0.05
  72. krate chnget "rate"
  73. kdepth chnget "depth"
  74. kfreq chnget "freq"
  75. kfback chnget "fback"
  76. kstages chnget "stages"
  77. klevel chnget "level"
  78. kmix chnget "mix"
  79. kshape chnget "shape"
  80. kshape init 1
  81. /* INPUT */
  82. kinput chnget "input"
  83. if kinput=1 then
  84. a1,a2 ins
  85. elseif kinput=2 then
  86. a1 vco2 0.1,200
  87. a2 = a1
  88. else
  89. a1 pinkish 0.1
  90. a2 pinkish 0.1
  91. endif
  92. ktrig changed kshape,kstages ; reinitialise for i-rate parms
  93. if ktrig=1 then
  94. reinit RESTART_PHASER
  95. endif
  96. RESTART_PHASER:
  97. ;aPhs1 Phaser a1,krate,kdepth*8,(kfreq*5)+6,kstages,kfback*0.9,i(kshape) ; call UDO
  98. ;aPhs2 Phaser a2,krate,kdepth*8,(kfreq*5)+6,kstages,kfback*0.9,i(kshape)
  99. aPhs1,aPhs2 PhaserSt a1,a2,krate,kdepth*8,(kfreq*5)+6,kstages,kfback*0.9,i(kshape) ; use stereo version to ensure lfo sync for random lfos
  100. rireturn
  101. a1 ntrpol a1,aPhs1,kmix ; wet/dry mix
  102. a2 ntrpol a2,aPhs2,kmix
  103. outs a1* klevel, a2* klevel
  104. endin
  105. </CsInstruments>
  106. <CsScore>
  107. i 1 0 [60*60*24*7]
  108. </CsScore>
  109. </CsoundSynthesizer>