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.

76 lines
2.9KB

  1. <Cabbage>
  2. form caption("pvsBlur"), size(235,125) colour( 70, 90,100), pluginID("blur")
  3. image bounds(0, 0,235,125), colour( 70, 90,100), shape("rounded"), outline("white"), line(5)
  4. rslider bounds( 10, 10, 70, 70), text("FFT Size"), channel("att_table"), range(1, 7, 4, 1,1), fontcolour("white"),colour( 70, 90,100),tracker("white")
  5. rslider bounds( 80, 10, 70, 70), text("Mix"), channel("mix"), range(0, 1.00, 1), fontcolour("white"),colour( 70, 90,100),tracker("white")
  6. rslider bounds(150, 10, 70, 70), text("Level"), channel("lev"), range(0, 1.00, 0.5, 0.5), fontcolour("white"),colour( 70, 90,100),tracker("white")
  7. hslider bounds( 10, 70,210, 40), channel("blurtime"), range(0, 2.00, 0.0, 0.5, 0.0001), fontcolour("white"),colour( 70, 90,100),tracker("white")
  8. label bounds( 92,103, 60, 11), text("Blur Time"), fontcolour("white")
  9. </Cabbage>
  10. <CsoundSynthesizer>
  11. <CsOptions>
  12. -d -n
  13. </CsOptions>
  14. <CsInstruments>
  15. sr = 44100
  16. ksmps = 64
  17. nchnls = 2
  18. 0dbfs = 1 ;MAXIMUM AMPLITUDE
  19. ; Author: Iain McCurdy (2012)
  20. ; http://iainmccurdy.org/csound.html
  21. /* FFT attribute tables */
  22. giFFTattributes1 ftgen 0, 0, 4, -2, 128, 64, 128, 1
  23. giFFTattributes2 ftgen 0, 0, 4, -2, 256, 128, 256, 1
  24. giFFTattributes3 ftgen 0, 0, 4, -2, 512, 128, 512, 1
  25. giFFTattributes4 ftgen 0, 0, 4, -2, 1024, 256, 1024, 1
  26. giFFTattributes5 ftgen 0, 0, 4, -2, 2048, 512, 2048, 1
  27. giFFTattributes6 ftgen 0, 0, 4, -2, 4096,1024, 4096, 1
  28. giFFTattributes7 ftgen 0, 0, 4, -2, 8192,2048, 8192, 1
  29. opcode pvsblur_module,a,akkkiiii
  30. ain,kblurtime,kmix,klev,iFFTsize,ioverlap,iwinsize,iwintype xin
  31. f_anal pvsanal ain, iFFTsize, ioverlap, iwinsize, iwintype ;ANALYSE AUDIO INPUT SIGNAL AND OUTPUT AN FSIG
  32. f_blur pvsblur f_anal, kblurtime, 2 ;BLUR AMPLITUDE AND FREQUENCY VALUES OF AN F-SIGNAL
  33. aout pvsynth f_blur ;RESYNTHESIZE THE f-SIGNAL AS AN AUDIO SIGNAL
  34. amix ntrpol ain, aout, kmix ;CREATE DRY/WET MIX
  35. xout amix*klev
  36. endop
  37. instr 1
  38. kblurtime chnget "blurtime"
  39. kmix chnget "mix"
  40. klev chnget "lev"
  41. ainL,ainR ins
  42. ;ainL,ainR diskin "808loop.wav",1,0,1 ;USE FOR TESTING
  43. /* SET FFT ATTRIBUTES */
  44. katt_table chnget "att_table" ; FFT atribute table
  45. katt_table init 5
  46. ktrig changed katt_table
  47. if ktrig==1 then
  48. reinit update
  49. endif
  50. update:
  51. iFFTsize table 0, giFFTattributes1 + i(katt_table) - 1
  52. ioverlap table 1, giFFTattributes1 + i(katt_table) - 1
  53. iwinsize table 2, giFFTattributes1 + i(katt_table) - 1
  54. iwintype table 3, giFFTattributes1 + i(katt_table) - 1
  55. /*-------------------*/
  56. kporttime linseg 0,0.001,0.02
  57. kblurtime portk kblurtime,kporttime
  58. aoutL pvsblur_module ainL,kblurtime,kmix,klev,iFFTsize,ioverlap,iwinsize,iwintype
  59. aoutR pvsblur_module ainR,kblurtime,kmix,klev,iFFTsize,ioverlap,iwinsize,iwintype
  60. outs aoutR,aoutR
  61. endin
  62. </CsInstruments>
  63. <CsScore>
  64. i 1 0 [60*60*24*7]
  65. </CsScore>
  66. </CsoundSynthesizer>