2 rhythmic-column-engraver.cc -- implement Rhythmic_column_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "rhythmic-head.hh"
12 #include "note-column.hh"
14 #include "dot-column.hh"
15 #include "pointer-group-interface.hh"
17 #include "translator.icc"
20 this engraver glues together stems, rests and note heads into a NoteColumn
23 It also generates spacing objects. Originally, we have tried to
24 have the spacing functionality at different levels.
26 - by simply using the sequence of Separation-item as
27 spacing-sequences (at staff level). Unfortunately, this fucks up if
28 there are different kinds of tuplets in different voices (8th and
29 8ths triplets combined made the program believe there were 1/12 th
32 Doing it in a separate engraver using timing info is generally
33 complicated (start/end time management), and fucks up if a voice
36 Now we do it from here again. This has the problem that voices can
37 appear and disappear at will, leaving lots of loose ends (the note
38 spacing engraver don't know where to connect the last note of the
39 voice on the right with), but we don't complain about those, and let
40 the default spacing do its work.
43 class Rhythmic_column_engraver
: public Engraver
45 vector
<Grob
*> rheads_
;
51 TRANSLATOR_DECLARATIONS (Rhythmic_column_engraver
);
54 DECLARE_ACKNOWLEDGER (stem
);
55 DECLARE_ACKNOWLEDGER (rhythmic_head
);
56 DECLARE_ACKNOWLEDGER (arpeggio
);
57 void process_acknowledged ();
58 void stop_translation_timestep ();
61 Rhythmic_column_engraver::Rhythmic_column_engraver ()
71 Rhythmic_column_engraver::process_acknowledged ()
76 note_column_
= make_item ("NoteColumn", rheads_
[0]->self_scm ());
78 for (vsize i
= 0; i
< rheads_
.size (); i
++)
79 if (!rheads_
[i
]->get_parent (X_AXIS
))
80 Note_column::add_head (note_column_
, rheads_
[i
]);
88 && !stem_
->get_parent (X_AXIS
))
90 Note_column::set_stem (note_column_
, stem_
);
95 note_column_
->set_object ("arpeggio", arpeggio_
->self_scm ());
100 Rhythmic_column_engraver::acknowledge_stem (Grob_info i
)
106 Rhythmic_column_engraver::acknowledge_rhythmic_head (Grob_info i
)
108 rheads_
.push_back (i
.grob ());
112 Rhythmic_column_engraver::acknowledge_arpeggio (Grob_info i
)
114 arpeggio_
= i
.grob ();
118 Rhythmic_column_engraver::stop_translation_timestep ()
125 ADD_ACKNOWLEDGER (Rhythmic_column_engraver
, stem
);
126 ADD_ACKNOWLEDGER (Rhythmic_column_engraver
, rhythmic_head
);
127 ADD_ACKNOWLEDGER (Rhythmic_column_engraver
, arpeggio
);
129 ADD_TRANSLATOR (Rhythmic_column_engraver
,
131 "Generate @code{NoteColumn}, an object that groups stems,"
132 " note heads, and rests.",