2 key.cc -- implement Key, Octave_key
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
15 const int OCTAVES
=14; // ugh..
16 const int ZEROOCTAVE
=7;
20 Octave_key::print () const
22 for (int i
= 0; i
< 7 ; i
++)
23 DOUT
<< "note " << i
<< " acc: " << accidental_i_arr_
[i
] << "\n";
28 Octave_key::Octave_key()
30 accidental_i_arr_
.set_size (7);
37 for (int i
= 0; i
< 7 ; i
++)
38 accidental_i_arr_
[i
] = 0;
43 multi_octave_b_
= false;
44 octaves
.set_size (OCTAVES
);
50 return octaves
[i
+ZEROOCTAVE
];
55 Octave_key::set (int i
, int a
)
57 assert (a
> -3 && a
< 3);
58 accidental_i_arr_
[i
]=a
;
62 Key::set (int o
, int n
, int a
)
64 octaves
[o
+ ZEROOCTAVE
].set (n
,a
);
68 Key::set (int n
, int a
)
70 for (int i
= 0; i
< OCTAVES
; i
++)
76 for (int i
= 0; i
< OCTAVES
; i
++)
82 for (int i
= 0; i
< OCTAVES
; i
++)
84 DOUT
<< "octave " << i
- ZEROOCTAVE
<< " Octave_key { ";