;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
;my flags on Ubuntu: -iadc -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0
--env:SSDIR+=../../SourceMaterials
sr = 44100 ;SAMPLE RATE
ksmps = 10 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH
giExp1 ftgen 0, 0, 129, -25, 0, 0.25, 128, 4.0 ;TABLE FOR EXP SLIDER
instr 10 ;GUI
ktrig metro 10
if (ktrig == 1) then
gkloopstart invalue "LoopStart"
gkloopend invalue "LoopEnd"
kpitch invalue "Pitch"
gkpitch tablei kpitch, giExp1, 1
outvalue "Pitch_Value", gkpitch
gkcrossfade invalue "Crossfade"
gkstart invalue "StartPos"
gkamp invalue "Amplitude"
gkmode invalue "LoopMode"
endif
endin
instr 1
Sfile_new strcpy "" ;INIT TO EMPTY STRING
Sfile invalue "_Browse"
Sfile_old strcpyk Sfile_new
Sfile_new strcpyk Sfile
kfile strcmpk Sfile_new, Sfile_old
kSwitch changed gkstart, gkmode, kfile ;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:
ifn ftgentmp 0, 0, 0, 1, Sfile,0,0,1 ;READ MONO OR STEREO AUDIO FILE CHANNEL 1
ifilelength = nsamp(ifn)/sr
kloopstart = ifilelength*gkloopstart
kloopend = ifilelength*gkloopend
istart = ifilelength*i(gkstart)
asig flooper2 gkamp, gkpitch, kloopstart, kloopend, gkcrossfade, ifn, istart, i(gkmode);, ifenv, iskip
rireturn ;RETURN FROM REINITIALISATION PASS TO PERFORMANCE TIME PASSES
outs asig, asig
endin
instr 11 ;INIT
outvalue "LoopStart" , 0
outvalue "LoopEnd" , 1
outvalue "Pitch" , 0.5
outvalue "Crossfade" , .001
outvalue "StartPos" , 0
outvalue "Amplitude" , 0.5
outvalue "LoopMode" , 0
endin
i 10 0 3600 ;GUI
i 11 0 0.01 ;INIT
72
179
400
200
true
202
202
202
2
2
512
460
{395a9956-93f5-441f-b0ef-3828f1b2da1c}
true
0
0
center
Liberation Sans
18
3
0
0
0
181
199
255
border
5
2
8
10
100
26
{0a44e1b8-fab4-40c8-8fa1-f1d1d743c45c}
true
0
0
event
1.00000000
On / Off
/
i 1 0 -1
true
false
516
2
362
460
{10e7ae72-c151-4c9d-9f49-e6b1585d8386}
true
0
0
center
Liberation Sans
18
3
0
0
0
181
199
255
border
5
2
518
18
360
438
{97dfe67c-26c1-4af5-b858-e301d6886c2e}
true
0
0
left
Liberation Sans
14
3
0
0
0
255
255
255
noborder
1
1
8
223
100
30
{2c897206-0dbc-47b5-ba68-915d83839ab6}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Pitch
8
206
500
27
{304e78d8-b320-453a-b28f-86b0ca872b86}
true
0
0
0.00000000
1.00000000
0.50000000
lin
continuous
-1.00000000
false
Pitch_Value
448
223
60
30
{94c7e961-7981-4d21-942f-80bcc647daf5}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
270
150
30
{0609a258-bba4-43bb-849c-b8709a47f1ba}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Crossfade
8
253
500
27
{49415594-5e61-46ce-b9f8-3adcf2b957c5}
true
0
0
0.00000000
1.00000000
0.00100000
lin
continuous
-1.00000000
false
Crossfade
448
270
60
30
{6a4ff02e-3d5e-4143-855e-95b4c2614157}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
129
100
30
{feb05e56-b1b1-4494-8c71-ce9e40994fb9}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LoopStart
8
112
500
27
{88f53f0d-44d4-4847-8885-c15e934a8109}
true
0
0
0.00000000
1.00000000
0.00000000
lin
continuous
-1.00000000
false
LoopStart
448
129
60
30
{dd0574f3-9876-4c0e-b747-f61dee837c94}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
176
100
30
{bf3e8a57-4a8a-4a9d-b67d-9521542ae93d}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LoopEnd
8
159
500
27
{8ff8f945-02c5-4ac9-a2e7-f20a8a28a2a5}
true
0
0
0.00000000
1.00000000
1.00000000
lin
continuous
-1.00000000
false
LoopEnd
448
176
60
30
{4b684f89-629e-4f7a-974d-7dd7165f85a7}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
_Browse
180
421
330
28
{15a8ec14-710f-43e6-be9e-f5dc8c8786cb}
true
0
0
left
Liberation Sans
10
3
0
0
0
229
229
229
nobackground
8
364
100
30
{e13ea2b5-66c3-4eae-9c6c-91d9e035400b}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Amplitude
8
347
500
27
{0460f13f-efd6-4403-bc20-c0d21302e628}
true
0
0
0.00000000
1.00000000
0.50000000
lin
continuous
-1.00000000
false
Amplitude
448
364
60
30
{7d2a46b9-3d13-4fc4-8081-50dbb35f8ff4}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
317
150
30
{a842add9-35e8-4567-92ab-8061be1c10f7}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
StartPos
8
300
500
27
{67d5f50b-6ff1-43e9-90bc-2a4968903ba7}
true
0
0
0.00000000
1.00000000
0.00000000
lin
continuous
-1.00000000
false
StartPos
448
317
60
30
{8caaf76d-57ae-4684-8b3a-76e073bfd7d0}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
9
43
100
30
{96001cb0-4be9-4fda-b763-19a295c3cf5e}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LoopMode
9
63
140
30
{776dd151-a24a-431d-bd70-69621a52601a}
true
0
0
forward
0
backward
1
back-and-forth
2
0
false
8
400
100
30
{8de3ea13-9050-4b9d-8b34-9fec61fe4e48}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
_Browse
8
421
170
30
{8c630a69-dc58-46a0-a696-60bc59cec1d6}
true
0
0
value
1.00000000
808loopMono.wav
Browse Audio File
/
false
false