5 #include "paper-def.hh"
7 //#include "clef-reg.hh"
10 const int FLAT_TOP_PITCH
=2; /* fes,ges,as and bes typeset in lower octave */
11 const int SHARP_TOP_PITCH
=4; /* ais and bis typeset in lower octave */
15 Key_item::Key_item(int c
)
21 Key_item::read(const Key_register
& key_reg_r
)
23 const Array
<int> &idx_arr
=key_reg_r
.accidental_idx_arr_
;
24 for (int i
= 0 ; i
< idx_arr
.size(); i
++) {
25 int note
= idx_arr
[i
];
26 int acc
= key_reg_r
.key_
.acc(note
);
33 Key_item::set_c_position(int c0
)
35 int octaves
=(abs(c0
) / 7) +1 ;
36 c_position
=(c0
+ 7*octaves
)%7;
41 Key_item::add(int p
, int a
)
43 if ((a
<0 && p
>FLAT_TOP_PITCH
) ||
44 (a
>0 && p
>SHARP_TOP_PITCH
)) {
45 p
-= 7; /* Typeset below c_position */
53 Key_item::brew_molecule_p()const
55 Molecule
*output
= new Molecule
;
56 Real inter
= paper()->internote();
58 for (int i
=0; i
< pitch
.size(); i
++) {
59 Symbol s
= paper()->lookup_p_
->accidental(acc
[i
]);
61 a
.translate(Offset(0,(c_position
+ pitch
[i
]) * inter
));
65 Molecule
m(paper()->lookup_p_
->fill(Box(
66 Interval(0, paper()->note_width()),