Debian Codegraph @

examples/cpsmidinn.csd

raw
1 <CsoundSynthesizer>
2 ; Prints a table showing the equivalents of all Midi
3 ; note numbers from 0-127 in cycles-per-second,
4 ; octave.decimal, and octave.pitchclass units.
5
6 <CsOptions>
7 ; Select audio/midi flags here according to platform.
8 ; This example produces no audio, so we render in
9 ; non-realtime and turn off sound to disk:
10 -n
11 </CsOptions>
12 <CsInstruments>
13
14 instr 1
15 ; i-time loop to print conversion table
16 imidiNN = 0
17 loop1:
18 icps = cpsmidinn(imidiNN)
19 ioct = octmidinn(imidiNN)
20 ipch = pchmidinn(imidiNN)
21
22 print imidiNN, icps, ioct, ipch
23
24 imidiNN = imidiNN + 1
25 if (imidiNN < 128) igoto loop1
26 endin
27
28 instr 2
29 ; test k-rate converters
30 kMiddleC = 60
31 kcps = cpsmidinn(kMiddleC)
32 koct = octmidinn(kMiddleC)
33 kpch = pchmidinn(kMiddleC)
34
35 printks "%d %f %f %f\n", 1.0, kMiddleC, kcps, koct, kpch
36 endin
37
38 </CsInstruments>
39 <CsScore>
40 i1 0 0
41 i2 0 0.1
42 e
43
44 </CsScore>
45 </CsoundSynthesizer>