|
- ; Powershape.csd
- ; Iain McCurdy 2012
- ;
- ; Encapsulation of the powershape opcode used for wave distortion
- ;
- ; CONTROLS
- ; --------
- ; Test Tone -- a glissandoing test tone
- ; Amount -- amount of distortion
- ; Level -- output level
-
- <Cabbage>
- form caption("Powershape") size(300,107), pluginID("pshp")
- image bounds(0, 0,300,107), colour("Brown"), shape("rounded"), outline("white"), line(4)
- checkbox bounds(10, 8,130, 12), channel("TestTone"), FontColour("white"), value(0), text("Sine Tone"), colour(yellow)
- hslider bounds( 5, 15,290, 40), colour("white"), trackercolour("white"), channel("amount"), range(1, 500, 1, 0.5,0.001)
- label bounds(130, 47, 60, 11), text("Amount"), fontcolour("white")
- hslider bounds( 5, 55,290, 40), colour("white"), trackercolour("white"), channel("level"), range(0, 50, 0.5, 0.25,0.000001)
- label bounds(135, 87, 60, 11), text("Level"), fontcolour("white")
- }
- </Cabbage>
-
- <CsoundSynthesizer>
-
- <CsOptions>
- -d -n
- </CsOptions>
-
- <CsInstruments>
-
- sr = 44100 ;SAMPLE RATE
- ksmps = 32 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
- nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
- 0dbfs = 1
-
- gisine ftgen 0,0,4096,10,1 ;,0,1/2,0,1/4,0,1/8,0,1/16,0,1/32,0,1/64
-
- instr 1
- kporttime linseg 0,0.001,0.05 ; portamento time ramps up from zero
- gkshape chnget "amount" ; READ WIDGETS...
- gkshape portk gkshape,kporttime
- gklevel chnget "level" ;
- gklevel portk gklevel,kporttime
- gklevel portk gklevel,kporttime
- gkTestTone chnget "TestTone"
- if gkTestTone==1 then ; if test tone selected...
- koct rspline 4,8,0.2,0.5
- asigL poscil 1,cpsoct(koct),gisine ; ...generate a tone
- asigR = asigL ; right channel equal to left channel
- else ; otherwise...
- asigL, asigR ins ; read live inputs
- endif
- ifullscale = 0dbfs ;DEFINE FULLSCALE AMPLITUDE VALUE
- aL powershape asigL, gkshape, ifullscale ;CREATE POWERSHAPED SIGNAL
- aR powershape asigR, gkshape, ifullscale ;CREATE POWERSHAPED SIGNAL
- alevel interp gklevel
- outs aL * alevel, aR * alevel ;WAVESET OUTPUT ARE SENT TO THE SPEAKERS
- endin
-
- </CsInstruments>
-
- <CsScore>
- i 1 0 [3600*24*7]
- </CsScore>
-
-
- </CsoundSynthesizer>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|