2 pitch-squash-engraver.cc -- implement Pitch_squash_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
11 #include "staff-symbol-referencer.hh"
12 #include "note-head.hh"
13 #include "rhythmic-head.hh"
16 class Pitch_squash_engraver
: public Engraver
19 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver
);
20 DECLARE_ACKNOWLEDGER (note_head
);
24 Pitch_squash_engraver::acknowledge_note_head (Grob_info i
)
26 SCM newpos
= get_property ("squashedPosition");
27 if (scm_is_number (newpos
))
28 i
.grob ()->set_property ("staff-position", newpos
);
31 Pitch_squash_engraver::Pitch_squash_engraver ()
35 #include "translator.icc"
36 ADD_ACKNOWLEDGER (Pitch_squash_engraver
, note_head
);
37 ADD_TRANSLATOR (Pitch_squash_engraver
,
39 "Set the vertical position of note heads to"
40 " @code{squashedPosition}, if that property is set. This can"
41 " be used to make a single-line staff demonstrating the"
42 " rhythm of a melody.",