Debian Codegraph @

examples/cpumeter.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o cpumeter.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 1
14 0dbfs = 1
15
16
17 instr 1 ;cpu metering; stop when too large
18 k0 cpumeter 0.1
19 printk2 k0
20 if k0>70 then
21 event "i", 3, 0.1, 1
22 endif
23 endin
24
25 instr 2
26 event_i "i", 2, 1, 1000
27 asig oscil 0.2, 440, 1
28 out asig
29 endin
30
31 instr 3
32 exitnow
33 endin
34 </CsInstruments>
35 <CsScore>
36 f 1 0 32768 10 1 ; sine wave
37
38 i 1 0 1000
39 i 2 0 1000
40 e
41 </CsScore>
42 </CsoundSynthesizer>