2 pitch-squash-engraver.cc -- implement Pitch_squash_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
8 #include "staff-symbol-referencer.hh"
9 #include "note-head.hh"
10 #include "rhythmic-head.hh"
11 #include "engraver.hh"
13 class Pitch_squash_engraver : public Engraver
16 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
17 DECLARE_ACKNOWLEDGER (note_head);
21 Pitch_squash_engraver::acknowledge_note_head (Grob_info i)
23 SCM newpos = get_property ("squashedPosition");
24 if (scm_is_number (newpos))
25 i.grob ()->set_property ("staff-position", newpos);
28 Pitch_squash_engraver::Pitch_squash_engraver ()
32 #include "translator.icc"
33 ADD_ACKNOWLEDGER (Pitch_squash_engraver, note_head);
34 ADD_TRANSLATOR (Pitch_squash_engraver,
36 "Set the vertical position of noteheads to "
37 "@code{squashedPosition}, if that "
39 "This can be used to make a single line staff "
40 "demonstrating the rhythm of a melody.",
43 /* read */ "squashedPosition",