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.

99 lines
2.8KB

  1. <Cabbage>
  2. form caption("pdclip") size(315, 90), pluginID("pdcl")
  3. label bounds( 0, -8,315, 90), colour(20,100,100,200), fontcolour(70,150,150,200), text("pdclip"), shape("rounded"), outline("white"), line(4)
  4. image bounds( 0, 0,315, 90), colour(10,100,200,200), shape("rounded"), outline("white"), line(4)
  5. rslider bounds( 10, 11, 70, 70), text("Width"), channel("width"), range(0, 1.00, 0),fontcolour("white"), colour(20, 70,120), tracker("yellow")
  6. rslider bounds( 75, 11, 70, 70), text("Centre"), channel("center"), range(-1.00, 1.00, 0),fontcolour("white"), colour(20, 70,120), tracker("yellow")
  7. combobox bounds(150, 20, 80, 20), channel("bipolar"), size(80,50), value(2), text("Unipolar", "Bipolar")
  8. checkbox bounds(150, 48,130, 12), channel("TestTone"), FontColour("white"), value(0), text("Sine Tone"), colour(yellow)
  9. rslider bounds(235, 11, 70, 70), text("Level"), channel("level"), range(0, 1.00, 0.7),fontcolour("white"), colour(20, 70,120), tracker("yellow")
  10. }
  11. </Cabbage>
  12. <CsoundSynthesizer>
  13. <CsOptions>
  14. -d -n
  15. </CsOptions>
  16. <CsInstruments>
  17. sr = 44100 ;SAMPLE RATE
  18. ksmps = 32 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
  19. nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
  20. 0dbfs = 1
  21. ;Author: Iain McCurdy (2012)
  22. gisine ftgen 0,0,4096,10,1
  23. instr 1
  24. kporttime linseg 0,0.001,0.05 ; portamento time ramps up from zero
  25. gkwidth chnget "width" ;READ WIDGETS...
  26. gkwidth portk gkwidth,kporttime
  27. gkcenter chnget "center" ;
  28. gkcenter portk gkcenter,kporttime
  29. gkbipolar chnget "bipolar" ;
  30. gkbipolar init 1
  31. gkbipolar = gkbipolar-1
  32. gklevel chnget "level" ;
  33. gklevel portk gklevel,kporttime
  34. gkTestTone chnget "TestTone"
  35. if gkTestTone==1 then ; if test tone selected...
  36. koct rspline 4,8,0.2,0.5
  37. asigL poscil 1,cpsoct(koct),gisine ; ...generate a tone
  38. asigR = asigL ; right channel equal to left channel
  39. else ; otherwise...
  40. asigL, asigR ins ; read live inputs
  41. endif
  42. ifullscale = 0dbfs ;DEFINE FULLSCALE AMPLITUDE VALUE
  43. kSwitch changed gkbipolar ;GENERATE A MOMENTARY '1' PULSE IN OUTPUT 'kSwitch' IF ANY OF THE SCANNED INPUT VARIABLES CHANGE. (OUTPUT 'kSwitch' IS NORMALLY ZERO)
  44. if kSwitch=1 then ;IF A VARIABLE CHANGE INDICATOR IS RECEIVED...
  45. reinit START ;...BEGIN A REINITIALISATION PASS FROM LABEL 'START'
  46. endif ;END OF CONDITIONAL BRANCHING
  47. START: ;LABEL
  48. ;CLIP THE AUDIO SIGNAL USING pdclip
  49. aL pdclip asigL, gkwidth, gkcenter, i(gkbipolar) ; [, ifullscale]]
  50. aR pdclip asigR, gkwidth, gkcenter, i(gkbipolar) ; [, ifullscale]]
  51. rireturn ;RETURN TO PERFORMANCE PASSES FROM INITIALISATION PASS
  52. alevel interp gklevel
  53. outs aL * alevel, aR * alevel ;pdclip OUTPUT ARE SENT TO THE SPEAKERS
  54. endin
  55. </CsInstruments>
  56. <CsScore>
  57. i 1 0 [3600*24*7]
  58. </CsScore>
  59. </CsoundSynthesizer>