1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac -Ma ;;;realtime audio out and midi in (on all inputs)
;-iadc ;;;uncomment -iadc if RT audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o max_k.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
FLpanel "This Panel contains VU-meter",300,100
gk1,gih1 FLslider "VU-meter", 0,1,0,1, -1, 250,30, 30,30
FLsetColor2 50, 50, 255, gih1
FLpanel_end
FLrun
ga1 init 0
instr 1
kenv linsegr 0,.5,.7,.5,.5,.2,0
ifreq cpsmidi
a1 poscil 0dbfs*kenv, ifreq, 1
ga1 = ga1+a1
endin
instr 2
outs ga1, ga1
ktrig metro 25 ;refresh 25 times per second
kval max_k ga1, ktrig, 1
FLsetVal ktrig, kval, gih1
ga1 = 0
endin
</CsInstruments>
<CsScore>
f1 0 1024 10 1
i2 0 3600
f0 3600
e
</CsScore>
</CsoundSynthesizer>
|