;Written by Iain McCurdy, 2006
;Modified for QuteCsound by René, April 2011
;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
;Notes on modifications from original csd:
; Add table(s) for exp slider
; Add Browser for audio file and use of FilePlay2 udo, now accept mono or stereo wav files
; Add init instrument
; Delayed reverb start to avoid "INIT ERROR in instr 2: illegal loop time" error
;my flags on Ubuntu: -iadc -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0
--env:SSDIR+=../../SourceMaterials
sr = 44100 ;SAMPLE RATE
ksmps = 100 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
0dbfs = 1 ;MAXIMUM SOUND INTENSITY LEVEL REGARDLESS OF BIT DEPTH
giExp1 ftgen 0, 0, 129, -25, 0, 0.0001, 128, 0.1 ;TABLE FOR EXP SLIDER
giExp2 ftgen 0, 0, 129, -25, 0, 0.0001, 128, 10.0 ;TABLE FOR EXP SLIDER
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"
klpt invalue "LoopTime"
gklpt tablei klpt, giExp1, 1
outvalue "LoopTime_Value", gklpt
krvt invalue "RvbTime"
gkrvt tablei krvt, giExp2, 1
outvalue "RvbTime_Value", gkrvt
gkamp invalue "Amplitude"
gkinput invalue "Input"
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
kSwitch changed gklpt ;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 kSwitch=1 THEN
reinit UPDATE ;BEGIN A REINITIALIZATION PASS FROM LABEL 'UPDATE'
endif ;END OF CONDITIONAL BRANCHING
UPDATE: ;A LABEL
;OUTPUT OPCODE | INPUT | REVERB_TIME | LOOP_TIME_(DELAY_TIME)
aresL comb gasigL, gkrvt, i(gklpt)
aresR comb gasigR, gkrvt, i(gklpt)
rireturn ;RETURN TO PERFORMANCE TIME PASSES
outs aresL * gkamp, aresR * gkamp ;SEND comb OUTPUT TO THE AUDIO OUTPUTS AND SCALE USING THE GUI SLIDER VARIABLE gkamp
clear gasigL, gasigR ;CLEAR GLOBAL AUDIO VARIABLES
endin
instr 11 ;INIT
outvalue "LoopTime" , 0.45
outvalue "RvbTime" , 0.66
outvalue "Amplitude" , .7
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)
i 11 0.0 0.1 ;INIT
565
188
782
506
true
241
226
185
2
2
512
500
{aa607456-d368-4d59-8497-d16d608404c3}
true
0
0
center
Liberation Sans
18
3
0
0
0
158
220
217
border
5
2
8
10
100
30
{487d5181-d838-4cce-9628-317fefc350cb}
true
0
0
event
1.00000000
ON / OFF
/
i 1 0 -1
true
false
8
72
120
30
{0200a063-5db8-4668-bc2d-2d989a083f6e}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LiveGain
448
72
60
30
{ab191e3a-430d-4f1d-88aa-9840342cd2d3}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
516
2
260
500
{74928ed2-b701-4668-9a11-74763d317e9b}
true
0
0
center
Liberation Sans
18
3
0
0
0
158
220
217
border
5
2
520
28
254
472
{d4bdb5ce-87d8-4c8c-9c64-40ec2eed6f5a}
true
0
0
left
Liberation Sans
14
3
0
0
0
255
255
255
noborder
1
1
Input
201
402
120
30
{9b81a1f2-bcb8-4582-925b-9ae56def3865}
true
0
0
Audio File
0
Live Input
1
0
false
119
402
80
30
{62eeb695-9b83-42da-81cd-8000c232d9b9}
true
0
0
right
Arial
10
3
0
0
0
255
255
255
noborder
1
1
_Browse1
8
439
170
30
{9b992da1-8c0f-449e-af03-7913cc05efed}
true
0
0
value
1.00000000
Seashore.wav
Browse Audio File
/
false
false
_Browse1
180
440
330
28
{15a8ec14-710f-43e6-be9e-f5dc8c8786cb}
true
0
0
left
Arial
10
3
0
0
0
229
229
229
nobackground
180
469
330
34
{a63909ac-6fa4-41c8-a84b-ba08e76132ab}
true
0
0
left
Liberation Sans
12
3
0
0
0
255
255
255
noborder
1
1
LiveGain
8
56
500
27
{2a8dc6e2-12f4-443d-af9b-59e4373cc24b}
true
0
0
0.00000000
1.00000000
0.04000000
lin
continuous
-1.00000000
false
8
110
120
30
{4fa545c6-e2f1-4387-8c9f-4a9dd388bb42}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LoopTime_Value
448
110
60
30
{b0ad1916-b43e-44c2-be40-bca29f5cb1f4}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
LoopTime
8
94
500
27
{9069e547-5638-4568-896f-980087c61de0}
true
0
0
0.00000000
1.00000000
0.44999999
lin
continuous
-1.00000000
false
8
149
120
30
{ada34c8d-83fe-4eae-b207-ac7e38c5251f}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
RvbTime_Value
448
149
60
30
{c333f6de-006b-45d6-bfec-c6a0205b39e8}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
RvbTime
8
133
500
27
{07f985ef-961c-4c4a-b40b-ac266b8e938d}
true
0
0
0.00000000
1.00000000
0.66000003
lin
continuous
-1.00000000
false
8
187
172
33
{aea49d35-076f-4f53-973f-218c07658afd}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Amplitude
448
187
60
30
{e618dde4-1681-4841-ad6b-2f09a0dc7e42}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
Amplitude
8
172
500
27
{d92cf2f2-852e-4c61-ba7a-5211a302ad02}
true
0
0
0.00000000
1.00000000
0.69999999
lin
continuous
-1.00000000
false
87
234
310
136
{ee530a88-06f3-4cd5-a96c-a464731e48b2}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
border
6
2
117
267
255
26
{c8a3e816-11cf-47c8-8600-23600b422825}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
117
256
255
26
{2f03fec8-e47c-4543-acfd-1d310268ca2a}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
114
277
255
26
{c0a9480a-e73e-4cf7-afe4-a557b9d1f47f}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
115
293
255
26
{d2f75b5c-4bdd-44c1-a183-86ae4ae4ae17}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
114
304
255
26
{c7a8c700-44e3-4edc-91b0-325c8d1def90}
true
0
0
center
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1