2005-04-21 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * input/regression/grid-lines.ly (skips): refine example.
+
+ * scm/define-context-properties.scm
+ (all-user-translation-properties): doc autoBeamCheck
+
* input/regression/grid-lines.ly (Module): new file.
* lily/grid-point-engraver.cc (Module): new file
@itemize @bullet
+@item
+Grid lines
+
@item
Lines, such as glissandi or Text-spanner lines, can have arrows at the
end, e.g.
}
}
+\layout {
+ raggedright = ##t
+}
\new Score
\with {
\consists "Grid_line_span_engraver"
\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))
+ \override NoteHead #'Y-offset-callbacks = #(list (lambda (x a) 0.75))
}
\new StaffGroup <<
- \new Staff {
- \repeat unfold 12 { c''8 }
+ \new RhythmicStaff \with
+ {
+ \override NoteHead #'no-ledgers = ##t
+ }
+ {
+ \stemUp
+ c4. c8 c8 c c4 c8 c8.[ c16 c8]
+ }
+ \new RhythmicStaff
+ {
+ \override NoteHead #'transparent = ##t
+ \override NoteHead #'no-ledgers = ##t
+ \override Stem #'transparent = ##t
+ \override Beam #'transparent = ##t
+ << \skips
+
+ % force regular spacing by introducing notes.
+ \repeat unfold 12 c8
+ >>
}
- \new RhythmicStaff \skips
- \new RhythmicStaff \skips
+
>>
return st.smobbed_copy ();
}
+MAKE_SCHEME_CALLBACK (Grid_line_interface, width_callback, 2);
+SCM
+Grid_line_interface::width_callback (SCM element_smob, SCM scm_axis)
+{
+ Grob *me = unsmob_grob (element_smob);
+ (void) scm_axis;
+ assert (scm_to_int (scm_axis) == X_AXIS);
+
+ Real staffline = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness"));
+ Real thick = robust_scm2double (me->get_property ("thickness"), 1.0)
+ * staffline;
+
+ return ly_interval2scm (Interval (0, thick));
+}
+
void
Grid_line_interface::add_grid_point (Grob *me, Grob *b)
{
"A line that spanned between grid-points. ",
"elements thickness");
+
+ADD_INTERFACE (Grid_point_interface, "grid-point-interface",
+ "A spanning point for grid lines. ",
+ "");
+
lasts forever.
@end table
")
+ (autoBeamCheck ,procedure? "Routine taking two arguments,
+start/stop (-1 or 1) and shortest note in the beam.")
(autoBeaming ,boolean? "If set to true then beams are generated
automatically.")
are still counted. Bar generation will resume according to that count
if this property is unset.
")
-
+
(barAlways ,boolean? "If set to true a bar line is drawn after each
note.")
(forceClef ,boolean? "Show clef symbol, even if it has not
changed. Only active for the first clef after the property is set, not
for the full staff.")
+ (gridInterval ,ly:moment?
+ "Interval for which to generate @ref{GridPoint}s")
(harmonicAccidentals ,boolean? "If set, harmonic notes in chords
get accidentals.")
(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
(GridLine
. (
(print-function . ,Grid_line_interface::print)
- (X-extent . (0 . 0))
+ (X-extent-callback . ,Grid_line_interface::width_callback)
(layer . 0)
(meta . ((interfaces . (grid-line-interface)))
)))
-
(Hairpin
. (
(print-function . ,Hairpin::print)
(prepend-alist-chain 'font-size mag props)
arg))
+
+;; FIXME -> should convert to font-size.
(def-markup-command (magnify layout props sz arg) (number? markup?)
"Set the font magnification for the its argument. In the following
example, the middle A will be 10% larger: