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.

91 lines
3.6KB

  1. <Cabbage>
  2. form caption("pvsWarp") size(440, 90), pluginID("warp")
  3. image pos(0, 0), size(440, 90), colour( 50, 50,75,220), shape("rounded"), outline("white"), line(4)
  4. rslider bounds( 10, 11, 70, 70), text("Scale"), channel("scal"), range(0.1, 4, 1, 0.5, 0.001), colour("LightSlateGrey"), fontcolour("white"), trackercolour("white")
  5. rslider bounds( 80, 11, 70, 70), text("Shift"), channel("shift"), range(-5000, 5000, 0), colour("LightSlateGrey"), fontcolour("white"), trackercolour("white")
  6. rslider bounds(150, 11, 70, 70), text("Feedback"), channel("FB"), range(0, 0.99, 0), colour("LightSlateGrey"), fontcolour("white"), trackercolour("white")
  7. rslider bounds(220, 10, 70, 70), text("FFT Size"), channel("att_table"), range(1, 8, 5, 1,1), colour("LightSlateGrey"), fontcolour("white"), trackercolour("white")
  8. rslider bounds(290, 11, 70, 70), text("Mix"), channel("mix"), range(0, 1.00, 1), colour("LightSlateGrey"), fontcolour("white"), trackercolour("white")
  9. rslider bounds(360, 11, 70, 70), text("Level"), channel("lev"), range(0, 1.00, 0.5), colour("LightSlateGrey"), fontcolour("white"), trackercolour("white")
  10. </Cabbage>
  11. <CsoundSynthesizer>
  12. <CsOptions>
  13. -d -n
  14. </CsOptions>
  15. <CsInstruments>
  16. sr = 44100
  17. ksmps = 32
  18. nchnls = 2
  19. 0dbfs = 1 ;MAXIMUM AMPLITUDE
  20. ;Author: Iain McCurdy (2012)
  21. ;http://iainmccurdy.org/csound.html
  22. /* FFT attribute tables */
  23. giFFTattributes1 ftgen 0, 0, 4, -2, 64, 32, 64, 1
  24. giFFTattributes2 ftgen 0, 0, 4, -2, 128, 64, 128, 1
  25. giFFTattributes3 ftgen 0, 0, 4, -2, 256, 128, 256, 1
  26. giFFTattributes4 ftgen 0, 0, 4, -2, 512, 128, 512, 1
  27. giFFTattributes5 ftgen 0, 0, 4, -2, 1024, 256, 1024, 1
  28. giFFTattributes6 ftgen 0, 0, 4, -2, 2048, 512, 2048, 1
  29. giFFTattributes7 ftgen 0, 0, 4, -2, 4096,1024, 4096, 1
  30. giFFTattributes8 ftgen 0, 0, 4, -2, 8192,2048, 8192, 1
  31. opcode pvswarp_module,a,akkkkiiii
  32. ain,kscal,kshift,kfeedback,kmix,iFFTsize,ioverlap,iwinsize,iwintype xin
  33. aout init 0
  34. ;f_FB pvsinit iFFTsize,ioverlap,iwinsize,iwintype, 0 ;INITIALISE FEEDBACK FSIG
  35. f_anal pvsanal ain+(aout*kfeedback), iFFTsize, ioverlap, iwinsize, iwintype ;ANALYSE AUDIO INPUT SIGNAL AND OUTPUT AN FSIG
  36. ;f_mix pvsmix f_anal, f_FB ;MIX AUDIO INPUT WITH FEEDBACK SIGNAL
  37. f_warp pvswarp f_anal, kscal, kshift ;WARP SPECTRAL ENVELOPE VALUES OF AN F-SIGNAL USING BOTH SCALING AND SHIFTING
  38. ;f_FB pvsgain f_warp, kfeedback ;CREATE FEEDBACK F-SIGNAL FOR NEXT PASS
  39. aout pvsynth f_warp ;RESYNTHESIZE THE f-SIGNAL AS AN AUDIO SIGNAL
  40. if(kfeedback>0) then
  41. aout clip aout,0,0dbfs
  42. endif
  43. amix ntrpol ain, aout, kmix ;CREATE DRY/WET MIX
  44. xout amix
  45. endop
  46. instr 1
  47. ainL,ainR ins
  48. ;ainL,ainR diskin "SynthPad.wav",1,0,1 ;USE FOR TESTING
  49. kscal chnget "scal"
  50. kshift chnget "shift"
  51. kfeedback chnget "FB"
  52. kmix chnget "mix"
  53. klev chnget "lev"
  54. ainL = ainL*klev
  55. ainR = ainR*klev
  56. /* SET FFT ATTRIBUTES */
  57. katt_table chnget "att_table" ; FFT atribute table
  58. katt_table init 5
  59. ktrig changed katt_table
  60. if ktrig==1 then
  61. reinit update
  62. endif
  63. update:
  64. iFFTsize table 0, giFFTattributes1 + i(katt_table) - 1
  65. ioverlap table 1, giFFTattributes1 + i(katt_table) - 1
  66. iwinsize table 2, giFFTattributes1 + i(katt_table) - 1
  67. iwintype table 3, giFFTattributes1 + i(katt_table) - 1
  68. /*-------------------*/
  69. aoutL pvswarp_module ainL,kscal,kshift,kfeedback,kmix,iFFTsize,ioverlap,iwinsize,iwintype
  70. aoutR pvswarp_module ainR,kscal,kshift,kfeedback,kmix,iFFTsize,ioverlap,iwinsize,iwintype
  71. outs aoutR,aoutR
  72. endin
  73. </CsInstruments>
  74. <CsScore>
  75. i 1 0 [60*60*24*7]
  76. </CsScore>
  77. </CsoundSynthesizer>