2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "engraver.hh"
22 #include "staff-symbol-referencer.hh"
23 #include "note-head.hh"
24 #include "rhythmic-head.hh"
27 class Pitch_squash_engraver : public Engraver
30 TRANSLATOR_DECLARATIONS (Pitch_squash_engraver);
31 DECLARE_ACKNOWLEDGER (note_head);
35 Pitch_squash_engraver::acknowledge_note_head (Grob_info i)
37 SCM newpos = get_property ("squashedPosition");
38 if (scm_is_number (newpos))
39 i.grob ()->set_property ("staff-position", newpos);
42 Pitch_squash_engraver::Pitch_squash_engraver ()
46 #include "translator.icc"
47 ADD_ACKNOWLEDGER (Pitch_squash_engraver, note_head);
48 ADD_TRANSLATOR (Pitch_squash_engraver,
50 "Set the vertical position of note heads to"
51 " @code{squashedPosition}, if that property is set. This can"
52 " be used to make a single-line staff demonstrating the"
53 " rhythm of a melody.",