;Written by Iain McCurdy, 2006
;Modified for QuteCsound by René, March 2011
;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
;Notes on modifications from original csd:
; Add tables for exp slider
; INIT instrument added
;my flags on Ubuntu: -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=alsa -Ma -m0
sr = 44100 ;SAMPLE RATE
ksmps = 100 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL
nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH
giExp1 ftgen 0, 0, 129, -25, 0, 1.0, 128, 20000.0 ;TABLE FOR EXP SLIDER
instr 10 ;GUI and SYNCHRONIZE MIDI MOD. WHEEL AND GUI 'Vibrato Amplitude' SLIDER
ktrig metro 10
if (ktrig == 1) then
gkamp invalue "Amplitude"
kcps invalue "Frequency"
gkcps tablei kcps, giExp1, 1
outvalue "Frequency_Value", gkcps
kantcps invalue "FreqBuffer"
gkantcps tablei kantcps, giExp1, 1
outvalue "FreqBuffer_Value", gkantcps
gkparm1 invalue "Parameter1"
gkparm2 invalue "Parameter2"
kmeth invalue "DecayType"
gkmeth = kmeth + 1
gkfn invalue "InitBuffer"
endif
endin
instr 1 ;MIDI ACTIVATED INSTRUMENT
ioct octmidi ;READ NOTE VALUES FROM MIDI INPUT IN THE 'OCT' FORMAT
;PITCH BEND INFORMATION IS READ
iSemitoneBendRange = 2 ;PITCH BEND RANGE IN SEMITONES (WILL BE DEFINED FURTHER LATER)
imin = 0 ;EQUILIBRIUM POSITION
imax = iSemitoneBendRange * .0833333 ;MAX PITCH DISPLACEMENT (IN oct FORMAT)
kbend pchbend imin, imax ;PITCH BEND VARIABLE (IN oct FORMAT)
kcps = cpsoct(ioct + kbend)
aenv linsegr 1,3600,1,0.01,0 ;ANTI-CLICK ENVELOPE
ivel veloc 0, 1 ;DERIVE A MIDI VELOCITY VALUE WITHIN THE RANGE 0-1
asig pluck gkamp*ivel, kcps, i(gkantcps), i(gkfn), i(gkmeth), i(gkparm1), i(gkparm2)
outs asig*aenv, asig*aenv ;SEND AUDIO TO OUTPUTS
endin
instr 2
asig pluck gkamp, gkcps, i(gkantcps), i(gkfn), i(gkmeth), i(gkparm1), i(gkparm2)
outs asig, asig
endin
instr 3 ;INIT
outvalue "Amplitude" , 0.2
outvalue "Frequency" , 0.605
outvalue "FreqBuffer" , 0.605
outvalue "Parameter1" , 0
outvalue "Parameter2" , 0
outvalue "DecayType" , 0
outvalue "InitBuffer" , 0
endin
f 1 0 4096 7 1 4096 1 ;A WIDE FLAT PULSE WAVEFORM
;INSTR | START | DURATION
i 10 0 3600 ;GUI
i 3 0 0.1 ;INIT
389
204
1032
495
true
241
226
185
2
2
1025
490
{aa607456-d368-4d59-8497-d16d608404c3}
true
0
0
center
Liberation Sans
18
3
0
0
0
147
154
255
border
5
2
8
111
220
30
{640b50b7-7200-4f81-8394-89d9843ae939}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Amplitude
8
90
500
27
{5585fa6f-0f63-4ac3-bf1b-809c2b1d9134}
true
0
0
0.00000000
1.00000000
0.20000000
lin
continuous
-1.00000000
false
Amplitude
448
111
60
30
{b731b52e-e14a-476a-a583-f3b2bd885539}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
4
186
1020
305
{d4bdb5ce-87d8-4c8c-9c64-40ec2eed6f5a}
true
0
0
left
Liberation Sans
14
3
0
0
0
255
255
255
noborder
1
1
8
15
120
30
{04d44ebe-12eb-4bb0-a3f5-9e4fd3e7830e}
true
0
0
event
1.00000000
Pluck !
/
i 2 0 -1
false
false
8
157
220
30
{1fee3c20-99d2-4c60-baa7-669d23492f06}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Frequency
8
136
500
27
{f5ebacc2-9a31-48e3-adb0-3cb090aec444}
true
0
0
0.00000000
1.00000000
0.60500002
lin
continuous
-1.00000000
false
Frequency_Value
448
157
60
30
{221d17eb-f6ee-4286-a97f-e6bc5c0a1749}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
519
64
220
30
{bce7cccd-a303-4a57-af94-fd50cf914991}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
FreqBuffer
519
43
500
27
{aaf82558-9229-4d61-8190-0286f3764e87}
true
0
0
0.00000000
1.00000000
0.60500002
lin
continuous
-1.00000000
false
FreqBuffer_Value
959
64
60
30
{1cd1723d-bcd9-44df-9f08-9d8191f03601}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
519
110
220
30
{0f0e06ef-104c-459c-8a8b-3bf531321341}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Parameter1
519
89
500
27
{4a2f399c-8a7b-40cf-84ab-839e1d7012f5}
true
0
0
0.00000000
1.00000000
0.00000000
lin
continuous
-1.00000000
false
Parameter1
959
110
60
30
{62bd5b38-121f-4382-8c01-02c75edf2237}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
519
156
220
30
{3967c371-a6b0-46ca-a51c-5a44bcad618d}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Parameter2
519
135
500
27
{fa94c4bb-3469-4fbf-9096-f6f7c115eb69}
true
0
0
0.00000000
1.00000000
0.00000000
lin
continuous
-1.00000000
false
Parameter2
959
156
60
30
{1f01b045-b441-4f44-8dfe-884fb64aba2a}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
7
53
99
40
{a7659823-fc33-43c8-a408-afd29bfd16c9}
true
0
0
right
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
InitBuffer
349
51
130
30
{83bc3a2e-75dd-4acc-bb05-fb9d5c32748a}
true
0
0
Random Noise
0
Flat Pulse
1
0
false
249
51
100
40
{af44c209-7da2-4e40-892e-3243f4eab94e}
true
0
0
right
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
DecayType
105
51
180
30
{9a41a81a-5c63-42cb-b5ec-ae4e8f586d62}
true
0
0
Simple Averaging
0
Stretched Averaging
1
Simple Drum
2
Stretched drum
3
Weighted Averaging
4
Recursive Filter
5
0
false