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.

233 lines
9.0KB

  1. ; Modulating Delays - randomly modulating delays
  2. ; GATE (for gating the incoming signal)
  3. ; On Thrsh / Off Thrsh - thresholds at which the gate will open and close
  4. ; Rise Time - time it takes for the gate to ramp open
  5. ; Rel Time - time it takes for the gate to ramp closed
  6. ; SETUP
  7. ; Pan Width - extent of the random panning effect (0 = all layers centred)
  8. ; Spread - spread of the delay times of the different layers (if only 1 layer is active this control isn't really useful)
  9. ; if 'spread' is zero, all layers' delay time modulated between 'Min Time' and 'Max Time'
  10. ; Layers - Number of layers of modualting delays
  11. ; REVERB - there is a reverb effect within the each delay buffer
  12. ; Amount - amount of reverb signal added to the output of the delay buffer - within the delay buffer -, this will therefore be mixed into the feedback signal and fed back into to reverb also
  13. ; Time - reverb time
  14. ; Damping - damping of high frequencies within the delay effect
  15. ; ** CAUTION MUST BE TAKEN WHEN USING HIGH LEVELS OF DELAY FEEDBACK WITH A HIGH REVERB AMOUNT AS OVERLOADING CAN QUICKLY OCCUR **
  16. ; OUTPUT
  17. ; Dry - level control for the dry (post gate) signal
  18. ; Wet - level control for the wet (delayed) signal
  19. ; SLIDERS
  20. ; Min Time - Minimum delay time in the delay time random modulation
  21. ; Max Time - Maximum delay time in the delay time random modulation
  22. ; Min Rate - Minimum rate in the random modulation
  23. ; Max Rate - Maximum rate in the random modulation
  24. ; Min F.back - Minimum feedback value in the modulation of delay feedback values
  25. ; Max F.back - Maximum feedback value in the modulation of delay feedback values
  26. ; Min Tone - Minimum cutoff frequency in a randomly modulting low-pass filter within each delay buffer
  27. ; Max Tone - Maximum cutoff frequency in a randomly modulting low-pass filter within each delay buffer
  28. <Cabbage>
  29. form size(960, 340), caption("Modulating Delays"), pluginID("mdel")
  30. label bounds(200, 5, 80, 11), text("G A T E"), fontcolour("white")
  31. checkbox bounds( 10, 35,100, 20), text("Gate On/Off") channel("GateActive"), FontColour("White"), colour("lime") value(1)
  32. rslider bounds(100, 20, 60, 60), channel("OnThreshold"), text("On Thrsh."), range(0, 1, 0.05, 0.5, 0.001), colour(30,30,30) trackercolour(100,100,100)
  33. rslider bounds(160, 20, 60, 60), channel("OffThreshold"), text("Off Thrsh."), range(0, 1, 0.01, 0.5, 0.001), colour(30,30,30) trackercolour(100,100,100)
  34. rslider bounds(220, 20, 60, 60), channel("RiseTime"), text("Rise Time"), range(0, 10, 1, 0.5, 0.001), colour(30,30,30) trackercolour(100,100,100)
  35. rslider bounds(280, 20, 60, 60), channel("RelTime"), text("Rel.Time"), range(0, 10, 0.01, 0.5, 0.001), colour(30,30,30) trackercolour(100,100,100)
  36. checkbox bounds(340, 35, 90, 15), text("Gating") channel("gating"), FontColour("White"), colour("red") value(0) shape(ellipse)
  37. label bounds(487, 5, 80, 11), text("S E T U P"), fontcolour("white")
  38. line bounds(405, 25, 3, 50), colour("Grey")
  39. rslider bounds(420, 20, 60, 60), channel("width"), text("Pan Width"),range(0, 0.5, 0.5), colour(100,100,100) trackercolour(100,100,100)
  40. rslider bounds(480, 20, 60, 60), channel("spread"), text("Spread"), range(0, 4, 1, 0.5, 0.001), colour(100,100,100) trackercolour(100,100,100)
  41. rslider bounds(540, 20, 60, 60), channel("layers"), text("Layers"), range(1, 22, 8,1,1), colour(100,100,100) trackercolour(100,100,100)
  42. line bounds(610, 25, 3, 50), colour("Grey")
  43. label bounds(680, 5, 80, 11), text("R E V E R B"), fontcolour("white")
  44. rslider bounds(620, 20, 60, 60), channel("RvbAmt"), text("Amount"), range(0, 0.2, 0.06,1,0.001), colour(100,100,100) trackercolour(100,100,100)
  45. rslider bounds(680, 20, 60, 60), channel("RvbTime"), text("Time"), range(0.01,10, 7), colour(100,100,100) trackercolour(100,100,100)
  46. rslider bounds(740, 20, 60, 60), channel("damping"), text("Damping"), range(0, 1, 0.5), colour(100,100,100) trackercolour(100,100,100)
  47. line bounds(810, 25, 3, 50), colour("Grey")
  48. label bounds(856, 5, 80, 11), text("O U T P U T"), fontcolour("white")
  49. rslider bounds(825, 20, 60, 60), channel("dry"), text("Dry"), range(0, 4, 0, 0.5, 0.001), colour(160,160,160) trackercolour(160,160,160)
  50. rslider bounds(885, 20, 60, 60), channel("wet"), text("Wet"), range(0, 4, 1, 0.5, 0.001), colour(160,160,160) trackercolour(160,160,160)
  51. line bounds( 0, 95,960, 3), colour("Grey")
  52. hslider bounds(10,110, 940, 30), channel("MinTime"), text(Delay Time Minimum), range(0.001, 10, 0.131, 0.5, 0.000001),colour("blue"), trackercolour(blue)
  53. hslider bounds(10,130, 940, 30), channel("MaxTime"), text(Delay Time Maximum), range(0.001, 10, 0.9, 0.5, 0.000001), colour("blue"), trackercolour(blue)
  54. hslider bounds(10,160, 940, 30), channel("MinRate"), text(Random Rate Minimum), range(0.001, 10, 0.1, 0.5, 0.00001), colour("red"), trackercolour(red)
  55. hslider bounds(10,180, 940, 30), channel("MaxRate"), text(Random Rate Maximum), range(0.001, 10, 0.2, 0.5, 0.00001), colour("red"), trackercolour(red)
  56. hslider bounds(10,210, 940, 30), channel("MinFB"), text(Delay Feedback Minimum), range(0, 0.999, 0.95,1,0.001), colour("yellow"), trackercolour(yellow)
  57. hslider bounds(10,230, 940, 30), channel("MaxFB"), text(Delay Feedback Maximum), range(0, 0.999, 0.975,1,0.001), colour("yellow"), trackercolour(yellow)
  58. hslider bounds(10,260, 940, 30), channel("MinTone"), text(Tone Cutoff Frequency Minimum), range(4, 14, 11), colour(purple), trackercolour(purple)
  59. hslider bounds(10,280, 940, 30), channel("MaxTone"), text(Tone Cutoff Frequency Maximum), range(4, 14, 14), colour(purple), trackercolour(purple)
  60. label bounds( 10,320, 200, 12), text("Author: Iain McCurdy |2013|"), FontColour("grey")
  61. </Cabbage>
  62. <CsoundSynthesizer>
  63. <CsOptions>
  64. -n -d
  65. </CsOptions>
  66. <CsInstruments>
  67. sr = 44100
  68. ksmps = 16
  69. nchnls = 2
  70. 0dbfs=1
  71. opcode DelayIteration,aa,aakkkkkkkkkkkKiii
  72. aL,aR,kMinTime,kMaxTime,kMinRate,kMaxRate,kMinFB,kMaxFB,kwidth,kMinTone,kMaxTone,kRvbAmt,kRvbTime,kdamping,ispread,icount,ilayers xin
  73. kdel rspline kMinTime,kMaxTime,kMinRate,kMaxRate
  74. kdel limit kdel,0.001,10
  75. adel interp kdel
  76. kFB rspline kMinFB,kMaxFB,kMinRate,kMaxRate
  77. kFB limit kFB,0,1
  78. iMaxDel = 10
  79. iws = 4
  80. aout1, aout2 init 0
  81. ktone rspline kMinTone, kMaxTone,kMinRate,kMaxRate
  82. ktone = cpsoct(ktone)
  83. idelOS random 0,ispread
  84. abuf delayr iMaxDel+idelOS
  85. aout1 deltap3 adel+idelOS
  86. arvb nreverb aout1, kRvbTime, kdamping
  87. aout1 = aout1 + arvb*kRvbAmt
  88. aout1 dcblock2 aout1
  89. aout1 tone aout1,ktone
  90. delayw aL + aout1*kFB
  91. abuf delayr iMaxDel+idelOS
  92. aout2 deltap3 adel+idelOS
  93. arvb nreverb aout2, kRvbTime, kdamping
  94. aout2 = aout2 + arvb*kRvbAmt
  95. aout2 dcblock2 aout2
  96. aout2 tone aout2,ktone
  97. delayw aR + aout2*kFB
  98. kpan rspline 0.5-kwidth,0.5+kwidth,kMinRate,kMaxRate
  99. kpan limit kpan,0,1
  100. apan interp kpan
  101. aout1 = aout1*(1-apan)
  102. aout2 = aout2*(apan)
  103. amix1,amix2 init 0
  104. amix1 = 0
  105. amix2 = 0
  106. if icount<ilayers then
  107. amix1,amix2 DelayIteration aL,aR,kMinTime,kMaxTime,kMinRate,kMaxRate,kMinFB,kMaxFB,kwidth,kMinTone,kMaxTone,kRvbAmt,kRvbTime,kdamping,ispread,icount+1,ilayers
  108. endif
  109. xout aout1+amix1, aout2+amix2
  110. endop
  111. opcode SwitchPort, k, kki
  112. kin,kupport,idnport xin
  113. kold init 0
  114. kporttime = (kin<kold?idnport:kupport)
  115. kout portk kin, kporttime
  116. kold = kout
  117. xout kout
  118. endop
  119. instr 1
  120. kporttime linseg 0,0.001,1
  121. aL,aR ins
  122. ;aL,aR diskin2 "Synthpad.wav",1,0,1
  123. ;aL diskin2 "loop.wav",1,0,1
  124. ;aR = aL
  125. kMinTime chnget "MinTime"
  126. kMaxTime chnget "MaxTime"
  127. kMinTime portk kMinTime,kMinTime
  128. kMaxTime portk kMaxTime,kMaxTime
  129. kspread chnget "spread"
  130. kMinRate chnget "MinRate"
  131. kMaxRate chnget "MaxRate"
  132. kMinFB chnget "MinFB"
  133. kMaxFB chnget "MaxFB"
  134. kwidth chnget "width"
  135. kMinTone chnget "MinTone"
  136. kMaxTone chnget "MaxTone"
  137. kres chnget "res"
  138. klayers chnget "layers"
  139. klayers init 1
  140. kdry chnget "dry"
  141. kwet chnget "wet"
  142. kGateActive chnget "GateActive"
  143. kOnThreshold chnget "OnThreshold"
  144. kOffThreshold chnget "OffThreshold"
  145. kRiseTime chnget "RiseTime"
  146. kRelTime chnget "RelTime"
  147. kRvbAmt chnget "RvbAmt"
  148. kRvbTime chnget "RvbTime"
  149. kdamping chnget "damping"
  150. /* GATE */
  151. if kGateActive=1 then
  152. krms rms (aL+aR)*0.5
  153. kthreshold init i(kOnThreshold)
  154. kon = 1
  155. koff = 0
  156. if krms>kthreshold then
  157. kgate = 1
  158. kthreshold = kOnThreshold
  159. chnset koff,"gating"
  160. else
  161. kgate = 0
  162. kthreshold = kOffThreshold
  163. chnset kon,"gating"
  164. endif
  165. kgate SwitchPort kgate,kRiseTime,0.1
  166. kgate expcurve kgate,8
  167. agate interp kgate
  168. aL = aL * agate
  169. aR = aR * agate
  170. endif
  171. ktrig trigger kGateActive,0.5,1
  172. if ktrig=1 then
  173. chnset koff,"gating"
  174. endif
  175. /* REINITIALISING */
  176. ktrig changed klayers,kspread
  177. if ktrig=1 then
  178. reinit UPDATE
  179. endif
  180. UPDATE:
  181. /* CALL THE UDO */
  182. aout1,aout2 DelayIteration aL,aR,kMinTime,kMaxTime,kMinRate,kMaxRate,kMinFB,kMaxFB,kwidth,kMinTone,kMaxTone,kRvbAmt,kRvbTime,kdamping,i(kspread),1,i(klayers)
  183. rireturn
  184. outs (aout1 * kwet) + (aL * kdry), (aout2 * kwet) + (aR * kdry)
  185. endin
  186. </CsInstruments>
  187. <CsScore>
  188. i 1 0 360000
  189. </CsScore>
  190. </CsoundSynthesizer>