+2005-04-21 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * input/regression/grid-lines.ly (Module): new file.
+
+ * lily/grid-point-engraver.cc (Module): new file
+
+ * lily/grid-line.cc (Module): new file.
+
+ * lily/grid-line-span-engraver.cc (Module): new file.
+
+ * lily/grid-line-interface.cc (Module): new file.
+
2005-04-21 Jan Nieuwenhuizen <janneke@gnu.org>
* scm/auto-beam.scm (revert-property-setting): Bugfixes: add
2005-04-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
* python/fontextract.py (write_extracted_fonts): bugfix, too many
- %'s.
+ %'s on EndFont comment.
* lily/ledger-line-spanner.cc: some more words of explanation.
@Article {haken93,
- note = {A description of Lime internals (which resemble older (before 0.0.68pre) LilyPond data structures) HWN},
year = {1993},
title = {The Tilia Music Representation: Extensibility, Abstraction, and Notation Contexts for the Lime Music Editor},
author = {Lippold Haken and Dorothea Blostein},
@finalout
@titlepage
-@title GNU LilyPond
+@title LilyPond
@subtitle The music typesetter
@author The LilyPond development team
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=5
-PATCH_LEVEL=20
+PATCH_LEVEL=21
MY_PATCH_LEVEL=
--- /dev/null
+\header
+{
+
+ texidoc = "With grid lines, vertical lines can be drawn between
+staves synchronized with the notes."
+
+}
+\version "2.5.21"
+
+skips =
+{
+\time 12/8
+\once \override Score.GridLine #'thickness = #4.0
+ s8
+ s8
+ s8
+\once \override Score.GridLine #'thickness = #2.0
+ s8
+ s8
+ s8
+\once \override Score.GridLine #'thickness = #4.0
+ s8
+ s8
+ s8
+\once \override Score.GridLine #'thickness = #2.0
+ s8
+ s8
+ s8
+}
+
+
+\layout {
+ \context {
+ \Staff
+ \consists "Grid_point_engraver"
+
+ }
+
+ \context {
+ \RhythmicStaff
+ \consists "Grid_point_engraver"
+ gridInterval = #(ly:make-moment 1 8)
+ \override BarLine #'bar-size = #0.05
+}
+ \context {
+ \StaffGroup
+ \remove "System_start_delimiter_engraver"
+ }
+}
+
+\new Score
+\with {
+ \consists "Grid_line_span_engraver"
+ \override SystemStartBrace #'transparent = ##t
+ \override TimeSignature #'transparent = ##t
+
+ \override NoteColumn #'X-offset-callbacks = #(list (lambda (x a) -0.5))
+ \override NoteColumn #'Y-offset-callbacks = #(list (lambda (x a) 0.25))
+
+}
+\new StaffGroup <<
+ \new Staff {
+ \repeat unfold 12 { c''8 }
+ }
+ \new RhythmicStaff \skips
+ \new RhythmicStaff \skips
+>>
+
--- /dev/null
+/*
+ grid-line-interface.cc -- implement Grid_line_interface
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include "group-interface.hh"
+#include "output-def.hh"
+#include "stencil.hh"
+#include "lookup.hh"
+#include "grid-line-interface.hh"
+#include "grob.hh"
+
+
+MAKE_SCHEME_CALLBACK (Grid_line_interface, print, 1);
+SCM
+Grid_line_interface::print (SCM smobbed_me)
+{
+ Grob *me = unsmob_grob (smobbed_me);
+ SCM first_elt = me->get_property ("elements");
+
+ /* compute common refpoint of elements */
+ Grob *refp = common_refpoint_of_list (first_elt, me, Y_AXIS);
+ Interval iv;
+
+ for (SCM elts = first_elt; scm_is_pair (elts); elts = scm_cdr (elts))
+ {
+ Grob *point = unsmob_grob (scm_car (elts));
+
+ iv.unite (point->extent (refp, Y_AXIS));
+ }
+
+ if (iv.is_empty ())
+ {
+ me->suicide ();
+ return SCM_EOL;
+ }
+
+ Real staffline = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real thick = robust_scm2double (me->get_property ("thickness"), 1.0)
+ * staffline;
+
+
+ iv += - me->relative_coordinate (refp, Y_AXIS);
+ Stencil st = Lookup::filled_box (Box (Interval (0, thick),
+ iv));
+
+ return st.smobbed_copy ();
+}
+
+void
+Grid_line_interface::add_grid_point (Grob *me, Grob *b)
+{
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), b);
+ me->add_dependency (b);
+}
+
+ADD_INTERFACE (Grid_line_interface, "grid-line-interface",
+ "A line that spanned between grid-points. ",
+ "elements thickness");
+
--- /dev/null
+/*
+ grid-line-span-engraver.cc -- implement Grid_line_span_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include "engraver.hh"
+#include "item.hh"
+#include "grid-line-interface.hh"
+
+class Grid_line_span_engraver : public Engraver
+{
+ Item *spanline_;
+ Link_array<Item> lines_;
+
+public:
+ TRANSLATOR_DECLARATIONS (Grid_line_span_engraver);
+protected:
+ virtual void acknowledge_grob (Grob_info);
+ virtual void stop_translation_timestep ();
+};
+
+Grid_line_span_engraver::Grid_line_span_engraver ()
+{
+ spanline_ = 0;
+}
+
+void
+Grid_line_span_engraver::acknowledge_grob (Grob_info i)
+{
+ int depth = i.origin_contexts (this).size ();
+ if (depth && i.grob_->internal_has_interface (ly_symbol2scm ("grid-point-interface")))
+ {
+ Item *it = dynamic_cast<Item *> (i.grob_);
+ lines_.push (it);
+
+ if (lines_.size () >= 2 && !spanline_)
+ {
+ spanline_ = make_item ("GridLine", SCM_EOL);
+ spanline_->set_parent (lines_[0], X_AXIS);
+ }
+ }
+}
+
+void
+Grid_line_span_engraver::stop_translation_timestep ()
+{
+ if (spanline_)
+ {
+ for (int i = 0; i < lines_.size (); i++)
+ Grid_line_interface::add_grid_point (spanline_, lines_[i]);
+
+ spanline_ = 0;
+ }
+ lines_.set_size (0);
+}
+
+ADD_TRANSLATOR (Grid_line_span_engraver,
+ /* descr */ "This engraver makes cross-staff linelines: It catches all normal "
+ "line lines, and draws a single span-line across them.",
+ /* creats*/ "GridLine",
+ /* accepts */ "",
+ /* acks */ "grid-point-interface",
+ /* reads */ "",
+ /* write */ "");
--- /dev/null
+/*
+ grid-line-engraver.cc -- implement Grid_point_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+*/
+
+#include "engraver.hh"
+#include "item.hh"
+
+class Grid_point_engraver : public Engraver
+{
+public:
+ TRANSLATOR_DECLARATIONS (Grid_point_engraver);
+protected:
+ virtual void process_music ();
+};
+
+void
+Grid_point_engraver::process_music ()
+{
+ SCM grid_interval = get_property ("gridInterval");
+ if (Moment *mom = unsmob_moment (grid_interval))
+ {
+ Moment now = now_mom ();
+
+ if (!now.main_part_.mod_rat (mom->main_part_))
+ {
+ Item * it = make_item ("GridPoint", SCM_EOL);
+ }
+ }
+}
+
+Grid_point_engraver::Grid_point_engraver ()
+{
+}
+
+ADD_TRANSLATOR (Grid_point_engraver,
+ /* descr */ "generate grid points.",
+ /* creats*/ "GridPoint",
+ /* accepts */ "",
+ /* acks */ "",
+ /* reads */ "gridInterval",
+ /* write */ "");
+
protected:
virtual bool try_music (Music *ev);
virtual void process_music ();
-
virtual void stop_translation_timestep ();
};
{
for (int i = 0; i < note_evs_.size (); i++)
{
-
Music *ev = note_evs_[i];
Item *note = make_item ("NoteHead", ev->self_scm ());
(graceSettings ,list?
"Overrides for grace notes. This property should
be manipulated through the @code{add-grace-property} function.")
+ (gridInterval ,ly:moment?
+ "Interval for which to generate @ref{GridPoint}s")
(currentCommandColumn ,ly:grob? "Grob that is X-parent to all
current breakable (clef, key signature, etc.) items.")
(currentMusicalColumn ,ly:grob? "Grob that is X-parent to all
(break-align-symbol . staff-bar)
(glyph . "|")
(break-glyph-function . ,default-break-barline)
+ (layer . 0)
(bar-size-procedure . ,Bar_line::get_staff_bar_size)
(print-function . ,Bar_line::print)
(break-visibility . ,all-visible)
(meta . ((interfaces . (line-interface line-spanner-interface spanner-interface))))
))
+ (GridPoint
+ . (
+ (X-extent . (0 . 0))
+ (Y-extent . (0 . 0))
+ (meta . ((interfaces . (grid-point-interface))))
+ ))
+
+ (GridLine
+ . (
+ (print-function . ,Grid_line_interface::print)
+ (X-extent . (0 . 0))
+ (layer . 0)
+ (meta . ((interfaces . (grid-line-interface)))
+ )))
+
+
(Hairpin
. (
(print-function . ,Hairpin::print)
(print-function . ,Span_bar::print)
(X-extent-callback . ,Span_bar::width_callback)
(Y-extent-callback . ())
+ (layer . 0)
(breakable . #t)
(before-line-breaking-callback . ,Span_bar::before_line_breaking)
;; ugh duplication!