;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
;BOWED BAR PHYSICAL MODEL - RATHER UNSTABLE
;Notes on modifications from original csd:
; Add tables for exp slider
; INIT instrument added
; Removed subinstr opcode in midi instrument 1
;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 CYCLE
nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH
givibfn ftgen 0,0,4096,10,1 ;A SINE WAVE
giExp1 ftgen 0, 0, 129, -25, 0, 20.0, 128, 20000.0 ;TABLE FOR EXP SLIDER
instr 2 ;GUI
ktrig metro 10
if (ktrig == 1) then
gkamp invalue "Amp"
kfreq invalue "Freq"
gkfreq tablei kfreq, giExp1, 1
outvalue "Freq_Value", gkfreq
gkpos invalue "BowPos"
gkbowpres invalue "BowPress"
gkgain invalue "GainFilter"
gkconst invalue "Integ"
gkbowpos invalue "BowPosVel"
gklow invalue "LowFreq"
gktvel invalue "BowVel"
endif
endin
instr 1 ;MIDI INPUT INSTRUMENT
icps cpsmidi ;READ CYCLES PER SECOND VALUE FROM MIDI INPUT
iamp ampmidi 1 ;READ IN A NOTE VELOCITY VALUE FROM THE MIDI INPUT
kSwitch changed gkconst, gktvel, gkbowpos, gklow
if kSwitch=1 then ;IF I-RATE VARIABLE CHANGE TRIGGER IS '1'...
reinit UPDATE ;BEGIN A REINITIALISATION PASS FROM LABEL 'UPDATE'
endif
UPDATE:
abowedbar wgbowedbar iamp, icps, gkpos, gkbowpres, gkgain, i(gkconst), i(gktvel), i(gkbowpos), i(gklow)
rireturn ;RETURN FROM REINITIALISATION PASS TO PERFORMANCE TIME PASSES
aenv linsegr 1, 0.05, 0 ;ANTI-CLICK ENVELOPE
outs abowedbar * aenv, abowedbar * aenv
endin
instr 3 ;wgbowedbar INSTRUMENT
kSwitch changed gkconst, gktvel, gkbowpos, gklow
if kSwitch=1 then ;IF I-RATE VARIABLE CHANGE TRIGGER IS '1'...
reinit UPDATE ;BEGIN A REINITIALISATION PASS FROM LABEL 'UPDATE'
endif
UPDATE:
abowedbar wgbowedbar gkamp, gkfreq, gkpos, gkbowpres, gkgain, i(gkconst), i(gktvel), i(gkbowpos), i(gklow)
rireturn ;RETURN FROM REINITIALISATION PASS TO PERFORMANCE TIME PASSES
aenv linsegr 1, 0.05, 0 ;ANTI-CLICK ENVELOPE
outs abowedbar * aenv, abowedbar * aenv
endin
instr 4 ;INIT
outvalue "Amp" , 0.3
outvalue "Freq" , 0.4337
outvalue "BowPos" , .7
outvalue "BowPress" , 3
outvalue "GainFilter" , .95
outvalue "Integ" , 0.2
outvalue "BowVel" , 0
outvalue "BowPosVel" , 0
outvalue "LowFreq" , 0
endin
;INSTR | START | DURATION
i 2 0 3600 ;GUI
i 4 0 0.1 ;INIT
879
220
800
406
true
241
226
185
2
2
511
400
{aa607456-d368-4d59-8497-d16d608404c3}
true
0
0
center
Liberation Sans
18
3
0
0
0
147
154
255
border
5
2
8
71
220
30
{640b50b7-7200-4f81-8394-89d9843ae939}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Amp
8
54
500
27
{5585fa6f-0f63-4ac3-bf1b-809c2b1d9134}
true
0
0
0.00000000
1.00000000
0.30000001
lin
continuous
-1.00000000
false
Amp
448
71
60
30
{b731b52e-e14a-476a-a583-f3b2bd885539}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
106
220
30
{989564b0-b237-4c22-9d10-b76b7c7e4e4c}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Freq
8
89
500
27
{84cd664e-fb67-4dd4-aac3-adbcf2c81fe6}
true
0
0
0.00000000
1.00000000
0.43370000
lin
continuous
-1.00000000
false
Freq_Value
448
106
60
30
{ba8682a6-056f-4432-946b-4e3ee82c47a1}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
140
200
30
{76044785-79c4-4202-b7ce-07aee4868219}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
BowPos
8
123
500
27
{0f952e77-ff9b-4621-b1af-23252bb9c2a6}
true
0
0
0.00000000
1.00000000
0.69999999
lin
continuous
-1.00000000
false
BowPos
448
140
60
30
{7b92c0ca-2fe8-4b4f-9ed0-f618c1b3cb5c}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
175
220
30
{ca41878c-b561-486b-9cf9-d0da6b48448b}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
BowPress
8
158
500
27
{2800fb88-347a-402c-88ed-fc97af6a36be}
true
0
0
1.00000000
5.00000000
3.00000000
lin
continuous
-1.00000000
false
BowPress
448
175
60
30
{5d1ba94c-536a-4178-be6c-c0d9d2f75e3d}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
210
220
30
{cdd71125-b224-471a-9c41-9c05d8d28d0c}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
GainFilter
8
193
500
27
{7a83bb1f-f25d-47e0-bf2d-9c5c86e0756b}
true
0
0
0.80000000
2.00000000
0.94999999
lin
continuous
-1.00000000
false
GainFilter
448
210
60
30
{7f8d2709-bf8c-46ab-83f0-36fc620b0d56}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
515
2
280
400
{74928ed2-b701-4668-9a11-74763d317e9b}
true
0
0
center
Liberation Sans
18
3
0
0
0
147
154
255
border
5
2
516
25
277
319
{d4bdb5ce-87d8-4c8c-9c64-40ec2eed6f5a}
true
0
0
left
Liberation Sans
14
3
0
0
0
255
255
255
noborder
1
1
8
16
120
30
{04d44ebe-12eb-4bb0-a3f5-9e4fd3e7830e}
true
0
0
event
1.00000000
On / Off (MIDI)
/
i 3 0 -1
true
false
8
246
220
30
{ca67a321-de0d-4a0f-8efd-864d9a51098c}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
Integ
8
229
500
27
{0341fedb-6323-4661-b4c3-8207291fcd90}
true
0
0
-1.00000000
1.00000000
0.20000000
lin
continuous
-1.00000000
false
Integ
448
246
60
30
{3c428724-1329-4e7c-bdb5-6e1277f3c2ce}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
BowVel
227
276
120
30
{d58c4129-6a07-4314-a22f-061a5078f4d6}
true
0
0
ADSR
0
Exponential
1
0
false
127
280
100
30
{acbcf200-59bd-4166-9e83-baebdb8af341}
true
0
0
right
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
8
332
220
30
{7dcb17c9-95c2-49f1-8ab5-b4d051a992f3}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
BowPosVel
8
315
500
27
{425f3e46-5220-46e0-b7a4-b5870b5bf6e2}
true
0
0
-1.00000000
1.00000000
0.00000000
lin
continuous
-1.00000000
false
BowPosVel
448
332
60
30
{7fe8fbf7-c39f-4e4b-b61e-359b230422b3}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1
8
368
220
30
{c80ee61d-1bc9-421c-98f7-c161712528b3}
true
0
0
left
Liberation Sans
10
3
0
0
0
255
255
255
noborder
1
1
LowFreq
8
351
500
27
{b85e90b9-8ce7-4088-ae01-027e8f281a5e}
true
0
0
0.00000000
2000.00000000
0.00000000
lin
continuous
-1.00000000
false
LowFreq
448
368
60
30
{7a5c8e8d-4e02-4387-8a12-62ded58bf8da}
true
0
0
right
Liberation Sans
9
3
0
0
0
255
255
255
noborder
1
1