]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/grid-lines.ly (skips): refine example.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 21 Apr 2005 15:59:44 +0000 (15:59 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 21 Apr 2005 15:59:44 +0000 (15:59 +0000)
* scm/define-context-properties.scm
(all-user-translation-properties): doc autoBeamCheck

* input/regression/grid-lines.ly (Module): new file.

* lily/grid-line-interface.cc (Module): new file.

ChangeLog
Documentation/topdocs/NEWS.tely
input/regression/grid-lines.ly
lily/grid-line-interface.cc
scm/define-context-properties.scm
scm/define-grobs.scm
scm/define-markup-commands.scm

index b2cee1c5b82e481d7bb55fbef63f4c5ca73d963b..82043c74217987451762444b925aae1974635fbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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
index ba7b855b6e40096140bc41c5b5089cf4a9707114..a100911c7518551e7f5645873b15f0416552bad8 100644 (file)
@@ -33,6 +33,9 @@ See user manual, \NAME\
 
 @itemize @bullet
 
+@item
+Grid lines 
+
 @item
 Lines, such as glissandi or Text-spanner lines, can have arrows at the
 end, e.g.
index 05279d4b55c57ae68040cdd673d0a8ee612c3af1..e6b5a1dc4a28892c19759aa115bd3aff0db242a6 100644 (file)
@@ -48,6 +48,9 @@ skips =
   }
 }
 
+\layout {
+  raggedright = ##t
+}
 \new Score 
 \with {
   \consists "Grid_line_span_engraver"
@@ -55,14 +58,30 @@ skips =
   \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
+    
 >>
   
index 47d8b58587e372e64c7b5383dd6a8a534464d818..c721190e0e94881abfcafcc17106cb09aa16ce7d 100644 (file)
@@ -51,6 +51,21 @@ Grid_line_interface::print (SCM smobbed_me)
   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)
 {
@@ -62,3 +77,8 @@ ADD_INTERFACE (Grid_line_interface, "grid-line-interface",
               "A  line that spanned between grid-points. ",
               "elements thickness");
 
+
+ADD_INTERFACE (Grid_point_interface, "grid-point-interface",
+              "A spanning point for grid lines. ",
+              "");
+
index 497d0d6e9f9b21da255c9d7ef7a24348c3fa9463..c6ad8a828ecd67b3c52ef28b02589b0cfd43af32 100644 (file)
@@ -72,6 +72,8 @@ immediately, and if @var{laziness} is @code{#t} then the accidental
 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.")
 
@@ -86,7 +88,7 @@ printed automatically; they must be explicitly created with
 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.")
 
@@ -210,6 +212,8 @@ fingered.")
      (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.")
@@ -453,8 +457,6 @@ top of those automatically detected. ")
      (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
index d00feae8cd2686e30a5e150af919cacf7828ddc7..2df163e93fd7373b8803fd4d94bade53ede860ec 100644 (file)
     (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)
index 561514f1f3666627dca064c885708d743d275baa..09364bcc7430b38f24dcb68b3c2c2e98ecdb8ee3 100644 (file)
@@ -304,6 +304,8 @@ This will enlarge the B and the C by two steps.
    (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: