Debian Codegraph @

examples/ntof.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 --nosound
4 </CsOptions>
5 <CsInstruments>
6
7 /*
8
9 Example for ntof: notename to frequency
10
11 A notename is a string of the form
12
13 <octave><pitchclass>[cents]
14
15 Example notenames are:
16
17 "4A" -> A in the 4th octave
18 "5C+31" -> C5, 31 cents higher
19 "4Db-13" -> D flat, 4th octave, 13 cents lower
20 "7F#+" -> F# quarter tone higher
21 "5G-" -> G5 a quarter tone lower
22
23 NB: the frequency returned by ntof depends on the value of A4
24
25 */
26
27 A4 = 442
28
29 instr 1
30 ifreq ntof "4A"
31 print ifreq
32
33 koctave = 1
34 while (koctave <= 8) do
35 Snote sprintfk "%dC", koctave
36 kfreq ntof Snote
37 printf "notename: %s freq: %.2f \n", koctave, Snote, kfreq
38 koctave += 1
39 od
40
41 turnoff
42 endin
43
44 </CsInstruments>
45 <CsScore>
46
47 i 1 0 1
48
49 </CsScore>
50 </CsoundSynthesizer>