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.

60 lines
2.1KB

  1. GaussianDust.csd
  2. Iain McCurdy [2013]
  3. <Cabbage>
  4. form caption("Gaussian Dust"), size(325, 350), pluginID("gaus")
  5. image bounds(0, 0, 325, 350), colour("DarkSlateGrey"), shape("rounded"), outline("white"), line(4)
  6. checkbox bounds( 15, 10, 80, 15), text("On/Off"), channel("onoff"), value(1), fontcolour("white")
  7. combobox bounds( 10, 40, 70, 20), channel("mode"), value(2), text("Held", "Reinit")
  8. rslider bounds(90, 10, 60, 60), text("Amplitude"), channel("amp"), range(0, 1, 0.5, 0.5, 0.001), fontcolour("white")
  9. rslider bounds(150, 10, 60, 60), text("Freq."), channel("freq"), range(0.1, 10000, 10, 0.25, 0.01), fontcolour("white")
  10. rslider bounds(205, 10, 60, 60), text("Deviation"), channel("dev"), range(0, 10, 1), fontcolour("white")
  11. rslider bounds(260, 10, 60, 60), text("Spread"), channel("spread"), range(0, 1, 1), fontcolour("white")
  12. xypad bounds( 40, 78, 245, 260), text("Freq./Deviation"), channel("freq", "dev"), rangex(0.1, 10000, 10), rangey(0, 10.00, 0)
  13. </Cabbage>
  14. <CsoundSynthesizer>
  15. <CsOptions>
  16. -dm0 -n -+rtmidi=null -M0
  17. </CsOptions>
  18. <CsInstruments>
  19. sr = 44100
  20. ksmps = 64
  21. nchnls = 2
  22. 0dbfs = 1
  23. instr 1
  24. konoff chnget "onoff" ;read in on/off switch widget value
  25. if konoff==0 goto SKIP ;if on/off switch is off jump to skip label
  26. kamp chnget "amp"
  27. kfreq chnget "freq"
  28. kdev chnget "dev"
  29. kporttime linseg 0,0.01,0.1
  30. kdev portk kdev,kporttime
  31. kmode chnget "mode"
  32. kmode = kmode - 1
  33. kspread chnget "spread"
  34. ktrig changed kmode ;IF gkmode COUNTER IS CHANGED GENERATE A MOMENTARY '1' IMPULSE
  35. if ktrig==1 then ;THEREFORE IF gkmode HAS BEEN CHANGED...
  36. reinit UPDATE ;BEGIN A REINITIALISATION PASS AT LABEL 'UPDATE'
  37. endif ;END OF CONDITIONAL BRANCH
  38. UPDATE: ;LABEL 'UPDATE'. REINITIALISATION BEGINS FROM HERE.
  39. asig gausstrig kamp, kfreq, kdev, i(kmode) ;GENERATE GAUSSIAM TRIGGERS
  40. kpan random 0.5-(kspread*0.5), 0.5+(kspread*0.5)
  41. asigL,asigR pan2 asig,kpan
  42. rireturn ;RETURN FROM REINITIALISATION PASS
  43. outs asigL,asigR ;SEND AUDIO SIGNAL TO OUTPUT
  44. SKIP: ;A label. Skip to here is on/off switch is off
  45. endin
  46. </CsInstruments>
  47. <CsScore>
  48. i 1 0 [60*60*24*7] ;instrument plays for a week
  49. </CsScore>
  50. </CsoundSynthesizer>