lilypond-1.1.13
[lilypond.git] / src / key.cc
blob7e23464ccfec917464e06d63eeaad6f3219dca28
1 #include "key.hh"
3 const int OCTAVES=14; // ugh..
4 const int ZEROOCTAVE=7;
6 Key::Key()
8 accidental_i_arr_.set_size(7);
9 for (int i= 0; i < 7 ; i++)
10 accidental_i_arr_[i] = 0;
13 Local_key::Local_key()
15 octaves.set_size(OCTAVES);
18 Key&
19 Local_key::oct(int i)
21 return octaves[i+ZEROOCTAVE];
24 void
25 Key::set(int i, int a)
27 assert(a > -3 && a < 3);
28 accidental_i_arr_[i]=a;
32 void
33 Local_key::reset(Key k)
35 for (int i= 0; i < OCTAVES ; i++)
36 octaves[i] = k;