;Written by Iain McCurdy, 2010
;Modified for QuteCsound by René, April 2011
;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
; On/Off latched button light is saved in presets, so light goes off when changing preset
;Notes on modifications from original csd:
; Add Browser for audio file and use of FilePlay2 udo, now accept mono or stereo wav files
; Delayed reverb start to avoid "INIT ERROR in instr 2: illegal loop time"
; Use QuteCsound Presets
;my flags on Ubuntu: -iadc -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0
--env:SSDIR+=../../SourceMaterials
sr = 44100 ;SAMPLE RATE
ksmps = 32 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
0dbfs = 1
opcode FilePlay2, aa, Skoo ; Credit to Joachim Heintz
;gives stereo output regardless your soundfile is mono or stereo
Sfil, kspeed, iskip, iloop xin
ichn filenchnls Sfil
if ichn == 1 then
aL diskin2 Sfil, kspeed, iskip, iloop
aR = aL
else
aL, aR diskin2 Sfil, kspeed, iskip, iloop
endif
xout aL, aR
endop
instr 10 ;GUI
ktrig metro 10
if (ktrig == 1) then
gkingain invalue "LiveGain"
gkmix invalue "Mix"
gkinput invalue "Input"
gklpt1 invalue "LoopTime1"
gklpt2 invalue "LoopTime2"
gklpt3 invalue "LoopTime3"
gklpt4 invalue "LoopTime4"
gklpt5 invalue "LoopTime5"
gklpt6 invalue "LoopTime6"
gkrvt1 invalue "RvbTime1"
gkrvt2 invalue "RvbTime2"
gkrvt3 invalue "RvbTime3"
gkrvt4 invalue "RvbTime4"
gkrvt5 invalue "RvbTime5"
gkrvt6 invalue "RvbTime6"
endif
endin
instr 1 ;PLAYS FILE AND OUTPUTS GLOBAL VARIABLES
if gkinput==0 then ;IF FILE INPUT IS SELECTED...
Sfile invalue "_Browse1"
gasigL, gasigR FilePlay2 Sfile, 1, 0, 1 ;GENERATE 2 AUDIO SIGNALS FROM A SOUND FILE (NOTE THE USE OF GLOBAL VARIABLES)
else ;OTHERWISE
asigL, asigR ins ;TAKE INPUT FROM COMPUTER'S AUDIO INPUT
gasigL = asigL * gkingain ;SCALE USING 'Input Gain' SLIDER
gasigR = asigR * gkingain ;SCALE USING 'Input Gain' SLIDER
endif ;END OF CONDITIONAL BRANCHING
endin
instr 2 ;REVERB - ALWAYS ON
ktrigger changed gklpt1, gklpt2, gklpt3, gklpt4, gklpt5, gklpt6 ;IF ANY OF THE INPUT ARGUMENTS CHANGES GENERATE A MOMENTARY '1' VALUE (BAND)
if ktrigger=1 then ;IF QUERY IS TRUE...
reinit UPDATE ;BEGIN A REINITIALIZATION PASS FROM LABEL 'UPDATE' IN ORDER TO FORCE AN UPDATE OF I-RATE CONTROLLERS
endif ;END OF THIS CONDITIONAL BRANCH
UPDATE: ;LABEL CALLED 'UPDATE'
a1 comb gasigL, gkrvt1, i(gklpt1) ;COMB FILTER 1
a2 comb gasigL, gkrvt2, i(gklpt2) ;COMB FILTER 2
a3 comb gasigL, gkrvt3, i(gklpt3) ;COMB FILTER 3
a4 comb gasigL, gkrvt4, i(gklpt4) ;COMB FILTER 4
aSum sum a1,a2,a3,a4 ;MIX THE OUTPUT FROM THE FOUR COMB FILTERS
a5 alpass aSum, gkrvt5, i(gklpt5) ;SEND THE MIXED OUTPUT INTO THE FIRST ALLPASS FILTER
aRvb alpass a5, gkrvt6, i(gklpt6) ;SEND THE OUTPUT OF THE FIRST ALLPASS FILTER INTO THE SECOND ALLPASS FILTER
rireturn ;RETURN FROM REINITIALIZATION PASS (IF APPLICABLE)
amix ntrpol aRvb, gasigL, gkmix ;CREATE A MIX BETWEEN THE WET AND DRY SIGNALS. CONTROLLABLE BY THE USER FROM AN ON SCREEN SLIDER
outs amix*0.7, amix*0.7 ;SEND WET/DRY MIX AUDIO TO OUTPUTS
clear gasigL ;CLEAR GLOBAL AUDIO VARIABLES
endin
;INSTR | START | DURATION
i 10 0.0 3600 ;GUI
i 2 0.5 3600 ;REVERB INSTRUMENT PLAYS FOR 1 HOUR (AND KEEPS PERFORMANCE GOING)
426
182
922
571
true
241
226
185
2
2
396
416
{aa607456-d368-4d59-8497-d16d608404c3}
true
0
0
center
Liberation Sans
18
3
0
0
0
158
220
158
border
5
2
400
2
517
416
{74928ed2-b701-4668-9a11-74763d317e9b}
true
0
0
center
Liberation Sans
18
3
0
0
0
158
220
158
border
5
2
404
229
511
186
{d4bdb5ce-87d8-4c8c-9c64-40ec2eed6f5a}
true
0
0
left
Liberation Sans
14
3
0
0
0
255
255
255
noborder
1
1
8
14
92
130
{18adc638-dc9e-4360-9161-a6deaece4f61}
true
0
0
center
Liberation Sans
16
3
0
0
0
244
248
200
border
6
2
LoopTime1
14
42
80
25
{15c492fd-5d92-4a0e-a671-377808d9085e}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
0.02970000
0.00100000
0.00010000
0.50000000
border
5
1
false
14
64
80
30
{6255d00a-3fec-468c-a96f-94cac7f5bfe1}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime1
14
92
80
25
{7414dac7-8131-4e10-bc4e-d0447f28cca6}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
5.00000000
0.00100000
0.01000000
20.00000000
border
5
1
false
14
114
80
30
{c43c9baf-b9e3-4612-a93f-fcbc8146ed57}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
105
14
92
130
{90bf81b4-a6d5-40d2-872f-cdc27398303b}
true
0
0
center
Liberation Sans
16
3
0
0
0
244
248
200
border
6
2
LoopTime2
111
42
80
25
{65099784-d4a5-40df-8bd7-da5dd69f3392}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
0.03710000
0.00100000
0.00010000
0.50000000
border
5
1
false
111
64
80
30
{171d13cd-0a69-4854-a8fc-3421ba541ecf}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime2
111
92
80
25
{7ffce508-d2a1-4cde-a7d8-f442709a887c}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
5.00000000
0.00100000
0.01000000
20.00000000
border
5
1
false
111
114
80
30
{a4bb026d-ca8e-4fe6-909c-42e50a3f1171}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
202
14
92
130
{b66863f7-8231-4f29-ad7e-151657173ecf}
true
0
0
center
Liberation Sans
16
3
0
0
0
244
248
200
border
6
2
LoopTime3
208
42
80
25
{9224f65e-884c-441b-86ae-93cfe9f28b05}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
0.04110000
0.00100000
0.00010000
0.50000000
border
5
1
false
208
64
80
30
{40efb71a-7e5f-4448-a65e-b2f711a8ae4e}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime3
208
92
80
25
{f7d68c66-ecab-4152-94c4-8560e11311b1}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
5.00000000
0.00100000
0.01000000
20.00000000
border
5
1
false
208
114
80
30
{97e67539-6a32-48d4-9919-314828fe647f}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
299
14
92
130
{2e3b654d-8cb4-444d-bf8e-b6d8793d2358}
true
0
0
center
Liberation Sans
16
3
0
0
0
244
248
200
border
6
2
LoopTime4
305
42
80
25
{73e0491c-e4b2-4935-8f54-272823abeba5}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
0.04370000
0.00100000
0.00010000
0.50000000
border
5
1
false
305
64
80
30
{4dff1ddd-0d6d-494c-92a4-93b83917459f}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime4
305
92
80
25
{4d60d18a-90e7-41f5-90ac-1a788a54bd46}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
5.00000000
0.00100000
0.01000000
20.00000000
border
5
1
false
305
114
80
30
{2f6d5adc-0fe0-4cdf-93a9-ba40a938e96a}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
153
149
92
130
{5cfba94c-0dda-4f8c-a4c7-7058e69b54a6}
true
0
0
center
Liberation Sans
16
3
0
0
0
244
248
200
border
6
2
LoopTime5
159
177
80
25
{eb11b513-2d14-4b97-8b3b-79715149a2df}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
0.09683000
0.00100000
0.00010000
0.50000000
border
5
1
false
159
199
80
30
{1af47329-fa91-4e81-923b-cfa9bd1a4cc9}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime5
159
227
80
25
{5997d549-0e11-41e5-81fb-7c8bbae4d261}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
2.00000000
0.00100000
0.01000000
20.00000000
border
5
1
false
159
249
80
30
{400ecdeb-f616-4b4f-a3ac-9b0c997afe73}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
153
282
92
130
{135b5447-4fe0-4c49-bf87-238f6baa2d16}
true
0
0
center
Liberation Sans
16
3
0
0
0
244
248
200
border
6
2
LoopTime6
159
310
80
25
{c49e5858-a370-427e-9ebf-4b610151f6aa}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
0.03292000
0.00100000
0.00010000
0.50000000
border
5
1
false
159
332
80
30
{70d7d6d5-8b87-4754-8b83-0abdec3df5e0}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime6
159
360
80
25
{e126b938-9da7-4076-8c0b-75487d47ce32}
true
0
0
center
Liberation Sans
10
0
0
0
182
255
103
2.70000005
0.00100000
0.01000000
20.00000000
border
5
1
false
159
382
80
30
{8a98f9ba-6a10-4f77-ad8a-9f15c53adc66}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
409
14
100
26
{59afdeab-3d0a-4ec7-b256-5059df601de4}
true
0
0
event
1.00000000
ON / OFF
/
i 1 0 -1
true
false
409
63
120
30
{f5af2a56-4d3a-4209-bf6e-d910f0880e72}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LiveGain
849
63
60
30
{681b4d93-d322-42de-b247-477b5c108db6}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
Input
490
195
120
26
{395c88b5-8a25-40c2-a698-72ce16e96264}
true
0
0
Audio File
0
Live Input
1
0
false
408
195
80
26
{6f2943df-facf-440e-900b-33493bced504}
true
0
0
right
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
_Browse1
409
132
170
30
{cb5adcf7-a56f-40e9-a436-3326a882467d}
true
0
0
value
1.00000000
808loopMono.wav
Browse Audio File
/
false
false
_Browse1
581
133
328
28
{4bcdbfa2-0e10-47c3-99c8-701cf9ccf00e}
true
0
0
left
Liberation Sans
10
3
0
0
0
240
235
226
nobackground
581
161
328
34
{aa414945-b880-44e6-a26b-9cde8b733b57}
true
0
0
left
Liberation Sans
12
3
0
0
0
255
255
255
noborder
1
1
LiveGain
409
47
500
27
{5ca7e105-304c-40ab-b5b2-891b7c34584f}
true
0
0
0.00000000
1.00000000
0.05200000
lin
continuous
-1.00000000
false
409
101
172
33
{14a6ebc7-ecc1-4f41-864a-0f7ea9ddb3cc}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Mix
849
101
60
30
{4016c830-7ceb-4117-8bda-f62caf289600}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
Mix
409
86
500
27
{88e2e2a5-6399-4283-b902-0d4beae241f8}
true
0
0
0.00000000
1.00000000
0.80000001
lin
continuous
-1.00000000
false
_SetPresetIndex
756
195
130
26
{54c9994b-1b56-4bb8-8565-31f778c5141d}
true
0
0
Small Room
0
Medium Room
1
Medium Hall
2
Large Hall
3
3
false
673
196
80
26
{c58c5007-2e70-4113-a4a9-264c359d6734}
true
0
0
right
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
2
420
915
149
{3b417eb3-d142-4dbf-8f63-523f0513f5ad}
true
0
0
center
Liberation Sans
18
3
0
0
0
158
220
158
border
5
2
2
419
912
147
{f425298d-d946-497c-a051-bbed3c7b07f8}
true
0
0
left
Liberation Sans
14
3
0
0
0
255
255
255
noborder
1
1
0.02970000
0.30000001
0.03710000
0.30000001
0.04110000
0.30000001
0.04370000
0.30000001
0.02968000
0.10000000
0.02329000
0.10000000
0.00000000
0
0.05200000
0.052
0.00000000
808loopMono.wav
808loopMono.wav
0.05200000
0.89999998
0.900
0.89999998
3.00000000
0.02970000
0.80000001
0.03710000
0.80000001
0.04110000
0.80000001
0.04370000
0.80000001
0.01297000
0.05000000
0.01233000
0.05000000
0.00000000
0
0.05200000
0.052
0.00000000
808loopMono.wav
808loopMono.wav
0.05200000
0.85000002
0.850
0.85000002
3.00000000
0.02970000
2.00000000
0.03710000
2.00000000
0.04110000
2.00000000
0.04370000
2.00000000
0.03297000
0.50000000
0.04233000
0.50000000
0.00000000
0
0.05200000
0.052
0.00000000
808loopMono.wav
808loopMono.wav
0.05200000
0.85000002
0.850
0.85000002
3.00000000
0.02970000
5.00000000
0.03710000
5.00000000
0.04110000
5.00000000
0.04370000
5.00000000
0.09683000
2.00000000
0.03292000
2.70000005
0.00000000
0
0.05200000
0.052
0.00000000
808loopMono.wav
808loopMono.wav
0.05200000
0.80000001
0.800
0.80000001
3.00000000