Browse Source

Add cabbage

master
falkTX 7 years ago
parent
commit
d45623e876
100 changed files with 21286 additions and 1 deletions
  1. +33
    -0
      .gitignore
  2. +30
    -1
      Makefile
  3. +101
    -0
      bin/cabbage-extra/Effects/AutopanTremolo.csd
  4. +134
    -0
      bin/cabbage-extra/Effects/BandFilter.csd
  5. +284
    -0
      bin/cabbage-extra/Effects/BreakBeatCutter.csd
  6. +166
    -0
      bin/cabbage-extra/Effects/ConvolutionReverb.csd
  7. +223
    -0
      bin/cabbage-extra/Effects/DelayGrain.csd
  8. +142
    -0
      bin/cabbage-extra/Effects/Doppler.csd
  9. +165
    -0
      bin/cabbage-extra/Effects/DopplerSpin.csd
  10. +351
    -0
      bin/cabbage-extra/Effects/FilterLFO.csd
  11. +89
    -0
      bin/cabbage-extra/Effects/Flanger.csd
  12. +286
    -0
      bin/cabbage-extra/Effects/FormantFilter.csd
  13. +74
    -0
      bin/cabbage-extra/Effects/HRTF3D.csd
  14. +73
    -0
      bin/cabbage-extra/Effects/HighpassFilter.csd
  15. +338
    -0
      bin/cabbage-extra/Effects/LiveSndwarp.csd
  16. +71
    -0
      bin/cabbage-extra/Effects/LowpassFilter.csd
  17. +233
    -0
      bin/cabbage-extra/Effects/ModulatingDelays.csd
  18. +76
    -0
      bin/cabbage-extra/Effects/MultiReverb.csd
  19. +87
    -0
      bin/cabbage-extra/Effects/Phaser1.csd
  20. +95
    -0
      bin/cabbage-extra/Effects/Phaser2.csd
  21. +154
    -0
      bin/cabbage-extra/Effects/Reverse.csd
  22. +481
    -0
      bin/cabbage-extra/Effects/StutterFilter.csd
  23. +108
    -0
      bin/cabbage-extra/Effects/TempoDelay.csd
  24. +83
    -0
      bin/cabbage-extra/Effects/clfilt.csd
  25. +96
    -0
      bin/cabbage-extra/Effects/clip.csd
  26. +98
    -0
      bin/cabbage-extra/Effects/pdclip.csd
  27. +94
    -0
      bin/cabbage-extra/Effects/pvShift.csd
  28. +94
    -0
      bin/cabbage-extra/Effects/pvsAdsyn.csd
  29. +93
    -0
      bin/cabbage-extra/Effects/pvsBandp.csd
  30. +95
    -0
      bin/cabbage-extra/Effects/pvsBandr.csd
  31. +171
    -0
      bin/cabbage-extra/Effects/pvsEffects.csd
  32. +131
    -0
      bin/cabbage-extra/Effects/pvsFreeze.csd
  33. +90
    -0
      bin/cabbage-extra/Effects/pvsWarp.csd
  34. +134
    -0
      bin/cabbage-extra/Effects/resony.csd
  35. +103
    -0
      bin/cabbage-extra/Effects/waveset.csd
  36. +173
    -0
      bin/cabbage-extra/Effects/wguide1.csd
  37. +90
    -0
      bin/cabbage-extra/Effects/wguide2.csd
  38. +177
    -0
      bin/cabbage-extra/Synths/BassGuitar.csd
  39. +198
    -0
      bin/cabbage-extra/Synths/Bell.csd
  40. +269
    -0
      bin/cabbage-extra/Synths/BreakBeatCutter.csd
  41. +95
    -0
      bin/cabbage-extra/Synths/Buzz.csd
  42. +374
    -0
      bin/cabbage-extra/Synths/Choir.csd
  43. +528
    -0
      bin/cabbage-extra/Synths/Chowning.csd
  44. +60
    -0
      bin/cabbage-extra/Synths/GaussianDust.csd
  45. +124
    -0
      bin/cabbage-extra/Synths/Granular.csd
  46. +488
    -0
      bin/cabbage-extra/Synths/GuitarChords.csd
  47. +300
    -0
      bin/cabbage-extra/Synths/InharmonicAdditiveSynth.csd
  48. +91
    -0
      bin/cabbage-extra/Synths/Metalizer.csd
  49. +140
    -0
      bin/cabbage-extra/Synths/Metronome.csd
  50. +198
    -0
      bin/cabbage-extra/Synths/PercFlute.csd
  51. +59
    -0
      bin/cabbage-extra/Synths/PinkNoise.csd
  52. +203
    -0
      bin/cabbage-extra/Synths/Rhythmicon.csd
  53. +379
    -0
      bin/cabbage-extra/Synths/Risset.csd
  54. +339
    -0
      bin/cabbage-extra/Synths/RubbedResonators.csd
  55. +128
    -0
      bin/cabbage-extra/Synths/Scantable.csd
  56. +189
    -0
      bin/cabbage-extra/Synths/StringFeedback.csd
  57. +250
    -0
      bin/cabbage-extra/Synths/Vectorial.csd
  58. +708
    -0
      bin/cabbage-extra/Synths/WavetableSynth.csd
  59. +65
    -0
      bin/cabbage-extra/Synths/Wgclar.csd
  60. +62
    -0
      bin/cabbage-extra/Synths/Wgflute.csd
  61. +64
    -0
      bin/cabbage-extra/Synths/Wgpluck.csd
  62. +97
    -0
      bin/cabbage-extra/Synths/Wguide1.csd
  63. +97
    -0
      bin/cabbage-extra/Synths/Wguide2.csd
  64. +204
    -0
      bin/cabbage-extra/Synths/Wterrain.csd
  65. +486
    -0
      bin/cabbage-extra/Synths/gbuzz_synth.csd
  66. +363
    -0
      bin/cabbage-extra/Synths/hsboscil_synth.csd
  67. +808
    -0
      bin/cabbage-extra/Synths/oscbnk_synth.csd
  68. +100
    -0
      bin/cabbage/Effects/EnvelopeFollower.csd
  69. +263
    -0
      bin/cabbage/Effects/FrequencyShifter.csd
  70. +57
    -0
      bin/cabbage/Effects/LoFi.csd
  71. +121
    -0
      bin/cabbage/Effects/Phaser.csd
  72. +59
    -0
      bin/cabbage/Effects/PingPongDelay.csd
  73. +94
    -0
      bin/cabbage/Effects/Powershape.csd
  74. +71
    -0
      bin/cabbage/Effects/RingModulator.csd
  75. +57
    -0
      bin/cabbage/Effects/StereoChorus.csd
  76. +104
    -0
      bin/cabbage/Effects/pvScale.csd
  77. +90
    -0
      bin/cabbage/Effects/pvSmooth.csd
  78. +76
    -0
      bin/cabbage/Effects/pvsBlur.csd
  79. +114
    -0
      bin/cabbage/Effects/pvsBuffer.csd
  80. +432
    -0
      bin/cabbage/MIDI/MIDI_OUT_MATRIX.csd
  81. +160
    -0
      bin/cabbage/Synths/Additive.csd
  82. +80
    -0
      bin/cabbage/Synths/CrazyPluck.csd
  83. +54
    -0
      bin/cabbage/Synths/Dust.csd
  84. +135
    -0
      bin/cabbage/Synths/HiperSaw.csd
  85. +41
    -0
      bin/cabbage/Synths/WhiteNoise.csd
  86. +612
    -0
      bin/cabbage/Synths/bassline.csd
  87. +77
    -0
      bin/cabbage/Synths/bassline.snaps
  88. +27
    -0
      ports/cabbage/LV2-fx/premake.lua
  89. +27
    -0
      ports/cabbage/LV2-ins/premake.lua
  90. +27
    -0
      ports/cabbage/LV2-midi/premake.lua
  91. +27
    -0
      ports/cabbage/VST-fx/premake.lua
  92. +27
    -0
      ports/cabbage/VST-ins/premake.lua
  93. +27
    -0
      ports/cabbage/VST-midi/premake.lua
  94. +711
    -0
      ports/cabbage/source/BinaryData.cpp
  95. +26
    -0
      ports/cabbage/source/BinaryData.h
  96. +197
    -0
      ports/cabbage/source/CabbageCallOutBox.cpp
  97. +66
    -0
      ports/cabbage/source/CabbageCallOutBox.h
  98. +2255
    -0
      ports/cabbage/source/CabbageCustomWidgets.h
  99. +1886
    -0
      ports/cabbage/source/CabbageGUIClass.cpp
  100. +304
    -0
      ports/cabbage/source/CabbageGUIClass.h

+ 33
- 0
.gitignore View File

@@ -0,0 +1,33 @@
*~
*.a
*.cdbs-orig
*.dll
*.dylib
*.exe
*.la
*.o
*.so
*.so.*

*.lv2
*.make
Makefile
object_script.*.Debug
object_script.*.Release

.directory
.fuse*
.svn
.*.kate-swp
.DS_Store
.kdev_include_paths
.kdev4

bin/lv2
bin/vst
debian
intermediate
lv2_ttl_generator

sdks/ASIOSDK2/*
sdks/vstsdk2.4/*

+ 30
- 1
Makefile View File

@@ -8,8 +8,20 @@ PREFIX = /usr

all:
$(MAKE) -C ports
$(MAKE) gen

# -----------------------------------------
# gen

gen: gen_lv2 gen_vst

gen_lv2:
@./scripts/generate-cabbage-lv2.sh
@./scripts/generate-ttl.sh

gen_vst:
@./scripts/generate-cabbage-vst.sh

# -----------------------------------------
# install

@@ -18,9 +30,13 @@ install:
install -d $(DESTDIR)$(PREFIX)/lib/lv2/
install -d $(DESTDIR)$(PREFIX)/lib/vst/

# install ports
# install plugins
ifneq (,$(wildcard bin/lv2/TheFunction.lv2))
cp -r bin/lv2/*.lv2/ $(DESTDIR)$(PREFIX)/lib/lv2/
endif
ifneq (,$(wildcard bin/vst/TheFunction.so))
cp -r bin/vst/* $(DESTDIR)$(PREFIX)/lib/vst/
endif

# -----------------------------------------
# clean
@@ -28,6 +44,19 @@ install:
clean:
$(MAKE) clean -C ports
rm -rf bin/lv2/*.lv2/
rm -rf bin/lv2-extra/
rm -rf bin/vst-extra/

distclean: clean
$(MAKE) distclean -C ports

# -----------------------------------------
# Custom build types

lv2:
$(MAKE) -C ports lv2
$(MAKE) gen_lv2

vst:
$(MAKE) -C ports vst
$(MAKE) gen_vst

+ 101
- 0
bin/cabbage-extra/Effects/AutopanTremolo.csd View File

@@ -0,0 +1,101 @@
<Cabbage>
form caption("Autopan / Tremolo") size(440, 102), pluginID("aptr")
image pos( 0, 0), size(440, 102), colour("Maroon"), shape("rounded"), outline("white"), line(4)
rslider bounds( 5, 6, 90, 90), text("Freq.[Hz]"), channel("rate"), range(0.1, 50, 0.5, 0.5), textBox(1), trackercolour("tomato")
rslider bounds( 80, 6, 90, 90), text("Tempo[BPM]"), channel("tempo"), range(6, 3000, 30, 0.5, 1), textBox(1), trackercolour("tomato")
rslider bounds(175, 6, 90, 90), text("Depth"), channel("depth"), range(0, 1.00, 1, 0.5), textBox(1), trackercolour("tomato")
rslider bounds(345, 6, 90, 90), text("Level"), channel("level"), range(0, 1.00, 1), textBox(1), trackercolour("tomato")
checkbox bounds(160, 15, 25, 25), colour("yellow"), channel("indicator"), value(0), shape("rounded")
combobox bounds(260, 13, 90,20), channel("mode"), value(1), text("Autopan", "Tremolo")
combobox bounds(260, 38, 90,20), channel("wave"), value(1), text("Sine", "Triangle", "Square", "Randomi", "Randomh")
checkbox bounds(260, 63, 90, 15), text("TEST TONE"), colour("lime"), channel("test"), value(0)


</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-d -n
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2012)

opcode PanTrem,aa,aakkkK
ainL,ainR,krate,kdepth,kmode,kwave xin ;READ IN INPUT ARGUMENTS
ktrig changed kwave ;IF LFO WAVEFORM TYPE IS CHANGED GENERATE A MOMENTARY '1' (BANG)
if ktrig=1 then ;IF A 'BANG' HAS BEEN GENERATED IN THE ABOVE LINE
reinit UPDATE ;BEGIN A REINITIALIZATION PASS FROM LABEL 'UPDATE' SO THAT LFO WAVEFORM TYPE CAN BE UPDATED
endif ;END OF THIS CONDITIONAL BRANCH
UPDATE: ;LABEL CALLED UPDATE
iwave init i(kwave)
iwave limit iwave, 0, 4 ;
if iwave==3 then ;if randomi chosen...
klfo randomi -kdepth,kdepth,krate,1
elseif iwave==4 then ;of randomh chosen...
klfo randomh -kdepth,kdepth,krate,1
else
klfo lfo kdepth, krate, iwave ;CREATE AN LFO
endif
rireturn ;RETURN FROM REINITIALIZATION PASS
klfo = (klfo*0.5)+0.5 ;RESCALE AND OFFSET LFO SO IT STAY WITHIN THE RANGE 0 - 1 ABOUT THE VALUE 0.5
if iwave=2||iwave==4 then ;IF SQUARE WAVE MODULATION HAS BEEN CHOSEN...
klfo portk klfo, 0.001 ;SMOOTH THE SQUARE WAVE A TINY BIT TO PREVENT CLICKS
endif ;END OF THIS CONDITIONAL BRANCH
if kmode=0 then ;PAN ;IF PANNING MODE IS CHOSEN FROM BUTTON BANK...
alfo interp klfo ;INTERPOLATE K-RATE LFO AND CREATE A-RATE VARIABLE
aoutL = ainL*sqrt(alfo) ;REDEFINE GLOBAL AUDIO LEFT CHANNEL SIGNAL WITH AUTO-PANNING
aoutR = ainR*(1-sqrt(alfo)) ;REDEFINE GLOBAL AUDIO RIGHT CHANNEL SIGNAL WITH AUTO-PANNING
kindicator = (klfo>0.5?1:0)
chnset kindicator,"indicator"
elseif kmode=1 then ;TREM ;IF TREMELO MODE IS CHOSEN FROM BUTTON BANK...
kindicator = (klfo>0.5?1:0)
chnset kindicator,"indicator"
klfo = klfo+(0.5-(kdepth*0.5)) ;MODIFY LFO AT ZERO DEPTH VALUE IS 1 AND AT MAX DEPTH CENTRE OF MODULATION IS 0.5
alfo interp klfo ;INTERPOLATE K-RATE LFO AND CREATE A-RATE VARIABLE
aoutL = ainL*(alfo^2) ;REDEFINE GLOBAL AUDIO LEFT CHANNEL SIGNAL WITH TREMELO
aoutR = ainR*(alfo^2) ;REDEFINE GLOBAL AUDIO RIGHT CHANNEL SIGNAL WITH TREMELO
endif ;END OF THIS CONDITIONAL BRANCH
xout aoutL,aoutR ;SEND AUDIO BACK TO CALLER INSTRUMENT
endop

instr 1
krate chnget "rate"
ktempo chnget "tempo"
kdepth chnget "depth"
kmode chnget "mode"
kwave chnget "wave"
klevel chnget "level"
ktest chnget "test"

ktrig changed krate
ktrig2 changed ktempo
if ktrig=1 then
chnset krate*60,"tempo"
elseif ktrig2=1 then
chnset ktempo/60,"rate"
endif

if ktest=1 then
a1 vco2 0.2,300,4,0.5
a2 = a1
else
a1,a2 ins
endif

a1,a2 PanTrem a1,a2,krate,kdepth,kmode-1,kwave-1
a1 = a1 * klevel
a2 = a2 * klevel
outs a1,a2
endin

</CsInstruments>

<CsScore>
i 1 0 [60*60*24*7]
</CsScore>

</CsoundSynthesizer>

+ 134
- 0
bin/cabbage-extra/Effects/BandFilter.csd View File

@@ -0,0 +1,134 @@
<Cabbage>
form caption("Band Filter"), colour("DarkSlateGrey"), size(470, 360), pluginID("band")
xypad bounds(5, 5, 350, 350), channel("cf", "bw"), rangex(0, 1, 0.5), rangey(0, 1, 0.3), text("x:cutoff | y:bandwidth"), colour("white")

checkbox bounds(370, 10, 25, 25), channel("balance"), FontColour("white"), value(0)
label bounds(400, 15, 80, 14), text("Balance"), FontColour("white")

label bounds(375, 43, 85, 15), text("Filter Type"), FontColour("white")
combobox bounds(370, 60,85, 20), channel("type"), value(1), text("reson", "butterbp", "areson", "butterbr")

rslider bounds(368, 93, 90, 90), text("Mix"), fontcolour("white"), channel("mix"), range(0, 1.00, 1), trackercolour("white")
rslider bounds(368,190, 90, 90), text("Level"), fontcolour("white"), channel("level"), range(0, 1.00, 1), trackercolour("white")

rslider bounds(360,283, 50, 30), text("CF"), fontcolour("white"), TextBox(1), channel("cfDisp"), range(1, 20000, 1)
rslider bounds(415,283, 50, 30), text("BW"), fontcolour("white"), TextBox(1), channel("bwDisp"), range(1, 20000, 1)

image bounds(75, 343, 315, 18), colour(75, 85, 90, 100), plant("credit"), line(0){
}
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -n -+rtmidi=null -M0
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2012)

instr 1
kcf chnget "cf"
kbw chnget "bw"
kbalance chnget "balance"

rslider bounds(360,283, 50, 30), text("CF"), fontcolour("white"), TextBox(1), channel("cfDisp"), range(1, 20000, 1)
rslider bounds(415,283, 50, 30), text("BW"), fontcolour("white"), TextBox(1), channel("bwDisp"), range(1, 20000, 1)

image bounds(75, 343, 315, 18), colour(75, 85, 90, 100), plant("credit"), line(0){
}
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -n -+rtmidi=null -M0
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2012)

instr 1
kcf chnget "cf"
kbw chnget "bw"
kbalance chnget "balance"

rslider bounds(360,283, 50, 30), text("CF"), fontcolour("white"), TextBox(1), channel("cfDisp"), range(1, 20000, 1)
rslider bounds(415,283, 50, 30), text("BW"), fontcolour("white"), TextBox(1), channel("bwDisp"), range(1, 20000, 1)

image bounds(75, 343, 315, 18), colour(75, 85, 90, 100), plant("credit"), line(0){
}
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -n -+rtmidi=null -M0
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2012)

instr 1
kcf chnget "cf"
kbw chnget "bw"
kbalance chnget "balance"
ktype chnget "type"
kmix chnget "mix"
klevel chnget "level"
kporttime linseg 0,0.001,0.05

kcf expcurve kcf, 4
kcf scale kcf,18000,20

kbw expcurve kbw, 16
kbw scale kbw,3,0.01

aL,aR ins
;aL,aR diskin2 "seashore.wav",1,0,1
;aL pinkish 1 ;USE FOR TESTING
;aR pinkish 1
kbw limit kbw*kcf,1,20000
chnset kcf,"cfDisp" ;send actual values for cutoff and bandwidth to GUI value boxes
chnset kbw,"bwDisp"

kcf portk kcf,kporttime
kbw portk kbw,kporttime

if ktype==1 then ;if reson chosen...
aFiltL reson aL,kcf,kbw,1
aFiltR reson aR,kcf,kbw,1
elseif ktype==2 then ;or if butterworth bandpass is chosen
aFiltL butbp aL,kcf,kbw
aFiltR butbp aR,kcf,kbw
elseif ktype==3 then ;or if areson is chosen...
aFiltL areson aL,kcf,kbw,1
aFiltR areson aR,kcf,kbw,1
else ;otherwise must be butterworth band reject
aFiltL butbr aL,kcf,kbw
aFiltR butbr aR,kcf,kbw
endif
if kbalance==1 then ;if 'balance' switch is on...
aFiltL balance aFiltL,aL,0.3
aFiltR balance aFiltR,aR,0.3
endif
amixL ntrpol aL,aFiltL,kmix ;create wet/dry mix
amixR ntrpol aR,aFiltR,kmix
outs amixL*klevel,amixR*klevel
endin

</CsInstruments>

<CsScore>
i 1 0 [3600*24*7]
</CsScore>

</CsoundSynthesizer>

+ 284
- 0
bin/cabbage-extra/Effects/BreakBeatCutter.csd View File

@@ -0,0 +1,284 @@
;BreakBeatCutter.csd
;Iain McCurdy, 2013.

; Break Beat Cut Up using the bbcut opcode with additional processing

;==BBCUT==========================================================================================================================
'Sub-division' determines the note duration used as the base unit in cut-ups.
For example a value of 8 represents quavers (eighth notes), 16 represents semiquavers (sixteenth notes) and so on.

'Bar Length' represents the number of beats per bar. For example, a value of 4 represents a 4/4 bar and so on.

'Phrase' defines the number of bars that will elapse before the cutting up pattern restarts from the beginning.

'Stutter' is a separate cut-up process which occasionally will take a very short fragment of the input audio and repeat
it many times.

'Stutter Speed' defines the duration of each stutter in relation to 'Sub-division'.
If subdivision is 8 (quavers / eighth notes) and 'Stutter Speed' is 2 then each stutter will be a semiquaver / sixteenth note.

'Stutter Chance' defines the frequency of stutter moments.
The range for this parameter is 0 to 1. Zero means stuttering will be very unlikely, 1 means it will be very likely.
'Repeats' defines the number of repeats that will be employed in normal cut-up events.
When processing non-rhythmical, unmetered material it may be be more interesting to employ non-whole numbers for parameters such as 'Sub-division', 'Phrase' and 'Stutter Speed'.
;========================================================================================================================




;==FILTER================================================================================================================
Additionally in this example a randomly moving band-pass filter has been implemented.

'Filter Mix' crossfades between the unfiltered bbcut signal and the filtered bbcut signal.

'Cutoff Freq.' consists of two small sliders which determine the range from which random cutoff values are derived.

'Interpolate<=>S&H' fades continuously between an interpolated random function and a sample and hold type random function.

'Filter Div.' controls the frequency subdivision with which new random cutoff frequency values are generated - a value of '1' means that new values are generated once every bar.
;========================================================================================================================



;==WGUIDE================================================================================================================
A waveguide effect can randomly and rhythmically cut into the audio stream
'Chance' defines the probability of this happening. 0=never 1=always
The range of frequencies the effect will choose from is defined by the user as note values.
Frequencies are quatised to adhere to equal temperament.
;========================================================================================================================



;==SQUARE MOD. (Square wave ring modulation)=============================================================================
This effect can similarly randomly and rhythmically cut into the audio stream using the 'chance' control
The range of frequencies the modulator waveform can move between is defined as 'oct' values.
;========================================================================================================================


;==F.SHIFT (Frequency Shifter)===========================================================================================
Similar to the above except using a frequency shifter effect.
;========================================================================================================================

<Cabbage>
form size(440,485), caption("Break Beat Cutter"), pluginID("bbct")

snapshot bounds( 5,450,200, 25), preset("BreakBeatCutter"), master(1), items("Preset 1", "Preset 2", "Preset 3", "Preset 4", "Preset 5", "Preset 6", "Preset 7", "Preset 8", "Preset 9", "Preset 10")

groupbox bounds( 0, 0,440,145), text("CUTTER"), plant("cutter"), FontColour(silver),colour(20,20,20){
rslider bounds( 10, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Sub-div."), channel("subdiv"), range(1, 512, 8, 1, 1)
rslider bounds( 80, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Bar Length"), channel("barlen"), range(1, 16, 2, 1, 1)
rslider bounds(150, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Phrase"), channel("phrase"), range(1, 512, 8, 1, 1)
rslider bounds(220, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Repeats"), channel("repeats"), range(1, 32, 2, 1, 1)
rslider bounds(290, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Stut. Speed"), channel("stutspd"), range(1, 32, 4, 1, 1)
rslider bounds(360, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Stut. Chance"), channel("stutchnc"), range(0, 1.00, 0.5)
hslider bounds( 5, 95,425, 40), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), textBox(1) channel("BPM"), range(10, 500, 110,1,1)
label bounds(198,127, 25, 11), text("BPM"), FontColour("silver")
}



groupbox bounds( 0,145,440,100), text("FILTER"), plant("filter"), FontColour(silver),colour(20,20,20){
rslider bounds( 10, 25, 70, 70), colour(200,100,50,255), trackercolour(200,100,50,255), fontcolour("silver"), text("Mix"), channel("FltMix"), range(0, 1.00, 0.6)
rslider bounds( 80, 25, 70, 70), colour(200,100,50,255), trackercolour(200,100,50,255), fontcolour("silver"), text("Division"), channel("fltdiv"), range(1, 16, 1,1,1)
rslider bounds(150, 25, 70, 70), colour(200,100,50,255), trackercolour(200,100,50,255), fontcolour("silver"), text("Bandwidth"), channel("bw"), range(0.1, 10, 1, 0.5, 0.001)
hslider bounds(220, 25,140, 35), colour(200,100,50,255), trackercolour(200,100,50,255), fontcolour("silver"), channel("cfmin"), range(50, 10000, 50 ,0.5,0.1)
hslider bounds(220, 50,140, 35), colour(200,100,50,255), trackercolour(200,100,50,255), fontcolour("silver"), channel("cfmax"), range(50, 10000, 10000,0.5,0.1)
label bounds(254, 77, 80, 12), text("Cutoff Freq."), FontColour("white")
rslider bounds(360, 25, 70, 70), colour(200,100,50,255), trackercolour(200,100,50,255), fontcolour("silver"), text("Int./S&H"), channel("i_h"), range(0, 1, 0)
}

groupbox bounds( 0,245,220,100), text("WAVE GUIDE"), plant("waveguide"), FontColour(silver),colour(20,20,20){
rslider bounds( 10, 25, 70, 70), colour(150,150,50,255), trackercolour(150,150,50,255), fontcolour("silver"), text("Chance"), channel("WguideChnc"), range(0, 1.00, 0.2)
hslider bounds( 80, 25,140, 35), colour(150,150,50,255), trackercolour(150,150,50,255), fontcolour("silver"), channel("wguidemin"), range(22, 100, 50,1,1)
hslider bounds( 80, 50,140, 35), colour(150,150,50,255), trackercolour(150,150,50,255), fontcolour("silver"), channel("wguidemax"), range(22, 100, 70,1,1)
label bounds(108, 77, 85, 12), text("Pitch Range"), FontColour("white")
}

groupbox bounds(220,245,220,100), text("SQUARE MOD."), plant("sqmod"), FontColour(silver),colour(20,20,20){
rslider bounds( 10, 25, 70, 70), colour(200,150,200,255), trackercolour(200,150,200,255), fontcolour("silver"), text("Chance"), channel("SqModChnc"), range(0, 1.00, 0.2)
hslider bounds( 80, 25,140, 35), colour(200,150,200,255), trackercolour(200,150,200,255), fontcolour("silver"), channel("sqmodmin"), range(1, 14.0, 6)
hslider bounds( 80, 50,140, 35), colour(200,150,200,255), trackercolour(200,150,200,255), fontcolour("silver"), channel("sqmodmax"), range(1, 14.0, 12)
label bounds(108, 77, 85, 12), text("Freq.Range"), FontColour("white")
}

groupbox bounds(0,345,220,100), text("FREQUENCY SHIFT"), plant("fshift"), FontColour(silver),colour(20,20,20){
rslider bounds( 10, 25, 70, 70), colour(250,110,250,255), trackercolour(250,110,250,255), fontcolour("silver"), text("Chance"), channel("FshiftChnc"), range(0, 1.00, 0.2)
hslider bounds( 80, 25,140, 35), colour(250,110,250,255), trackercolour(250,110,250,255), fontcolour("silver"), channel("fshiftmin"), range(-4000, 4000,-1000)
hslider bounds( 80, 50,140, 35), colour(250,110,250,255), trackercolour(250,110,250,255), fontcolour("silver"), channel("fshiftmax"), range(-4000, 4000, 1000)
label bounds(108, 77, 85, 12), text("Freq.Range"), FontColour("white")
}

groupbox bounds(220,345,220,100), text("OUTPUT"), plant("output"), FontColour(silver),colour(20,20,20){
rslider bounds( 10, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Layers"), channel("layers"), range(1, 20, 1,1,1)
rslider bounds( 80, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Dry/Wet"), channel("DryWet"), range(0, 1.00, 0.6)
rslider bounds(150, 25, 70, 70), colour("Tan"), trackercolour("Tan"), fontcolour("silver"), text("Level"), channel("gain"), range(0, 1.00, 0.75)
}
label bounds(10,472, 200, 12), text("Iain McCurdy [2013]"), FontColour("grey")
</Cabbage>

<CsoundSynthesizer>

<CsOptions>
-n -dm0
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 64
nchnls = 2
0dbfs=1
seed 0

gisine ftgen 0,0,131072,10,1

opcode BBCutIteration,aa,aaiiiiiiiii
aL,aR,iBPS, isubdiv, ibarlen, iphrase, irepeats, istutspd, istutchnc, icount, ilayers xin
abbcutL bbcutm aL, iBPS, isubdiv, ibarlen, iphrase, irepeats, istutspd, istutchnc
abbcutR bbcutm aR, iBPS, isubdiv, ibarlen, iphrase, irepeats, istutspd, istutchnc
amixL = 0
amixR = 0
if icount<ilayers then
amixL,amixR BBCutIteration aL,aR, iBPS, isubdiv, ibarlen, iphrase, irepeats, istutspd, istutchnc, icount+1, ilayers
endif
xout abbcutL+amixL,abbcutR+amixL
endop

opcode FreqShifter,a,aki
ain,kfshift,ifn xin ;READ IN INPUT ARGUMENTS
areal, aimag hilbert ain ;HILBERT OPCODE OUTPUTS TWO PHASE SHIFTED SIGNALS, EACH 90 OUT OF PHASE WITH EACH OTHER
asin oscili 1, kfshift, ifn, 0
acos oscili 1, kfshift, ifn, 0.25
;RING MODULATE EACH SIGNAL USING THE QUADRATURE OSCILLATORS AS MODULATORS
amod1 = areal * acos
amod2 = aimag * asin
;UPSHIFTING OUTPUT
aFS = (amod1 - amod2)
xout aFS ;SEND AUDIO BACK TO CALLER INSTRUMENT
endop

instr 1 ; read widgets
gksubdiv chnget "subdiv" ; read in widgets
gkbarlen chnget "barlen"
gkphrase chnget "phrase"
gkrepeats chnget "repeats"
gkstutspd chnget "stutspd"
gkstutchnc chnget "stutchnc"
gkBPM chnget "BPM"
gkfltdiv chnget "fltdiv"
gkDryWet chnget "DryWet"
gkFltMix chnget "FltMix"
gkbw chnget "bw"
gkcfmin chnget "cfmin"
gkcfmax chnget "cfmax"
gki_h chnget "i_h"
gklayers chnget "layers"
gkgain chnget "gain"
konoff chnget "onoff"
endin

instr 2
kSwitch changed gkBPM, gkrepeats, gkphrase, gkstutspd, gkstutchnc, gkbarlen, gksubdiv, gkfltdiv, gklayers ;GENERATE A MOMENTARY '1' PULSE IN OUTPUT 'kSwitch' IF ANY OF THE SCANNED INPUT VARIABLES CHANGE. (OUTPUT 'kSwitch' IS NORMALLY ZERO)
if kSwitch=1 then ;IF I-RATE VARIABLE CHANGE TRIGGER IS '1'...
reinit UPDATE ;BEGIN A REINITIALISATION PASS FROM LABEL 'UPDATE'
endif
UPDATE:

/* INPUT */
aL,aR ins ; live input

;;;; use a loop sound file for testing
;#define SOUNDFILE #"loop.wav"# ; macro
; ilen filelen $SOUNDFILE ; length of sound file
; ibeats = 8 ; number of beats in the drum loop
; ispd = (ilen/ibeats) * (i(gkBPM)/60) ; speed ratio for this sample to sync with master clock
; aL diskin $SOUNDFILE,ispd,0,1 ; read sound file
; aR = aL ; right channel same as left

iBPS = i(gkBPM)/60
kmetro metro iBPS ; metronome used for triggering random parameter changes
; call UDO
;OUTPUT OPCODE INPUT | BPM | SUBDIVISION | BAR_LENGTH | PHRASE_LENGTH | NUM.OF_REPEATS | STUTTER_SPEED | STUTTER_CHANCE
abbcutL,abbcutR BBCutIteration aL,aR, i(gkBPM)/60, i(gksubdiv), i(gkbarlen), i(gkphrase), i(gkrepeats), i(gkstutspd), i(gkstutchnc), 1, i(gklayers)
;FILTER=================================================================================================================================================================
ifreq = iBPS * i(gkfltdiv) ; FREQUENCY WITH WHICH NEW FILTER CUTOFF VALUES ARE GENERATED
kcf1h randomh gkcfmin, gkcfmax, ifreq ; sample and hold random frequency values
kcf1i lineto kcf1h, 1/ifreq ; interpolate values
kcf1 ntrpol kcf1i, kcf1h, gki_h ; crossfade between interpolating and sample and hold type random values
abbFltL resonz abbcutL, kcf1, kcf1*gkbw, 2 ; band-pass filter
abbMixL ntrpol abbcutL, abbFltL, gkFltMix ; crossfade between unfiltered and filter audio signal
kcf2h randomh gkcfmin, gkcfmax, ifreq ; RIGHT CHANNEL
kcf2i lineto kcf2h, 1/ifreq ;
kcf2 ntrpol kcf2i, kcf2h, gki_h ;
abbFltR resonz abbcutR, kcf2, kcf2*gkbw, 2 ;
abbMixR ntrpol abbcutR, abbFltR, gkFltMix ;
;=======================================================================================================================================================================

;WGUIDE1================================================================================================================================================================
kchance chnget "WguideChnc"
kdice trandom kmetro,0,1
if kdice<kchance then
kwguidemin chnget "wguidemin"
kwguidemax chnget "wguidemax"
knum randomh kwguidemin,kwguidemax,iBPS
afrq interp cpsmidinn(int(knum))
kfb randomi 0.8,0.99,iBPS/4
kcf randomi 800,4000,iBPS
abbMixL wguide1 abbMixL*0.7,afrq,kcf,kfb
abbMixR wguide1 abbMixR*0.7,afrq,kcf,kfb
endif
;=======================================================================================================================================================================

;SQUARE MOD==============================================================================================================================================================
kchance chnget "SqModChnc" ; read in widgets
ksqmodmin chnget "sqmodmin" ;
ksqmodmax chnget "sqmodmax" ;
kDiceRoll trandom kmetro,0,1 ; new 'roll of the dice' upon each new time period
if kDiceRoll<kchance then ; if 'roll of the dice' is within chance boundary...
kratei randomi ksqmodmin,ksqmodmax,iBPS ; interpolating random function for modulating waveform frequency
krateh randomh ksqmodmin,ksqmodmax,iBPS ; sample and hold random function for modulating waveform frequency
kcross randomi 0,1,iBPS ; crossfader for morphing between interpolating and S&H functions
krate ntrpol kratei,krateh,kcross ; create crossfaded rate function
amod lfo 1,cpsoct(krate),2 ; modulating waveform (square waveform)
kcf limit cpsoct(krate)*4,20,sr/3 ; cutoff freq for filtering some of the high freq. content of the square wave
amod clfilt amod,kcf,0,2 ; low-pass filter square wave
abbMixL = abbMixL*amod ; ring modulate audio
abbMixR = abbMixR*amod ;
endif
;=======================================================================================================================================================================

;FSHIFT=================================================================================================================================================================
kchance chnget "FshiftChnc" ; read in widgets
kdice trandom kmetro,0,1 ; new 'roll of the dice' upon each new time period
if kdice<kchance then ; if 'roll of the dice' is within chance boundary...
kfshiftmin chnget "fshiftmin" ; read in widgets
kfshiftmax chnget "fshiftmax" ;
kfsfrqi randomi kfshiftmin,kfshiftmax,iBPS*2 ; interpolating random function for modulating waveform frequency
kfsfrqh randomh kfshiftmin,kfshiftmax,iBPS*2 ; sample and hold random function for modulating waveform frequency
kcross randomi 0,1,iBPS*2 ; crossfader for morphing between interpolating and S&H functions
kfsfrq ntrpol kfsfrqi,kfsfrqh,kcross ; create crossfaded rate function modulating waveform (square waveform)
abbMixL FreqShifter abbMixL,kfsfrq,gisine ;
abbMixR FreqShifter abbMixR,kfsfrq,gisine ;
endif ;
;=======================================================================================================================================================================

rireturn ; RETURN FROM REINITIALISATION PASS TO PERFORMANCE TIME PASSES
amixL sum aL*(1-gkDryWet), abbMixL*gkDryWet ;SUM AND MIX DRY SIGNAL AND BBCUT SIGNAL (LEFT CHANNEL)
amixR sum aR*(1-gkDryWet), abbMixR*gkDryWet ;SUM AND MIX DRY SIGNAL AND BBCUT SIGNAL (RIGHT CHANNEL)




outs amixL*gkgain, amixR*gkgain ;SEND AUDIO TO OUTPUTS
endin

</CsInstruments>
<CsScore>
i1 0 36000
i2 0 36000
</CsScore>
</CsoundSynthesizer>

+ 166
- 0
bin/cabbage-extra/Effects/ConvolutionReverb.csd View File

@@ -0,0 +1,166 @@
Convolution Reverb
------------------
You are encouraged to experiment with different impulse files.
You can find some here: http://www.openairlib.net/
The one I reference in this example can be found here: http://www.iainmccurdy.org/CsoundRealtimeExamples/SourceMaterials/Stairwell.wav
NOTE THAT ZERO LATENCY (or close to zero) CONV0LUTION WILL NOT BE POSSIBLE.

Instructions
------------
'Size Ratio' compresses the duration of the impulse file (provided that 'compressed' is chosen for 'resize' mode).
'Curve' defines the shape of an envelope applied to compressed impulse files using GEN16
zero = straight line decaying
positive vals. = increasingly convex decaying
negative vals = increasingly concave decaying
Increase 'iplen' (must be a power of 2) if experiencing performance problems, or reduce it to reduce latency.
'Delay OS' fine tunes the delay applied to the dry signal. Normally this should be zero but adjust it to modify how the dry signal lines up with the convoluted signal.

<Cabbage>
form caption("Convolution Reverb") size(505, 90), pluginID("Conv")
image bounds(0, 0, 505, 90), colour(135, 30, 30,220), shape("rounded"), outline(255,255,150), line(4)
button bounds( 10, 10, 90, 20), text("forward","backward"), channel("FwdBwd"), value(0), fontcolour(250,250,250)
label bounds( 30, 30, 60, 12), text("direction"), fontcolour(250,250,250)
button bounds( 10, 50, 90, 20), text("normal","compressed"), channel("resize"), value(0), fontcolour(250,250,250)
label bounds( 35, 70, 60, 12), text("resize"), fontcolour(250,250,250)
rslider bounds(105, 11, 70, 70), text("Size Ratio"), colour(135, 30, 30), trackercolour(255,255,150), fontcolour(250,250,250), channel("CompRat"), range(0, 1.00, 1)
rslider bounds(170, 11, 70, 70), text("Curve"), colour(135, 30, 30), trackercolour(255,255,150), fontcolour(250,250,250), channel("Curve"), range(-8.00, 8.00, 0)
rslider bounds(235, 11, 70, 70), text("In Skip"), colour(135, 30, 30), trackercolour(255,255,150), fontcolour(250,250,250), channel("skipsamples"), range(0, 1.00, 0)
rslider bounds(300, 11, 70, 70), text("Del.OS."), colour(135, 30, 30), trackercolour(255,255,150), fontcolour(250,250,250), channel("DelayOS"), range(-1.00, 1.00, 0)
rslider bounds(365, 11, 70, 70), text("Mix"), colour(135, 30, 30), trackercolour(255,255,150), fontcolour(250,250,250), channel("mix"), range(0, 1.00, 0.25)
rslider bounds(430, 11, 70, 70), text("Level"), colour(135, 30, 30), trackercolour(255,255,150), fontcolour(250,250,250), channel("level"), range(0, 1.00, 0.4)
}
</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

;Author: Iain McCurdy (2012)

; IMPULSE RESPONSES STORED AS STEREO GEN01 FUNCTION TABLES
giImpulse ftgen 1, 0, 262144, 1, "stairwell.wav", 0, 0, 0 ;stereo file, duration 1.176s

; reverse function table UDO
opcode tab_reverse,i,i
ifn xin
iTabLen = nsamp(ifn)
iTableRev ftgen ifn+100,0,-iTabLen,-2, 0
icount = 0
loop:
ival table iTabLen-icount-1, ifn
tableiw ival,icount,iTableRev
loop_lt icount,1,iTabLen,loop
xout iTableRev
endop

; compress function table UDO
opcode tab_compress,i,iii
ifn,iCompRat,iCurve xin
iTabLen = nsamp(ifn)
iTabLenComp = int(nsamp(ifn)*iCompRat)
iTableComp ftgen ifn+200,0,-iTabLenComp,-2, 0
iAmpScaleTab ftgen ifn+300,0,-iTabLenComp,-16, 1,iTabLenComp,iCurve,0
icount = 0
loop:
ival table icount, ifn
iAmpScale table icount, iAmpScaleTab
tableiw ival*iAmpScale,icount,iTableComp
loop_lt icount,1,iTabLenComp,loop
xout iTableComp
endop

; compress reverse function table UDO
opcode tab_compress_rev,i,iii
ifn,iCompRat,iCurve xin
iTabLen = nsamp(ifn)
iTabLenComp = int(nsamp(ifn)*iCompRat)
iTableComp ftgen ifn+400,0,-iTabLenComp,-2, 0
iAmpScaleTab ftgen ifn+500,0,-iTabLenComp,-16, 1,iTabLenComp,iCurve,0
icount = 0
loop:
ival table icount, ifn
iAmpScale table icount, iAmpScaleTab
tableiw ival*iAmpScale, iTabLenComp-icount-1,iTableComp
loop_lt icount,1,iTabLenComp,loop
xout iTableComp
endop

instr 1 ;CONVOLUTION REVERB INSTRUMENT
kFwdBwd chnget "FwdBwd"
kresize chnget "resize"
kmix chnget "mix"
klevel chnget "level"
kCompRat chnget "CompRat"
kCurve chnget "Curve"
kskipsamples chnget "skipsamples"
kDelayOS chnget "DelayOS"
kCompRat init 1 ;IF THIS IS LEFT UNINITIALISED A CRASH WILL OCCUR!
ainL,ainR ins ;READ STEREO AUDIO INPUT
;ainL,ainR diskin2 "808loop.wav",1,0,1 ;USE A SOUND FILE FOR TESTING
ainMix sum ainL,ainR
;CREATE REVERSED TABLES
irev tab_reverse giImpulse

kSwitch changed kskipsamples,kFwdBwd,kDelayOS,kCompRat,kCurve ;GENERATE A MOMENTARY '1' PULSE IN OUTPUT 'kSwitch' IF ANY OF THE SCANNED INPUT VARIABLES CHANGE. (OUTPUT 'kSwitch' IS NORMALLY ZERO)
if kSwitch=1 then ;IF I-RATE VARIABLE IS CHANGED...
reinit UPDATE ;BEGIN A REINITIALISATION PASS IN ORDER TO EFFECT THIS CHANGE. BEGIN THIS PASS AT LABEL ENTITLED 'UPDATE' AND CONTINUE UNTIL rireturn OPCODE
endif ;END OF CONDITIONAL BRANCHING
UPDATE: ;LABEL
;CREATE COMPRESSED TABLES
icomp tab_compress giImpulse,i(kCompRat),i(kCurve)

;CREATE COMPRESSED REVERSED TABLES
icomprev tab_compress_rev giImpulse,i(kCompRat),i(kCurve)

iplen = 1024 ;BUFFER LENGTH (INCREASE IF EXPERIENCING PERFORMANCE PROBLEMS, REDUCE IN ORDER TO REDUCE LATENCY)
itab = giImpulse ;DERIVE FUNCTION TABLE NUMBER OF CHOSEN TABLE FOR IMPULSE FILE
iirlen = nsamp(itab)*0.5 ;DERIVE THE LENGTH OF THE IMPULSE RESPONSE IN SAMPLES. DIVIDE BY 2 AS TABLE IS STEREO.
iskipsamples = nsamp(itab)*0.5*i(kskipsamples) ;DERIVE INSKIP INTO IMPULSE FILE. DIVIDE BY 2 (MULTIPLY BY 0.5) AS ALL IMPULSE FILES ARE STEREO
;FORWARDS REVERB
if kFwdBwd==0&&kresize==0 then
aL,aR ftconv ainMix, itab, iplen,iskipsamples, iirlen ;CONVOLUTE INPUT SOUND
adelL delay ainL, abs((iplen/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE
adelR delay ainR, abs((iplen/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE
;BACKWARDS REVERB
elseif kFwdBwd==1&&kresize==0 then
aL,aR ftconv ainMix, irev, iplen, iskipsamples, iirlen ;CONVOLUTE INPUT SOUND
adelL delay ainL,abs((iplen/sr)+(iirlen/sr)-(iskipsamples/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE AND THE DURATION OF THE IMPULSE FILE
adelR delay ainR,abs((iplen/sr)+(iirlen/sr)-(iskipsamples/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE AND THE DURATION OF THE IMPULSE FILE

elseif kFwdBwd==0&&kresize==1 then
aL,aR ftconv ainMix, icomp, iplen,iskipsamples, iirlen*i(kCompRat) ;CONVOLUTE INPUT SOUND
adelL delay ainL, abs((iplen/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE
adelR delay ainR, abs((iplen/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE

elseif kFwdBwd==1&&kresize==1 then
aL,aR ftconv ainMix, icomprev, iplen, iskipsamples, iirlen*i(kCompRat) ;CONVOLUTE INPUT SOUND
adelL delay ainL,abs((iplen/sr)+((iirlen*i(kCompRat))/sr)-(iskipsamples/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE AND THE DURATION OF THE IMPULSE FILE
adelR delay ainR,abs((iplen/sr)+((iirlen*i(kCompRat))/sr)-(iskipsamples/sr)+i(kDelayOS)) ;DELAY THE INPUT SOUND ACCORDING TO THE BUFFER SIZE AND THE DURATION OF THE IMPULSE FILE
endif

; CREATE A DRY/WET MIX
aMixL ntrpol adelL,aL*0.1,kmix
aMixR ntrpol adelR,aR*0.1,kmix
outs aMixL*klevel,aMixR*klevel
endin
</CsInstruments>

<CsScore>
i 1 0 3600 ;INSTRUMENT 2 (CONVOLUTION INSTRUMENT) RUNS FOR 1 HOUR (AND KEEPS REAL-TIME PERFORMANCE GOING)
</CsScore>

</CsoundSynthesizer>

+ 223
- 0
bin/cabbage-extra/Effects/DelayGrain.csd View File

@@ -0,0 +1,223 @@
DelayGrain.csd
Iain McCurdy, 2013

CONTROLS
--------
Grain Size -- range of possible grain sizes (in seconds)
Density -- grain density in grains per second (note that the addition of delay will disrupt the regularity of grains)
Delay -- range of delay times possible (in seconds)
Transpose -- range of transpositions (in semitones)
Spread -- random panning spread of grains
Amplitude Decay -- the larger this value, the more grains are delayed, the more their amplitudes will be lowered
Reversal Proability -- probability of material within the grains being played backwards: 0 = all forwards
1 = all backwards
0.5 = 50:50
reversal might be hard to hear unless grain size is large
Mix -- dry/wet mix
Level -- output level (both dry and wet)
Grain Env. -- sets the amplitude enveloping window for each grain
Hanning: natural sounding soft attack, soft decay envelope
Half-sine: like the hanning but with a slightly sharper attack and decay
Decay 1: a percussive decay envelope with linear segments
Decay 2: a percussive decay envelope with a exponential decay segment. Probably more natural sounding than 'Decay 1' but longer grain sizes may be necessary
Gate: sharp attack and decay. Rather synthetic sounding.
Delay Distr. -- random delay time distribution: exponential, linear or logarithmic. Effect are quite subtle but exponential might be most natural sounding.
<Cabbage>
form caption("Delay Grain") size(410, 540), pluginID("DGrn")

hslider bounds( 5, 5, 400, 25), channel("GSize1"), range(0.005, 2, 0.01, 0.5, 0.0001)
hslider bounds( 5, 20, 400, 25), channel("GSize2"), range(0.005, 2, 0.09, 0.5, 0.0001)
label bounds(161, 39, 120, 11), text("G R A I N S I Z E"), fontcolour(105,105,255)

hslider bounds( 5, 60, 400, 25), channel("Dens"), range(0.2, 2000, 50,0.5,0.001)
label bounds(172, 79, 120, 11), text("D E N S I T Y"), fontcolour(105,105,255)

hslider bounds( 5,100, 400, 25), channel("Dly1"), range(0, 5, 0.01, 0.5, 0.0001)
hslider bounds( 5,115, 400, 25), channel("Dly2"), range(0, 5, 0.5, 0.5, 0.0001)
label bounds(180,134, 120, 11), text("D E L A Y"), fontcolour(105,105,255)

hslider bounds( 5,160, 400, 25), channel("Trns1"), range(-12, 12, 0, 1, 0.001)
hslider bounds( 5,175, 400, 25), channel("Trns2"), range(-12, 12, 0, 1, 0.001)
label bounds(162,194, 120, 11), text("T R A N S P O S E"), fontcolour(105,105,255)

hslider bounds( 5,215, 400, 25), channel("PanSpread"), range(0, 1.00, 0.5,1,0.001)
label bounds(158,234, 120, 11), text("P A N S P R E A D"), fontcolour(105,105,255)

hslider bounds( 5,260, 400, 25), channel("AmpSpread"), range(0, 1.00, 0.5,1,0.001)
label bounds(158,279, 120, 11), text("A M P S P R E A D"), fontcolour(105,105,255)

hslider bounds( 5,300, 400, 25), channel("FiltSpread"), range(0, 1.00, 0.5,1,0.001)
label bounds(147,319, 120, 11), text("F I L T E R S P R E A D"), fontcolour(105,105,255)

hslider bounds( 5,340, 400, 25), channel("ampdecay"), range(0, 1.00, 0.5,1,0.001)
label bounds(134,359, 220, 11), text("A M P L I T U D E D E C A Y"), fontcolour(105,105,255)

hslider bounds( 5,380, 400, 25), channel("reverse"), range(0, 1.00, 0,1,0.001)
label bounds(112,399, 220, 11), text("R E V E R S A L P R O B A B I L I T Y"), fontcolour(105,105,255)

hslider bounds( 5,420, 400, 25), channel("mix"), range(0, 1.00, 1,1,0.001)
label bounds(191,439, 120, 11), text("M I X"), fontcolour(105,105,255)

hslider bounds( 5,460, 400, 25), channel("level"), range(0, 2.00, 1, 0.5, 0.001)
label bounds(183,479, 120, 11), text("L E V E L"), fontcolour(105,105,255)

combobox bounds( 10,506, 90, 17), channel("window"), value(1), text("Hanning","Half Sine","Decay 1","Decay 2","Gate")
label bounds( 19,495, 90, 11), text("GRAIN ENV."), fontcolour(105,105,255)

combobox bounds(110,506, 90, 17), channel("DlyDst"), value(1), text("Exp.","Lin.","Log")
label bounds(119,495, 90, 11), text("DELAY DISTR."), fontcolour(105,105,255)

label bounds( 10,528, 200, 11), text("Author: Iain McCurdy |2013|"), FontColour("grey")
</Cabbage>

<CsoundSynthesizer>
<CsOptions>
-dm0 -n
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2013)

; window functions
giwfn1 ftgen 0, 0, 131072, 9, .5, 1, 0 ; HALF SINE
giwfn2 ftgen 0, 0, 131072, 7, 0, 3072, 1, 128000, 0 ; PERCUSSIVE - STRAIGHT SEGMENTS
giwfn3 ftgen 0, 0, 131072, 16, 0, 3072,0,1, 128000,-2, 0 ; PERCUSSIVE - EXPONENTIAL SEGMENTS
giwfn4 ftgen 0, 0, 131072, 7, 0, 3536, 1, 124000, 1, 3536, 0 ; GATE - WITH ANTI-CLICK RAMP UP AND RAMP DOWN SEGMENTS
giwfn5 ftgen 0, 0, 131072, 7, 0, 128000,1, 3072, 0 ; REVERSE PERCUSSIVE - STRAIGHT SEGMENTS
giwfn6 ftgen 0, 0, 131072, 5, .001, 128000,1, 3072, 0.001 ; REVERSE PERCUSSIVE - EXPONENTIAL SEGMENTS
giwfn7 ftgen 0, 0, 131072, 20, 2, 1 ; HANNING WINDOW
giwindows ftgen 0,0,8,-2,giwfn7,giwfn1,giwfn2,giwfn3,giwfn4

giBufL ftgen 0,0,1048576,-2,0 ; function table used for storing audio
giBufR ftgen 0,0,1048576,-2,0 ; function table used for storing audio

gigaussian ftgen 0,0,4096,20,6,1,1 ; a gaussian distribution

gaGMixL,gaGMixR init 0 ; initialise stereo grain signal

instr 1 ; grain triggering instrument
kGSize1 chnget "GSize1" ; grain size limit 1
kGSize2 chnget "GSize2" ; grain size limit 2
kDens chnget "Dens" ; grain density
kDly1 chnget "Dly1" ; delay time limit 1
kDly2 chnget "Dly2" ; delay time limit 2
kTrns1 chnget "Trns1" ; transposition in semitones
kTrns2 chnget "Trns2"
kPanSpread chnget "PanSpread" ; random panning spread
kAmpSpread chnget "AmpSpread" ; random amplitude spread
kFiltSpread chnget "FiltSpread" ; random filter spread
kreverse chnget "reverse" ; reversal probability
kampdecay chnget "ampdecay" ; amount of delay->amplitude attenuation
kwindow chnget "window" ; window
kDlyDst chnget "DlyDst" ; delay time distribution
kmix chnget "mix" ; dry/wet mix
klevel chnget "level" ; output level (both dry and wet signals)

aL, aR ins ; read audio input
outs aL*klevel*(1-kmix),aR*klevel*(1-kmix)

/* WRITE TO BUFFER TABLES */
ilen = ftlen(giBufL) ; table length (in samples)
aptr phasor sr/ilen ; phase pointer used to write to table
aptr = aptr*ilen ; rescale pointer according to table size
tablew aL, aptr, giBufL ; write audio to table
tablew aR, aptr, giBufR ; write audio to table
kptr downsamp aptr ; downsamp pointer to k-rate

ktrig metro kDens ; grain trigger

/* GRAIN SIZE */
kGSize random 0,1 ; random value 0 - 1
;kGSize expcurve kGSize,50 ; exponentially redistribute range 0 - 1
kMinGSize min kGSize1,kGSize2 ; find minimum grain size limit
kMaxGSize max kGSize1,kGSize2 ; find maximum grain size limit
kGSize scale kGSize,kMaxGSize,kMinGSize ; rescale random value according to minimum and maximum limits

/* DELAY TIME */
kDly random 0,1 ; uniform random value 0 - 1
if kDlyDst=1 then ; if delay time distribution is exponential
kDly expcurve kDly,100 ; exponential distrubution range 0 - 1
elseif kDlyDst=3 then ; .. or if logarithmic
kDly logcurve kDly,100 ; exponential distrubution range 0 - 1
endif ; (other linear so do not alter)
if kDly1=kDly2 then
kMinDly = kDly1 ; delays can't be the same value!!
kMaxDly = kDly2+0.001
else
kMinDly min kDly1,kDly2 ; find minimum delay time limit
kMaxDly max kDly1,kDly2 ; find maximum delay time limit
endif

ioffset = 1/sr ; delay offset (can't read at same location as write pointer!)
kDly scale kDly,kMaxDly,kMinDly; distribution rescaled to match the user defined limits

/* CALL GRAIN */
; p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16
schedkwhen ktrig,0,0,2,kDly+0.0001,kGSize,kptr,kPanSpread,kreverse,kDly,kMinDly+ioffset,kMaxDly+0.0001,kampdecay,klevel*kmix,kwindow,kAmpSpread,kFiltSpread,kTrns1,kTrns2 ; call grain instrument
endin

instr 2 ; grain instrument
iGStart = p4 ; grain start position (in samples)
ispread = p5 ; random panning spread
ireverse= (rnd(1)>p6?1:-1) ; decide fwd/bwd status
iwindow table p12-1,giwindows ; amplitude envelope shape for this grain

/* AMPLITUDE CONTROL */
idly = p7 ; delay time
iMinDly = p8 ; minimum delay
iMaxDly = p9 ; maximum delay
iampdecay= p10 ; amount of delaytime->amplitude attenuation
ilevel = p11 ; grain output level
iAmpSpread = p13
iFiltSpread = p14

iRto divz idly-iMinDly , iMaxDly-iMinDly, 0 ; create delay:amplitude ration (safely)
iamp = (1 - iRto) ^ 2 ; invert range
iamp ntrpol 1,iamp,iampdecay ; mix flat amplitude to scaled amplitude according to user setting
iRndAmp random 1-iAmpSpread, 1 ; random amplitude value for this grain
iamp = iamp*iRndAmp ; apply random amplitude

/* TRANSPOSITION */
iTrns random p15,p16
iRto = semitone(iTrns)
if iRto>1 then
iStrtOS = (iRto-1) * sr * p3
else
iStrtOS = 0
endif

aline line iGStart-iStrtOS,p3,iGStart-iStrtOS+(p3*iRto*sr*ireverse) ; grain pointer
aenv oscili iamp,1/p3,iwindow ; amplitude envelope
aL tablei aline,giBufL,0,0,1 ; read audio from table
aR tablei aline,giBufR,0,0,1 ; read audio from table

if iFiltSpread>0 then
iRndCfOct random 14-(iFiltSpread*10),14
iRndCf = cpsoct(iRndCfOct)
aL butlp aL,iRndCf
aR butlp aR,iRndCf
endif


ipan random 0.5-(ispread*0.5),0.5+(ispread*0.5) ; random pan position for this grain
gaGMixL = gaGMixL + (aL*aenv*ipan*ilevel) ; left channel mix added to global variable
gaGMixR = gaGMixR + (aR*aenv*(1-ipan)*ilevel) ; right channel mix added to global variable
endin

instr 3 ; output instrument (always on)
outs gaGMixL,gaGMixR ; send global audio signals to output
clear gaGMixL,gaGMixR ; clear global audio variables
endin

</CsInstruments>

<CsScore>
i 1 0 [60*60*24*7] ; read audio, write to buffers, call grains.
i 3 0 [60*60*24*7] ; output
</CsScore>

</CsoundSynthesizer>

+ 142
- 0
bin/cabbage-extra/Effects/Doppler.csd View File

@@ -0,0 +1,142 @@
doppler.csd
Written by Iain McCurdy, 2013

; CONTROLS
; Input - select input: either left channel, right channel, or a mix of both channels
; Shape - shape of the LFO moving the source: either sine, triangle, random spline OR manual
note, if 'random' is chosen, 'speed' can take a little while to respond to changes
made to the 'speed' control is the speed was previously slow
If 'manual' is selected source position is controlled using the on screen slider
; Room Size - effectively the dpeth of the doppler pitch modulating effect
; Speed - speed of the LFO moving the source with respect to the mic. position
; Depth - amplitude of the LFO moving the source
; Smoothing - a smoothing filter applied to doppler pitch modulation. Its effect can be subtle.
; Mix - a dry/wet mixer. Mixing the dry and wet signals can be used to create chorus effects.
; Ampscale - amount of amplitude drop off as the source moves away from the source.
Kind of like another room size control
; Pan Depth - Amount of left-right movement in the output as the source swings past the microphone
; Out Amp - scales the output signal
; Mic.Position - Position of the microphone
; Source Position- Location of the source (for display only unless 'manual' shape is chosen)

<Cabbage>
form caption("-oOo-"), size(610, 180), pluginID("dopp")
label bounds(23, 10, 60,11), text("Input")
combobox bounds(10, 23, 60,20), channel("input"), value(4), text("left","right","mixed","test")
label bounds(23, 50, 60,11), text("Shape")
combobox bounds(10, 63, 60,20), channel("shape"), value(1), text("sine","triangle","random","manual")

rslider bounds( 75, 10, 80, 80), channel("RoomSize"), range(0.1,100,40,0.5,0.5), text("Room Size"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(140, 10, 80, 80), channel("speed"), range(0,10,0.08,0.5,0.01), text("Speed"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(205, 10, 80, 80), channel("depth"), range(0,0.5,0.5,0.5,0.01), text("Depth"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(270, 10, 80, 80), channel("filtercutoff"), range(1,20,6,1,1), text("Smoothing"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(335, 10, 80, 80), channel("ampscale"), range(0,1,0.98), text("Amp.Scale"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(400, 10, 80, 80), channel("PanDep"), range(0,0.5,0.4), text("Pan Depth"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(465, 10, 80, 80), channel("mix"), range(0,1,1), text("Mix"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)
rslider bounds(530, 10, 80, 80), channel("OutAmp"), range(0,1,0.5), text("Level"), TextBox(1), colour( 45, 45, 45), trackercolour(200,200,200)

hslider bounds( 10, 86,590, 40), channel("microphone"), range(0,1.00,0.5), text("Mic. Position"), TextBox(1), colour(100,100,100), trackercolour(200,200,200)
hslider bounds( 10,111,590, 40), channel("source"), range(0,1.00,0.5), text("Source Position"), TextBox(1), colour(100,100,100), trackercolour(200,200,200)

label bounds(22, 155,200,18), text("D O P P L E R"), fontcolour(100,100,100)
label bounds(20, 153,200,18), text("D O P P L E R"), fontcolour(180,180,180)

label bounds(232,160, 200, 12), text("Author: Iain McCurdy |2013|"), FontColour("grey")

</Cabbage>

<CsoundSynthesizer>

<CsOptions>
-dm0 -n -+rtmidi=null -M0
</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 ;MAXIMUM AMPLITUDE VALUE

;AMPLITUDE SCALING CURVE
giampcurve ftgen 0,0,131072,5,0.01,131072*0.5,1,131072*0.5,0.01

instr 1
gkinput chnget "input"
gkRoomSize chnget "RoomSize"
gkspeed chnget "speed"
gkdepth chnget "depth"
gkfiltercutoff chnget "filtercutoff"
gkfiltercutoff init 6
gkampscale chnget "ampscale"
gkPanDep chnget "PanDep"
kmix chnget "mix" ;READ IN DRY/WET CROSSFADER WIDGET
gkOutAmp chnget "OutAmp"
gkmicrophone chnget "microphone"
gkshape chnget "shape"
gkshape init 1
/* INPUT */
aL,aR ins
if gkinput=1 then
asig = aL
elseif gkinput=2 then
asig = aR
elseif gkinput=3 then
asig = (aL+aR)*0.677
else
;INPUT TONE=============================================(for testing)
asig vco2 .5, 300 ;GENERATE TONE
asig tone asig, 1200 ;LOW PASS FILTER TO SOFTEN THE TONE
;=======================================================
endif

;LFO(modulates source position)=========================
ktrig changed gkshape ;IF I-RATE VARIABLE SLIDER IS CHANGED GENERATE A '1'
if ktrig=1 then ;IF TRIGGER IS '1'...
reinit RESTART_LFO ;BEGIN A REINITIALISATION PASS FROM LABEL 'UPDATE'
endif ;END OF THIS CONDITIONAL BRANCH
RESTART_LFO: ;LABEL CALLED 'UPDATE'
if i(gkshape)=3 then ;IF 'RANDOM' SHAPE IS SELECTED...
gksource rspline 0.5-gkdepth, 0.5+gkdepth, gkspeed,gkspeed*2
elseif i(gkshape)=4 then ;IF 'MANUAL' SHAPE IS SELECTED...
gksource chnget "source" ;READ SOURCE POSITION FROM SLIDER
else
gksource lfo gkdepth, gkspeed, i(gkshape)-1 ;LFO
gksource = gksource + 0.5 ;OFFSET INTO THE POSITIVE DOMAIN
endif
rireturn
chnset gksource,"source"
;======================================================
kporttime linseg 0, 0.001, 0.1 ;RAMPING UP PORTAMENTO TIME VARIABLE
;DOPPLER================================================
ispeedofsound init 340.29 ;SPEED OF SOUND DEFINED
ksource portk gksource, kporttime ;SMOOTH SOURCE POSITION MOVEMENT
kmicrophone portk gkmicrophone, kporttime ;SMOOTH MICROPHOPNE POSITION MOVEMENT
ktrig changed gkfiltercutoff ;IF I-RATE VARIABLE SLIDER IS CHANGED GENERATE A '1'
if ktrig=1 then ;IF TRIGGER IS '1'...
reinit UPDATE ;BEGIN A REINITIALISATION PASS FROM LABEL 'UPDATE'
endif ;END OF THIS CONDITIONAL BRANCH
UPDATE: ;LABEL CALLED 'UPDATE'
kdisp limit ksource-(kmicrophone-0.5), 0, 1 ;CALCULATE DISPLACEMENT (DISTANCE) BETWEEN SOURCE AND MICROPHONE AND LIMIT VALUE TO LIE BETWEEN ZERO AND 1
kamp table kdisp, giampcurve,1 ;READ AMPLITUDE SCALING VALUE FROM TABLE
kamp ntrpol 1, kamp, gkampscale ;CALCULATE AMOUNT OF AMPLITUDE SCALING DESIRED BY THE USER FROM THE ON SCREEN SLIDER
aout doppler asig*kamp, ksource*gkRoomSize, kmicrophone*gkRoomSize, ispeedofsound, i(gkfiltercutoff) ;APPLY DOPPLER EFFECT
rireturn ;RETURN FROM REINITIALISATION PASS
kpan = (gksource<gkmicrophone?0.5+gkPanDep:0.5-gkPanDep) ;CALCULATE PAN VALUE ACCORDING TO SOURCE AND MIC POSITION
kpan portk kpan, kporttime ;APPLY PORTAMENTO SMOOTHING TO PAN POSITION VALUE
aL ntrpol asig,aout*sqrt(kpan)*gkOutAmp,kmix ;DRY/WET MIX LEFT CHANNEL
aR ntrpol asig,aout*sqrt(1-kpan)*gkOutAmp,kmix ;DRY/WET MIX RIGHT CHANNEL
outs aL, aL ;SEND AUDIO TO OUTPUTS AND APPLY PANNING
endin

</CsInstruments>

<CsScore>
i 1 0 3600 ;DUMMY SCORE EVENT - PERMITS REAL-TIME PERFORMANCE FOR 1 HOUR
</CsScore>

</CsoundSynthesizer>

+ 165
- 0
bin/cabbage-extra/Effects/DopplerSpin.csd View File

@@ -0,0 +1,165 @@
DopplerSpin.csd
Written by Iain McCurdy, 2013

; CONTROLS
; Frequency of Rotation -- Frequency of the spinning
; Central/Edge -- Listening position in relation to the circulat motion. Can be thought of as a control for the amount of amplitude modulation.
; Orientation (radians) -- direction of listeing
; Panning Width -- amount of panning directionality in the modulation
; Doppler Depth -- amount of doppler effect (circle size).
; (Reverb) Scaling -- a dry/wet mixer. Mixing the dry and wet signals can be used to create chorus effects.
; (Reverb) Time -- amount of amplitude drop off as the source moves away from the source.
; (Reverb) Damping -- Amount of left-right movement in the output as the source swings past the microphone
; Mix -- scales the output signal
; Level -- Output Level
; Auto-Frequency -- If this button is activated the frequency of the spinning moves randomly between -Frequency of Rotation and +Frequency of Rotation

; This example uses three LFOs to create the effect of a sound moving in a circle around the listener.
; The three parameters controlled by these LFOs are amplitude, panning and delay time.
; The modulation of the delay time also results in a modulation of pitch which is sometimes referred to as the Doppler effect.
; Note that in this example the 'vdelayxw' opcode is used to implement the delay and doppler shift.
; This opcode is unique in that the delay time of the write pointer rather than the read pointer is modulated.
; This is appropriate here as it is the sound source that is moving, not the listener.
; Crucial to this effect is that that all three LFOs share the same frequency value.
; Negative frequency values are also allowed - this would represent a change in direction of the source sounds motion around us.
; Also of crucial importance is the phase relationship between the three LFOs as this defines exactly where the sound source is in relation to the listener.
; The panning LFO should be at its points of minimum rate of change when the sound source is moving parallel to the direction in which the listener is facing, i.e. directly to the left or to the right of the listener.
; The delay time LFO (pitch modulation/doppler) should be at its points of minimum rate of change when the sound source is moving perpendicular to the direction in which the listener is facing, i.e. directly in front of or behind the listener.
; The phase difference between these two LFOs is either 90 or 270 degrees, depending on whether the source sound is moving in a clockwise or anticlockwise direction around us.
; Amplitude modulation comes into play whenever we are not listening from the centre of the circle of motion.
; The close to the edge of the circle we are the greater the amount of amplitude modulation we will experience.
; If the amplitude modulation is extreme then the circle of the source sound's motion must be extremely large. The phase of the amplitude modulation LFO is also adjustable ('Orientation' slider -
; this define which edge of the circle we are closest to, e.g. upper, lower, left, right etc. It is probably best to always include at least a small amount of amplitude modulation as we perceive sounds directly to our left or to our right to be
; louder, even if they remain equidistant from us. In this case the amplitude LFO phase ('Orientation') should be 0.5 (radians).
; The waveform for all three LFOs is a sine wave.
; This defines the object's motion as being circular.
; If we were to use a different waveform this would model non-circular motion.
; There is interesting potential in experimentation in this direction with this example.
; Finally as the moving signal becomes more distant, i.e. when the amplitude scaling function is at its minimum, a reverberated version of the signal can become more evident.
; The degree to which this is present can be scaled using the 'Reverb Scaling' slider.

<Cabbage>
form caption("Doppler Spin"), size(700,265), pluginID("SDop")

;label bounds(23, 10, 60,11), text("Input")
label bounds( 10, 4,120, 15), text("i n p u t"), fontcolour("white")
combobox bounds(10, 30, 60,20), channel("input"), value(1), text("left","right","mixed","test")

line bounds( 85, 5, 2, 70), colour("Grey")
label bounds(185, 4,120, 15), text("r e v e r b"), fontcolour("white")
checkbox bounds(100, 33,110, 20), text("Reverb On/Off") channel("RvbOnOff"), FontColour("White"), colour("lime") value(1)
rslider bounds(210, 23, 55, 55), channel("RvbScaling"), range(0,1.000,0.3,1,0.001), text("Scaling"), TextBox(0), colour( 95, 45,115), trackercolour( 95, 45,115)
rslider bounds(270, 23, 55, 55), channel("RvbTime"), range(0.3,0.990,0.7,1,0.001), text("Time"), TextBox(0), colour( 85, 45,125), trackercolour( 85, 45,125)
rslider bounds(330, 23, 55, 55), channel("RvbFilt"), range(20,20000,4000,0.5,0.001), text("Damping"), TextBox(0), colour( 75, 45,135), trackercolour( 75, 45,135)

line bounds(390, 5, 2, 70), colour("Grey")
label bounds(411, 4,120, 15), text("o u t p u t"), fontcolour("white")
rslider bounds(400, 23, 55, 55), channel("mix"), range(0,1.000,1,1,0.001), text("Mix"), TextBox(0), colour( 65, 45,145), trackercolour( 65, 45,145)
rslider bounds(460, 23, 55, 55), channel("OutGain"), range(0,1.000,0.7,1,0.001), text("Level"), TextBox(0), colour( 55, 45,155), trackercolour( 65, 45,145)
line bounds(520, 5, 2, 70), colour("Grey")

checkbox bounds(530, 33,110, 20), text("Auto-Frequency") channel("AutoFreq"), FontColour("White"), colour("lime") value(0)

hslider bounds( 5, 80,690, 35), channel("freq"), range(-10,10.00,0.2,1,0.0001), text("Frequency of Rotation"), TextBox(1), colour(145, 45, 65), trackercolour(145, 45, 65)
hslider bounds( 5,110,690, 35), channel("AmpDepth"), range(0,1.000,0.7,1,0.001), text("Central/Edge"), TextBox(1), colour(135, 45, 75), trackercolour(135, 45, 75)
hslider bounds( 5,140,690, 35), channel("AmpPhase"), range(0,1.000,0.5,1,0.001), text("Orientation [radians]"), TextBox(1), colour(125, 45, 85), trackercolour(125, 45, 85)
hslider bounds( 5,170,690, 35), channel("PanDepth"), range(0,1.000,1,1,0.001), text("Panning Width"), TextBox(1), colour(115, 45, 95), trackercolour(115, 45, 95)
hslider bounds( 5,200,690, 35), channel("DopDep"), range(0,0.030,0.003,0.5,0.000001), text("Doppler Depth"), TextBox(1), colour(105, 45,105), trackercolour(105, 45,105)

label bounds( 5,247, 200, 12), text("Author: Iain McCurdy |2013|"), FontColour("grey")

</Cabbage>

<CsoundSynthesizer>

<CsOptions>
-dm0 -n -+rtmidi=null -M0
</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 ;MAXIMUM AMPLITUDE VALUE

gisine ftgen 0,0,131072,10,1

instr 1
gkinput chnget "input"
kfreq chnget "freq"
kAmpDepth chnget "AmpDepth"
kAmpPhase chnget "AmpPhase"
kPanDepth chnget "PanDepth"
kDopDep chnget "DopDep"
kRvbScaling chnget "RvbScaling"
kRvbTime chnget "RvbTime"
kRvbFilt chnget "RvbFilt"
kmix chnget "mix"
kOutGain chnget "OutGain"
kRvbOnOff chnget "RvbOnOff"
kAutoFreq chnget "AutoFreq"
/* INPUT */
aL,aR ins
if gkinput=1 then
asig = aL
elseif gkinput=2 then
asig = aR
elseif gkinput=3 then
asig = (aL+aR)*0.677
else
;INPUT TONE=============================================(for testing)
asig vco2 .5, 300 ;GENERATE TONE
asig tone asig, 1200 ;LOW PASS FILTER TO SOFTEN THE TONE
;=======================================================
endif

if kAutoFreq=1 then
kfreq jspline kfreq,1,4
endif


kporttime linseg 0,0.001,0.1 ;CREATE 'PORTAMENTO TIME'. A FUNCTION THAT RISES QUICKLY FROM ZERO TO A HELD VALUE.
kAmpPhase portk kAmpPhase, kporttime ;APPLY PORTAMENTO TO gkAmpPhase. CREATE NEW OUTPUT VARIABLE kAmpPhase (GLOBAL VARIABLES CAN'T BE BOTH INPUT AND OUTPUT)
kDopDep portk kDopDep, kporttime ;APPLY PORTAMENTO TO gkDopDep. CREATE NEW OUTPUT VARIABLE kDopDep (GLOBAL VARIABLES CAN'T BE BOTH INPUT AND OUTPUT)

aAmp osciliktp kfreq, gisine, kAmpPhase ;AN LFO DEFINES A VARIABLE USED TO MODULATE AMPLITUDE (NOTE: VARIABLE PHASE). THIS MODELS THE LOCATION WITHIN THE CIRCLE FROM WHICH WE ARE LISTENING. NO AMPLITUDE MODULATION REPRESENT REPRESENTS OUR LISTENING POSITION BEING EXACTLY CENTRAL, MAXIMUM MODULATION REPRESENTS US BEING NEAR TO THE EDGE OF A LARGE CIRCLE. THE CONTROL OVER PHASE OF THIS LFO REPRESENTS WHICH EDGE WE ARE CLOSER TO.
aAmp = (aAmp * 0.5 * kAmpDepth) + 0.5 ;RESCALE AND OFFSET AMPLITUDE MODULATION LFO
aPan oscili (kPanDepth * 0.5), kfreq, gisine, 0.75 ;AN LFO DEFINES A VARIABLE FOR PANNING CONTROL - I.E. WHETHER SOUND IS CURRENTLY TO OUT LEFT OR TO OUT RIGHT. NOTE THAT PHASE IS 0.75 AND THEREFORE 0.75 RADIANS (OR 270 DEGREES OUT OF PHASE) WITH THE DELAY MODULATION
aPan = aPan + 0.5 ;OFFSET PANNING LFO

iMaxDelay = 1 ;DEFINE A VARIABLE THAT WILL BE USE FOR 'MAXIMUM DELAY TIME' (BUFFER LENGTH)
aDelTim oscili kDopDep, kfreq, gisine, 0 ;AN LFO DEFINES A VARIABLE FOR DELAY TIME (NOTE PHASE AT ZERO)
aDelTim = aDelTim + kDopDep ;DELAY TIME VARIABLE 'aDelay' IS OFFSET TO STAY WITHIN THE POSITIVE DOMAIN
;vdelayxw IS USED FOR THE DELAY READ/WRITE AS IT MODULATES THE WRITE POINTER RATHER THAN THE READ POINTER.
;THIS IS MORE APPROPRIATE IN THIS EXAMPLE AS THE SOURCE IS MOVING BUT THE POINT OF LISTENING IS STATIONARY
aDelTap vdelayxw asig, aDelTim, iMaxDelay, 16
aL, aR pan2 aDelTap, aPan, 1 ;APPLY PANNING TO SIGNAL OUTPUT FROM DELAY USING pan2 OPCODE. CREATE A NEW

aL = aL * (aAmp^0.5) ;APPLY AMPLITUDE MODULATION (CREATE A NEW AUDIO SIGNAL - DRY (UN-REVERBERATED) SIGNAL)
aR = aR * (aAmp^0.5) ;APPLY AMPLITUDE MODULATION (CREATE A NEW AUDIO SIGNAL - DRY (UN-REVERBERATED) SIGNAL)

if kRvbOnOff=1 then
aRvbL, aRvbR reverbsc aL, aR, kRvbTime, kRvbFilt ;REVERB (UNAFFECTED BY AMPLITUDE MODULATION)
aL = (aL+(aRvbL*kRvbScaling))
aR = (aR+(aRvbL*kRvbScaling))
endif
aL ntrpol asig,aL,kmix
aR ntrpol asig,aR,kmix
outs aL * kOutGain , aR * kOutGain ;SEND AUDIO TO OUTPUTS. MIX DRY AND REVERBERATED SIGNALS.
endin

</CsInstruments>

<CsScore>
i 1 0 [3600*24*7*52]
</CsScore>

</CsoundSynthesizer>

+ 351
- 0
bin/cabbage-extra/Effects/FilterLFO.csd View File

@@ -0,0 +1,351 @@
; FilterLFO.csd
; Author: Iain McCurdy (2013)

; INTRODUCTION
; ------------
; multimode filter with a 2 multimode LFOs on the cutoff frequency
; additional controls for specific filter models are accessed using the pop-up buttons

; The outputs of both LFOs are added to the main cutoff frequency (Freq.)
; LFO amplitude are in 'octaves'
; LFO rates are in beats per minute
; 'Smoothing' adds a small amount of portamento to changes in cutoff frequency
; this can be useful in square wave-type modulations

; 'Type' is ignored when 'moogladder', 'resonz', 'phaser2' or 'resony' are chosen as 'model'

; some subtlety is required when using the more complex filter models (e.g. phaser2, resony)
; often low LFO amplitudes and rate work better with these

; CONTROL
; -------
; Freq. -- global manual frequency control. Like an LFO offset value.
; Res. -- resonance control. Affects moogladder, resonz and phaser2 models
; Mix -- dry/wet (filtered/unfiltered) mix
; Level -- global output level control
; Model -- (drop down menu) filter model
; Type -- Filter type: highpass/lowpass - affects tone, butterworth, cl-butterworth, cl-Chebychev models only
; Input -- choose between live input and (for testing) sawtooth tone and pink noise
; Resync -- resync. (i.e. restart) the two LFOs
; clfilt/phaser2/resony -- pop-up panels with further controls for these models
; LFO Type -- sine, triangle, square (bipolar), square (unipolar), sawtooth up, sawtooth down, random sample & hold and random spline
; LFO Amp -- amplitude of the LFOs
; LFO Rate -- rates of the LFOs in beats per minute
; Link Rates -- when this switch is activate Rate controls for the two LFOs will be linked
; LFO Rate Div. -- integer division of Rate control value (unaffected by 'Link Rates' setting)
; Smooth -- a small amount of smoothing can be appied to the LFO to smooth abrupt changes in value (may be useful and 'square' and 'rand.S&H' type modulations

<Cabbage>
form caption("Filter LFO") size(790,170), pluginID("FLFO")
image pos(0, 0), size(790,170), colour(0,0,0,170), shape("rounded"), outline("white"), line(4)
rslider bounds( 10, 11, 70, 70), text("Freq."), colour( 30, 30, 30), trackercolour("black"), fontcolour("white"), channel("cf"), range(1, 20000, 300, 0.333)
rslider bounds( 75, 11, 70, 70), text("Res."), colour( 30, 30, 30), trackercolour("black"), fontcolour("white"), channel("res"), range(0,1.00,0.75)
rslider bounds(140, 11, 70, 70), text("Mix"), colour( 30, 30, 30), trackercolour("black"), fontcolour("white"), channel("mix"), range(0,1.00,1)
rslider bounds(205, 11, 70, 70), text("Level"), colour( 30, 30, 30), trackercolour("black"), fontcolour("white"), channel("level"), range(0, 1.00, 0.2)

combobox bounds( 20, 90, 100, 18), channel("model"), value(6), text("Tone","Butterworth","Moogladder","cl-Butterworth","cl-Chebychev I","resonz","phaser2","resony")
label bounds( 44,108, 80, 12), text("MODEL"), fontcolour("white")

combobox bounds(140, 90, 100, 18), channel("type"), value(1), text("Low-pass","High-pass")
label bounds(169,108, 80, 12), text("TYPE"), fontcolour("white")

combobox bounds( 20,127,100, 18), channel("input"), value(2), text("Live","Tone","Noise")
label bounds( 46,145,100, 12), text("INPUT"), fontcolour("white")

button bounds(140,127, 80, 18), colour("Green"), text("RESYNC.", "RESYNC."), channel("resync"), value(1)

; controls pertaining to the setup of clfilt accessed in a pop-up panel.
groupbox bounds(280, 15,150, 90), colour("black"), plant("clfilt"), line(0), popup(1);, fontcolour("white")
{
rslider bounds( 5, 16, 70, 70), text("N.Poles"), colour( 30 , 30, 30), trackercolour("black"), FontColour("white"), channel("npol"), range(2, 80, 2, 1, 2)
rslider bounds( 75, 16, 70, 70), text("Ripple"), colour( 30 , 30, 30), trackercolour("black"), FontColour("white"), channel("pbr"), range(0.1, 50.00, 1, 0.5, 0.001)
}

; controls pertaining to the setup of phaser2 accessed in a pop-up panel.
groupbox bounds(280, 55,315, 90), colour("black"), plant("phaser2"), line(0), popup(1);, fontcolour(white)
{
rslider bounds( 5, 16, 70, 70), text("Q"), channel("q"), range(0.0001,4,3), colour( 30 , 30, 30), trackercolour("black"), FontColour("white")
rslider bounds( 75, 16, 70, 70), text("N.Ords."), channel("ord"), range(1, 256, 8, 0.5,1), colour( 30 , 30, 30), trackercolour("black"), FontColour("white")
label bounds(160, 20, 60,12), text("Sep. Mode")
combobox bounds(150, 34, 80,25), channel("mode"), size(100,50), value(1), text("Equal", "Power"), colour( 30 , 30, 30), trackercolour("black"), FontColour("white")
rslider bounds(240, 16, 70, 70), text("Separation"), channel("sep"), range(-3, 3.00, 0.9), colour( 30 , 30, 30), trackercolour("black"), FontColour("white")
}

; controls pertaining to the setup of resony accessed in a pop-up panel.
groupbox bounds(280, 95,565, 90), colour("black"), plant("resony"), line(0), popup(1);, fontcolour(white)
{
rslider bounds( 5, 16, 70, 70), text("BW."), fontcolour("white"), channel("bw"), range(0.01, 1000, 13, 0.5), colour( 30 , 30, 30), trackercolour("black")
rslider bounds( 75, 16, 70, 70), text("Num."), fontcolour("white"), channel("num"), range(1, 80, 10, 1,1), colour( 30 , 30, 30), trackercolour("black")
rslider bounds(145, 16, 70, 70), text("Sep.oct."), fontcolour("white"), channel("sepR"), range(-11, 11, 2), colour( 30 , 30, 30), trackercolour("black")
rslider bounds(215, 16, 70, 70), text("Sep.semi."), fontcolour("white"), channel("sepR2"), range(-48, 48, 24,1,1), colour( 30 , 30, 30), trackercolour("black")
combobox bounds(285, 10,130, 70), caption("Scaling Mode"), channel("scl"), value(2), text("none", "peak response", "RMS")
combobox bounds(425, 10,130, 70), caption("Separation Mode"), channel("sepmode"), value(1), text("octs.total", "hertz", "octs.adjacent")
}

;checkbox bounds(400, 50,100, 15), text("Balance") channel("balance"), FontColour("white"), colour("yellow") value(0)


line bounds(390, 10, 2,150), colour("Grey")

;LFO
label bounds(405, 11, 45, 17), text("LFO 1"), fontcolour("white")
combobox bounds(405, 50, 100, 18), channel("LFOtype"), value(3), text("Sine","Triangle","Square[bi]","Square[uni]","Saw Up","Saw Down","Rand.S&H","Rand.Spline")
label bounds(425, 54, 80, 12), text("LFO-Shape"), fontcolour("white")
rslider bounds(515, 11, 70, 70), text("Amp"), colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOamp"), range(0, 9.00, 0.67)
rslider bounds(580, 11, 70, 70), text("Rate"), colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOBPM"), range(0, 480, 60, 1, 1)
rslider bounds(645, 11, 70, 70), text("Rate Div."),colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOBPMDiv"), range(1, 64, 1, 1, 1)
rslider bounds(710, 11, 70, 70), text("Smoothing"),colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOport"), range(0, 0.1, 0.005, 0.25, 0.000001)
checkbox bounds(405, 31, 80, 12), text("Link Rates"), channel("RateLink"),colour(yellow), fontcolour("white"), value(0)

;LFO2
label bounds(405, 91, 45, 17), text("LFO 2"), fontcolour("white")
combobox bounds(405,130, 100, 18), channel("LFOtype2"), value(8), text("Sine","Triangle","Square[bi]","Square[uni]","Saw Up","Saw Down","Rand.S&H","Rand.Spline")
label bounds(425,134, 80, 12), text("Shape"), fontcolour("white")
rslider bounds(515, 91, 70, 70), text("Amp"), colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOamp2"), range(0, 9.00, 2.5)
rslider bounds(580, 91, 70, 70), text("Rate"),colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOBPM2"), range(0, 480, 1, 1, 1)
rslider bounds(645, 91, 70, 70), text("Rate Div."),colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOBPMDiv2"), range(1, 64, 1, 1, 1)
rslider bounds(710, 91, 70, 70), text("Smoothing"),colour( 30, 30 ,30), trackercolour("black"), fontcolour("white"), channel("LFOport2"), range(0, 0.1, 0.001, 0.25, 0.000001)
checkbox bounds(405,111, 80, 12), text("Link Rates"), channel("RateLink"),colour(yellow), fontcolour("white"), value(0)

label bounds(220,150, 200, 12), text("Author: Iain McCurdy |2013|"), FontColour("grey")
</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

;Author: Iain McCurdy (2013)

opcode resony2,a,akkikii
ain, kbf, kbw, inum, ksep , isepmode, iscl xin

;IF 'Octaves (Total)' MODE SELECTED...
if isepmode==0 then
irescale divz inum,inum-1,1 ;PREVENT ERROR IF NUMBER OF FILTERS = ZERO
ksep = ksep * irescale ;RESCALE SEPARATION
;IF 'Hertz' MODE SELECTED...
elseif isepmode==1 then
inum = inum + 1
ksep = inum

;IF 'Octaves (Adjacent)' MODE SELECTED...
elseif isepmode==2 then
irescale divz inum,inum-1,1 ;PREVENT ERROR IF NUMBER OF FILTERS = ZERO
ksep = ksep * irescale ;RESCALE SEPARATION
ksep = ksep * (inum-1) ;RESCALE SEPARATION INTERVAL ACCORDING TO THE NUMBER OF FILTERS CHOSEN
isepmode = 0
endif

aout resony ain, kbf, kbw, inum, ksep , isepmode, iscl, 0
xout aout
endop


instr 1
kporttime linseg 0,0.001,1

kcf chnget "cf" ;
kcf portk kcf,kporttime*0.05
kres chnget "res" ;
kmodel chnget "model" ;
ktype chnget "type" ;
kresync chnget "resync" ;

kmix chnget "mix" ;
klevel chnget "level" ;

kpbr chnget "pbr" ;
kpbr init 1
knpol chnget "npol" ;
knpol init 2

kq chnget "q" ;
kmode chnget "mode" ;
kmode init 1
kmode init i(kmode)-1
ksep chnget "sep" ;
kfeedback chnget "feedback" ;
kord chnget "ord" ;

;resony
kbw chnget "bw"
knum chnget "num"
ksepR chnget "sepR"
ksepR2 chnget "sepR2"
ksepmode chnget "sepmode"
ksepmode = ksepmode - 1
ksepmode init 1
kscl chnget "scl"
kscl = kscl - 1
kscl init 1

;kbalance chnget "balance" ;

kLFOtype chnget "LFOtype"
kLFOamp chnget "LFOamp"
kLFOamp portk kLFOamp, kporttime*0.05
kLFOBPM chnget "LFOBPM"
kLFOBPMDiv chnget "LFOBPMDiv"
kLFOcps = (kLFOBPM*4)/(60*kLFOBPMDiv)
kLFOport chnget "LFOport"

kLFOtype2 chnget "LFOtype2"
kLFOamp2 chnget "LFOamp2"
kLFOamp2 portk kLFOamp2, kporttime*0.05
kLFOBPM2 chnget "LFOBPM2"
kLFOBPMDiv2 chnget "LFOBPMDiv2"
kLFOcps2 = (kLFOBPM2*4)/(60*kLFOBPMDiv2)
kLFOport2 chnget "LFOport2"
kRateLink chnget "RateLink"
if kRateLink=1 then
ktrig1 changed kLFOBPM
ktrig2 changed kLFOBPM2
if ktrig1=1 then
chnset kLFOBPM,"LFOBPM2"
elseif ktrig2=1 then
chnset kLFOBPM2,"LFOBPM"
endif
endif
/* INPUT */
kinput chnget "input"
if kinput=1 then
aL,aR ins
elseif kinput=2 then
aL vco2 0.2, 150
aR = aL
else
aL pinkish 0.2
aR pinkish 0.2
endif

; RETRIGGERING FOR I-RATE VARIABLE
kLFOtype init 1
kLFOtype2 init 1

ktrig changed knpol,kpbr,kLFOtype,kLFOtype2,kmodel,ktype,kord,kmode, kscl, knum, ksepmode, kresync,kLFOBPMDiv,kLFOBPMDiv2,kRateLink
if ktrig==1 then
reinit UPDATE
endif
UPDATE:
; LFO
if i(kLFOtype)==7 then
klfo randomh -kLFOamp, kLFOamp, kLFOcps
elseif i(kLFOtype)==8 then
klfo jspline kLFOamp, kLFOcps, kLFOcps*5
else
klfo lfo kLFOamp, kLFOcps, i(kLFOtype)-1
endif
klfo portk klfo,kporttime*kLFOport
;kcf limit kcf * octave(klfo),20,sr/2

; LFO2
if i(kLFOtype2)==7 then
klfo2 randomh -kLFOamp2, kLFOamp2, kLFOcps2
elseif i(kLFOtype2)==8 then
klfo2 jspline kLFOamp2, kLFOcps2, kLFOcps2*5
else
klfo2 lfo kLFOamp2, kLFOcps2, i(kLFOtype2)-1
endif
klfo2 portk klfo2,kporttime*kLFOport2
kcf limit kcf * octave(klfo) * octave(klfo2),20,sr/2


; FILTER MODEL SELECT
if i(kmodel)==1 then
if i(ktype)==1 then ; tone
aFiltL tone aL, kcf
aFiltR tone aR, kcf
else
aFiltL atone aL, kcf
aFiltR atone aR, kcf
endif
elseif i(kmodel)==2 then ; butterworth
if i(ktype)==1 then
aFiltL butlp aL, kcf
aFiltR butlp aR, kcf
else
aFiltL buthp aL, kcf
aFiltR buthp aR, kcf
endif
elseif i(kmodel)==3 then ; moogladder
kres scale kres,0.95,0
aFiltL moogladder aL,kcf,kres
aFiltR moogladder aR,kcf,kres
elseif i(kmodel)==4 then ; cl-butterworth
if i(ktype)==1 then
aFiltL clfilt aL, kcf, 0, i(knpol)
aFiltR clfilt aR, kcf, 0, i(knpol)
else
aFiltL clfilt aL, kcf, 1, i(knpol)
aFiltR clfilt aR, kcf, 1, i(knpol)
endif
elseif i(kmodel)==5 then ; cl-chebychev I
if i(ktype)==1 then
aFiltL clfilt aL, kcf, 0, i(knpol), 1, i(kpbr)
aFiltR clfilt aR, kcf, 0, i(knpol), 1, i(kpbr)
else
aFiltL clfilt aL, kcf, 1, i(knpol), 1, i(kpbr)
aFiltR clfilt aR, kcf, 1, i(knpol), 1, i(kpbr)
endif
elseif i(kmodel)==6 then ; resonz
kres logcurve kres,4
kbw scale 1-kres,3,0.1
aFiltL resonz aL, kcf, kcf*kbw, 1
aFiltR resonz aR, kcf, kcf*kbw, 1
elseif i(kmodel)==7 then ; phaser2
kfeedback scale kres,0.99,0
aFiltL phaser2 aL, kcf, kq, kord, kmode, ksep, kfeedback ; PHASER2 IS APPLIED TO THE LEFT CHANNEL
aFiltR phaser2 aR, kcf, kq, kord, kmode, ksep, kfeedback ; PHASER1 IS APPLIED TO THE RIGHT CHANNEL
elseif i(kmodel)==8 then ; resony
;CALL resony2 UDO
aFiltL resony2 aL, kcf, kbw, i(knum), ksepR , i(ksepmode), i(kscl)
aFiltR resony2 aR, kcf, kbw, i(knum), ksepR , i(ksepmode), i(kscl)
endif
rireturn

/*
if kbalance==1 then
aFiltL balance aFiltL,aL
aFiltR balance aFiltR,aR
endif
*/

aL ntrpol aL,aFiltL,kmix
aR ntrpol aR,aFiltR,kmix
outs aL*klevel,aR*klevel
endin

instr UpdateWidgets
ksepR chnget "sepR"
ksepR2 chnget "sepR2"
ktrig1 changed ksepR
ktrig2 changed ksepR2
if ktrig1==1 then
chnset ksepR*12, "sepR2"
elseif ktrig2==1 then
chnset ksepR2/12, "sepR"
endif
endin
</CsInstruments>

<CsScore>
i 1 0 [3600*24*7]
i "UpdateWidgets" 0 [3600*24*7]
</CsScore>

</CsoundSynthesizer>

+ 89
- 0
bin/cabbage-extra/Effects/Flanger.csd View File

@@ -0,0 +1,89 @@
<Cabbage>
form caption("Flanger") size(510, 90), pluginID("flan")
image pos(0, 0), size(510, 90), colour("lightgreen"), shape("rounded"), outline("white"), line(4)
rslider bounds( 5, 10, 70, 70), text("Rate"), channel("rate"), range(0.001, 40, 0.15, 0.5, 0.001), colour("DarkGreen"), trackercolour( 0, 30, 0), fontcolour( 0, 30, 0)
rslider bounds( 75, 10, 70, 70), text("Depth"), channel("depth"), range(0, 0.01, 0.005,1,0.0001), colour("DarkGreen"), trackercolour( 0, 30, 0), fontcolour( 0, 30, 0)
rslider bounds(145, 10, 70, 70), text("Delay"), channel("delay"), range(0.0001, 0.1, 0.0001, 0.5, 0.0001), colour("DarkGreen"), trackercolour( 0, 30, 0), fontcolour( 0, 30, 0)
rslider bounds(215, 10, 70, 70), text("Feedback"), channel("fback"), range(-1, 1, 0), colour("DarkGreen"), trackercolour( 0, 30, 0), fontcolour( 0, 30, 0)
rslider bounds(285, 10, 70, 70), text("Mix"), channel("mix"), range(0, 1.00, 0.5), colour("DarkGreen"), trackercolour( 0, 30, 0), fontcolour( 0, 30, 0)
checkbox bounds(355, 10, 80, 15), colour("yellow"), channel("ThruZero"), value(1), text("Thru.Zero"), fontcolour( 0, 30, 0)
label bounds(365, 37, 70, 12), text("LFO Shape"), fontcolour( 0, 30, 0)
combobox bounds(355, 50, 80, 20), channel("lfoshape"), size(100,50), value(1), text("parabola", "sine", "triangle", "randomi", "randomh")
rslider bounds(435, 10, 70, 70), text("Level"), channel("level"), range(0, 1.00, 1), colour("DarkGreen"), trackercolour( 0, 30, 0), fontcolour( 0, 30, 0)
</Cabbage>

<CsoundSynthesizer>
<CsOptions>
-d -n
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2012)

opcode Flanger,a,akkkkk
ain,krate,kdepth,kdelay,kfback,klfoshape xin ;read in input arguments
iparabola ftgentmp 0, 0, 131072, 19, 0.5, 1, 180, 1 ;u-shape parabola for lfo
isine ftgentmp 0, 0, 131072, 19, 1, 0.5, 0, 0.5 ;sine-shape for lfo
itriangle ftgentmp 0, 0, 131072, 7, 0,131072/2,1,131072/2,0;triangle-shape for lfo
adlt interp kdelay ;a new a-rate variable 'adlt' is created by interpolating the k-rate variable 'kdlt'
if klfoshape==1 then
amod oscili kdepth, krate, iparabola ;oscillator that makes use of the positive domain only u-shape parabola
elseif klfoshape==2 then
amod oscili kdepth, krate, isine ;oscillator that makes use of the positive domain only sine wave
elseif klfoshape==3 then
amod oscili kdepth, krate, itriangle ;oscillator that makes use of the positive domain only triangle
elseif klfoshape==4 then
amod randomi 0,kdepth,krate,1
else
amod randomh 0,kdepth,krate,1
endif
adlt sum adlt, amod ;static delay time and modulating delay time are summed
adelsig flanger ain, adlt, kfback , 1.2 ;flanger signal created
adelsig dcblock adelsig
aout sum ain*0.5, adelsig*0.5 ;create dry/wet mix
xout aout ;send audio back to caller instrument
endop

instr 1
krate chnget "rate" ;read in widgets
kdepth chnget "depth"
kdelay chnget "delay"
kfback chnget "fback"
klevel chnget "level"
klfoshape chnget "lfoshape"
kThruZero chnget "ThruZero"
kmix chnget "mix"
;a1,a2 ins ;read live stereo audio input
a1 pinkish 0.2 ;for testing...
a2 pinkish 0.2

kporttime linseg 0,0.001,0.1
kdelay portk kdelay,kporttime

afla1 Flanger a1,krate,kdepth,kdelay,kfback,klfoshape ;call udo (left channel)
afla2 Flanger a2,krate,kdepth,kdelay,kfback,klfoshape ;call udo (right channel)

if kThruZero==1 then ;if 'Thru.Zero' mode is selected...
a1 delay a1,0.0001
a2 delay a2,0.0001
a1 ntrpol -a1,afla1,kmix ;invert delayed dry signal and mix with flanger signal
a2 ntrpol -a2,afla2,kmix
else ;otherwise... (standard flanger)
a1 ntrpol a1,afla1,kmix ;create mix between dry signal and flanger signal
a2 ntrpol a2,afla2,kmix
endif
outs a1*klevel,a2*klevel ;send audio to outputs, scale amplitude according to GUI knob value
endin

</CsInstruments>

<CsScore>
i 1 0 [60*60*24*7]
</CsScore>

</CsoundSynthesizer>

+ 286
- 0
bin/cabbage-extra/Effects/FormantFilter.csd View File

@@ -0,0 +1,286 @@
FormantFilter.csd

reson 1 uses reson with scaling method 1.
reson 2 uses reson with scaling method 2.
'gain' controls the gain the the bandpass filtered sound only.
'BW.Mult' is a factor which all five bandwidth values are multiplied by.
'Freq.Mult.' is a factor by which all cutoff frequencies are multiplied by.

<Cabbage>
form caption("Formant Filter"), colour("SlateGrey"), size(550, 300), pluginID("form")

xypad bounds(5, 5, 350, 260), channel("x", "y"), rangex(0, 1, 0.5), rangey(0, 1, 0), text("upper edge:A E I | lower :U O"), fontcolour("white")

vslider bounds(360, 0, 30,140), text("f1"), channel("f1"), range(0, 1.00, 1), fontcolour("white")
vslider bounds(380, 0, 30,140), text("f2"), channel("f2"), range(0, 1.00, 1), fontcolour("white")
vslider bounds(400, 0, 30,140), text("f3"), channel("f3"), range(0, 1.00, 1), fontcolour("white")
vslider bounds(420, 0, 30,140), text("f4"), channel("f4"), range(0, 1.00, 1), fontcolour("white")
vslider bounds(440, 0, 30,140), text("f5"), channel("f5"), range(0, 1.00, 1), fontcolour("white")
combobox bounds(365, 155,100, 20), channel("voice"), value(1), text("bass", "tenor", "countertenor", "alto", "soprano")
combobox bounds(365, 185,100, 20), channel("filter"), value(1), text("reson 1", "reson 2", "butterworth")
checkbox bounds(365, 215,100, 20), colour("yellow"), channel("balance"), value(0), text("Balance"), fontcolour("white")
button bounds(365, 245,100, 20), text("Live Input","Noise Input"), channel("input"), value(0), fontcolour("lime")

rslider bounds(480, 5, 60, 60), text("BW.Mult"), channel("BWMlt"), range(0.01, 4, 1, 0.4), fontcolour("white")
rslider bounds(480, 70, 60, 60), text("Freq.Mult"), channel("FrqMlt"), range(0.25, 4, 1, 0.4), fontcolour("white")
rslider bounds(480,140, 60, 60), text("Mix"), channel("mix"), range(0, 1.00, 1), fontcolour("white")
rslider bounds(480,210, 60, 60), text("Gain"), channel("gain"), range(0, 5.00, 1, 0.5), fontcolour("white")

image bounds( 5, 275, 350, 18), colour(75, 85, 90, 100), plant("credit"), line(0){
label bounds(0.03, 0.1, .6, .8), text("Author: Iain McCurdy |2012|"), colour("white")
}
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -n -+rtmidi=null -M0
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;Author: Iain McCurdy (2012)

;FUNCTION TABLES STORING DATA FOR VARIOUS VOICE FORMANTS
;THE FIRST VALUE OF EACH TABLE DEFINES THE NUMBER OF DATA ELEMENTS IN THE TABLE
; THIS IS NEEDED BECAUSE TABLES SIZES MUST BE POWERS OF 2 TO FACILITATE INTERPOLATED TABLE READING (tablei)
;BASS
giBFA ftgen 0, 0, 8, -2, 4, 600, 400, 250, 350 ;FREQ
giBFE ftgen 0, 0, 8, -2, 4, 1040, 1620, 1750, 600 ;FREQ
giBFI ftgen 0, 0, 8, -2, 4, 2250, 2400, 2600, 2400 ;FREQ
giBFO ftgen 0, 0, 8, -2, 4, 2450, 2800, 3050, 2675 ;FREQ
giBFU ftgen 0, 0, 8, -2, 4, 2750, 3100, 3340, 2950 ;FREQ

giBDbA ftgen 0, 0, 8, -2, 4, 0, 0, 0, 0 ;dB
giBDbE ftgen 0, 0, 8, -2, 4, -7, -12, -30, -20 ;dB
giBDbI ftgen 0, 0, 8, -2, 4, -9, -9, -16, -32 ;dB
giBDbO ftgen 0, 0, 8, -2, 4, -9, -12, -22, -28 ;dB
giBDbU ftgen 0, 0, 8, -2, 4, -20, -18, -28, -36 ;dB

giBBWA ftgen 0, 0, 8, -2, 4, 60, 40, 60, 40 ;BAND WIDTH
giBBWE ftgen 0, 0, 8, -2, 4, 70, 80, 90, 80 ;BAND WIDTH
giBBWI ftgen 0, 0, 8, -2, 4, 110, 100, 100, 100 ;BAND WIDTH
giBBWO ftgen 0, 0, 8, -2, 4, 120, 120, 120, 120 ;BAND WIDTH
giBBWU ftgen 0, 0, 8, -2, 4, 130, 120, 120, 120 ;BAND WIDTH
;TENOR
giTFA ftgen 0, 0, 8, -2, 5, 650, 400, 290, 400, 350 ;FREQ
giTFE ftgen 0, 0, 8, -2, 5, 1080, 1700, 1870, 800, 600 ;FREQ
giTFI ftgen 0, 0, 8, -2, 5, 2650, 2600, 2800, 2600, 2700 ;FREQ
giTFO ftgen 0, 0, 8, -2, 5, 2900, 3200, 3250, 2800, 2900 ;FREQ
giTFU ftgen 0, 0, 8, -2, 5, 3250, 3580, 3540, 3000, 3300 ;FREQ

giTDbA ftgen 0, 0, 8, -2, 5, 0, 0, 0, 0, 0 ;dB
giTDbE ftgen 0, 0, 8, -2, 5, -6, -14, -15, -10, -20 ;dB
giTDbI ftgen 0, 0, 8, -2, 5, -7, -12, -18, -12, -17 ;dB
giTDbO ftgen 0, 0, 8, -2, 5, -8, -14, -20, -12, -14 ;dB
giTDbU ftgen 0, 0, 8, -2, 5, -22, -20, -30, -26, -26 ;dB

giTBWA ftgen 0, 0, 8, -2, 5, 80, 70, 40, 40, 40 ;BAND WIDTH
giTBWE ftgen 0, 0, 8, -2, 5, 90, 80, 90, 80, 60 ;BAND WIDTH
giTBWI ftgen 0, 0, 8, -2, 5, 120, 100, 100, 100, 100 ;BAND WIDTH
giTBWO ftgen 0, 0, 8, -2, 5, 130, 120, 120, 120, 120 ;BAND WIDTH
giTBWU ftgen 0, 0, 8, -2, 5, 140, 120, 120, 120, 120 ;BAND WIDTH
;COUNTER TENOR
giCTFA ftgen 0, 0, 8, -2, 5, 660, 440, 270, 430, 370 ;FREQ
giCTFE ftgen 0, 0, 8, -2, 5, 1120, 1800, 1850, 820, 630 ;FREQ
giCTFI ftgen 0, 0, 8, -2, 5, 2750, 2700, 2900, 2700, 2750 ;FREQ
giCTFO ftgen 0, 0, 8, -2, 5, 3000, 3000, 3350, 3000, 3000 ;FREQ
giCTFU ftgen 0, 0, 8, -2, 5, 3350, 3300, 3590, 3300, 3400 ;FREQ

giTBDbA ftgen 0, 0, 8, -2, 5, 0, 0, 0, 0, 0 ;dB
giTBDbE ftgen 0, 0, 8, -2, 5, -6, -14, -24, -10, -20 ;dB
giTBDbI ftgen 0, 0, 8, -2, 5, -23, -18, -24, -26, -23 ;dB
giTBDbO ftgen 0, 0, 8, -2, 5, -24, -20, -36, -22, -30 ;dB
giTBDbU ftgen 0, 0, 8, -2, 5, -38, -20, -36, -34, -30 ;dB

giTBWA ftgen 0, 0, 8, -2, 5, 80, 70, 40, 40, 40 ;BAND WIDTH
giTBWE ftgen 0, 0, 8, -2, 5, 90, 80, 90, 80, 60 ;BAND WIDTH
giTBWI ftgen 0, 0, 8, -2, 5, 120, 100, 100, 100, 100 ;BAND WIDTH
giTBWO ftgen 0, 0, 8, -2, 5, 130, 120, 120, 120, 120 ;BAND WIDTH
giTBWU ftgen 0, 0, 8, -2, 5, 140, 120, 120, 120, 120 ;BAND WIDTH
;ALTO
giAFA ftgen 0, 0, 8, -2, 5, 800, 400, 350, 450, 325 ;FREQ
giAFE ftgen 0, 0, 8, -2, 5, 1150, 1600, 1700, 800, 700 ;FREQ
giAFI ftgen 0, 0, 8, -2, 5, 2800, 2700, 2700, 2830, 2530 ;FREQ
giAFO ftgen 0, 0, 8, -2, 5, 3500, 3300, 3700, 3500, 2500 ;FREQ
giAFU ftgen 0, 0, 8, -2, 5, 4950, 4950, 4950, 4950, 4950 ;FREQ

giADbA ftgen 0, 0, 8, -2, 5, 0, 0, 0, 0, 0 ;dB
giADbE ftgen 0, 0, 8, -2, 5, -4, -24, -20, -9, -12 ;dB
giADbI ftgen 0, 0, 8, -2, 5, -20, -30, -30, -16, -30 ;dB
giADbO ftgen 0, 0, 8, -2, 5, -36, -35, -36, -28, -40 ;dB
giADbU ftgen 0, 0, 8, -2, 5, -60, -60, -60, -55, -64 ;dB

giABWA ftgen 0, 0, 8, -2, 5, 50, 60, 50, 70, 50 ;BAND WIDTH
giABWE ftgen 0, 0, 8, -2, 5, 60, 80, 100, 80, 60 ;BAND WIDTH
giABWI ftgen 0, 0, 8, -2, 5, 170, 120, 120, 100, 170 ;BAND WIDTH
giABWO ftgen 0, 0, 8, -2, 5, 180, 150, 150, 130, 180 ;BAND WIDTH
giABWU ftgen 0, 0, 8, -2, 5, 200, 200, 200, 135, 200 ;BAND WIDTH
;SOPRANO
giSFA ftgen 0, 0, 8, -2, 5, 800, 350, 270, 450, 325 ;FREQ
giSFE ftgen 0, 0, 8, -2, 5, 1150, 2000, 2140, 800, 700 ;FREQ
giSFI ftgen 0, 0, 8, -2, 5, 2900, 2800, 2950, 2830, 2700 ;FREQ
giSFO ftgen 0, 0, 8, -2, 5, 3900, 3600, 3900, 3800, 3800 ;FREQ
giSFU ftgen 0, 0, 8, -2, 5, 4950, 4950, 4950, 4950, 4950 ;FREQ

giSDbA ftgen 0, 0, 8, -2, 5, 0, 0, 0, 0, 0 ;dB
giSDbE ftgen 0, 0, 8, -2, 5, -6, -20, -12, -11, -16 ;dB
giSDbI ftgen 0, 0, 8, -2, 5, -32, -15, -26, -22, -35 ;dB
giSDbO ftgen 0, 0, 8, -2, 5, -20, -40, -26, -22, -40 ;dB
giSDbU ftgen 0, 0, 8, -2, 5, -50, -56, -44, -50, -60 ;dB

giSBWA ftgen 0, 0, 8, -2, 5, 80, 60, 60, 70, 50 ;BAND WIDTH
giSBWE ftgen 0, 0, 8, -2, 5, 90, 90, 90, 80, 60 ;BAND WIDTH
giSBWI ftgen 0, 0, 8, -2, 5, 120, 100, 100, 100, 170 ;BAND WIDTH
giSBWO ftgen 0, 0, 8, -2, 5, 130, 150, 120, 130, 180 ;BAND WIDTH
giSBWU ftgen 0, 0, 8, -2, 5, 140, 200, 120, 135, 200 ;BAND WIDTH

instr 1
gkx chnget "x"
gky chnget "y"
gkf1 chnget "f1"
gkf2 chnget "f2"
gkf3 chnget "f3"
gkf4 chnget "f4"
gkf5 chnget "f5"
gkvoice chnget "voice"
gkvoice init 1
gkBWMlt chnget "BWMlt"
gkFrqMlt chnget "FrqMlt"
gkmix chnget "mix"
gkgain chnget "gain"
gkfilter chnget "filter"
gkbalance chnget "balance"
gkinput chnget "input"
endin

instr 2
kporttime linseg 0,0.001,0.1
if gkinput==0 then
asigL,asigR ins
else
asigL pinkish 1
asigR pinkish 1
endif
kx portk gkx,kporttime
ky portk gky,kporttime
kSwitch changed gkvoice ;GENERATE A MOMENTARY '1' PULSE IN OUTPUT 'kSwitch' IF ANY OF THE SCANNED INPUT VARIABLES CHANGE. (OUTPUT 'kSwitch' IS NORMALLY ZERO)
if kSwitch=1 then ;IF I-RATE VARIABLE CHANGE TRIGGER IS '1'...
reinit START ;BEGIN A REINITIALISATION PASS FROM LABEL 'START'
endif
START:
;A TEXT MACRO IS DEFINED THAT WILL BE THE CODE FOR DERIVING DATA FOR EACH FORMANT. A MACRO IS USED TO AVOID HAVING TO USING CODE REPETITION AND TO EASIER FACICLITATE CODE MODIFICATION
#define FORMANT_DATA(N)
#
invals table 0, giBFA+((i(gkvoice)-1)*15)+$N-1 ;NUMBER OF DATA ELEMENTS IN EACH TABLE
invals = invals-1 ;
kfreq$N_U tablei 1+(kx*(3/5)*invals),giBFA+((i(gkvoice)-1)*15)+$N-1 ;READ DATA FOR FREQUENCY (UPPER EDGE OF PANEL)
kfreq$N_L tablei 1+(((1-kx)*(1/5))+(4/5)*invals),giBFA+((i(gkvoice)-1)*15)+$N-1 ;READ DATA FOR FREQUENCY (LOWER EDGE OF PANEL)
kfreq$N ntrpol kfreq$N_L, kfreq$N_U, ky ;INTERPOLATE BETWEEN UPPER VALUE AND LOWER VALUE (DETERMINED BY Y-LOCATION ON PANEL)
kfreq$N = kfreq$N * gkFrqMlt ;MULTIPLY FREQUENCY VALUE BY VALUE FROM 'Frequency Multiply' SLIDER
kdbamp$N_U tablei 1+(kx*(3/5)*invals),giBDbA+((i(gkvoice)-1)*15)+$N-1 ;READ DATA FOR INTENSITY (UPPER EDGE OF PANEL)
kdbamp$N_L tablei 1+(((1-kx)*(1/5))+(4/5)*invals),giBDbA+((i(gkvoice)-1)*15)+$N-1 ;READ DATA FOR INTENSITY (LOWER EDGE OF PANEL)
kdbamp$N ntrpol kdbamp$N_L, kdbamp$N_U, ky ;INTERPOLATE BETWEEN UPPER VALUE AND LOWER VALUE (DETERMINED BY Y-LOCATION ON PANEL)
kbw$N_U tablei 1+(kx*(3/5)*invals),giBBWA+((i(gkvoice)-1)*15)+$N-1 ;READ DATA FOR BANDWIDTH (UPPER EDGE OF PANEL)
kbw$N_L tablei 1+(((1-kx)*(1/5))+(4/5)*invals),giBBWA+((i(gkvoice)-1)*15)+$N-1 ;READ DATA FOR BANDWIDTH (LOWER EDGE OF PANEL)
kbw$N ntrpol kbw$N_L, kbw$N_U, ky ;INTERPOLATE BETWEEN UPPER VALUE AND LOWER VALUE (DETERMINED BY Y-LOCATION ON PANEL)
kbw$N = kbw$N * gkBWMlt ;MULTIPLY BANDWIDTH VALUE BY VALUE FROM 'Bandwidth Multiply' SLIDER
# ;END OF MACRO!

;READING DATA FOR FORMANTS (MACROS IMPLEMENTED)
$FORMANT_DATA(1)
$FORMANT_DATA(2)
$FORMANT_DATA(3)
$FORMANT_DATA(4)
$FORMANT_DATA(5)

rireturn ;RETURN FROM REINITIALISATION PASS TO PERFORMANCE TIME PASSES
if gkfilter==1 then
aBPF1L reson asigL, kfreq1, kbw1, 1 ;FORMANT 1
aBPF1R reson asigR, kfreq1, kbw1, 1 ;FORMANT 1
;
aBPF2L reson asigL, kfreq2, kbw2, 1 ;FORMANT 2
aBPF2R reson asigR, kfreq2, kbw2, 1 ;FORMANT 2
;
aBPF3L reson asigL, kfreq3, kbw3, 1 ;FORMANT 3
aBPF3R reson asigR, kfreq3, kbw3, 1 ;FORMANT 3
;
aBPF4L reson asigL, kfreq4, kbw4, 1 ;FORMANT 4
aBPF4R reson asigR, kfreq4, kbw4, 1 ;FORMANT 4
;
aBPF5L reson asigL, kfreq5, kbw5, 1 ;FORMANT 5
aBPF5R reson asigR, kfreq5, kbw5, 1 ;FORMANT 5
elseif gkfilter==2 then
aBPF1L reson asigL, kfreq1, kbw1, 2 ;FORMANT 1
aBPF1R reson asigR, kfreq1, kbw1, 2 ;FORMANT 1
;
aBPF2L reson asigL, kfreq2, kbw2, 2 ;FORMANT 2
aBPF2R reson asigR, kfreq2, kbw2, 2 ;FORMANT 2
;
aBPF3L reson asigL, kfreq3, kbw3, 2 ;FORMANT 3
aBPF3R reson asigR, kfreq3, kbw3, 2 ;FORMANT 3
;
aBPF4L reson asigL, kfreq4, kbw4, 2 ;FORMANT 4
aBPF4R reson asigR, kfreq4, kbw4, 2 ;FORMANT 4
;