]> git.donarmstrong.com Git - lilypond.git/commitdiff
* Documentation/user/changing-defaults.itely (Page layout): add
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 2 Feb 2005 22:30:46 +0000 (22:30 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 2 Feb 2005 22:30:46 +0000 (22:30 +0000)
doco about systemSeparatorMarkup.

* scm/page-layout.scm (default-page-make-stencil): add-to-page
function.
(default-page-make-stencil): insert system separators.

* scm/define-markup-commands.scm (hcenter): add
(beam): add.

ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/changing-defaults.itely
input/regression/system-separator.ly [new file with mode: 0644]
ly/paper-defaults.ly
ly/titling-init.ly
scm/define-markup-commands.scm
scm/lily-library.scm
scm/output-ps.scm
scm/page-layout.scm

index fe37a94b13375f66eba5f5d54e5681da29907395..f8ca8ec8ddf71d19d03c20a3a25ff2962a8ef177 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-02-02  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * Documentation/user/changing-defaults.itely (Page layout): add
+       doco about systemSeparatorMarkup.
+
+       * scm/page-layout.scm (default-page-make-stencil): add-to-page
+       function.
+       (default-page-make-stencil): insert system separators.
+
+       * scm/define-markup-commands.scm (hcenter): add
+       (beam): add.
+
+2005-02-01  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/output-ps.scm (ez-ball): reinstate ez notation.
+
 2005-02-01  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/main.cc: Spell backend consistently.  Sort options.
index 04dac3947b8813fde790cee721bc3efd58f0dfbc..2c19948ea0e9ea87656cddd8bedc782fd8eb1cfc 100644 (file)
@@ -8,6 +8,10 @@
 
 @itemize @bullet
 
+@item
+Separator slashes may be inserted between systems in a score. See
+@file{input/regression/system-separator.ly} for an example. 
+
 @item
 Locations of errors in the input are now calculated more precisely.
 
index 94686aef34c4bd9b5bc6305ee1335d662264b3bd..a0ab14bff67c241ab022eee00430e2e7eec085a2 100644 (file)
@@ -1914,6 +1914,22 @@ title of the next.
 Amount of space between consecutive titles (e.g., the title of the
 book and the title of a piece).
 
+@item systemSeparatorMarkup
+This contains a markup object, which will be inserted between
+systems. This is often used for orchestral scores.
+
+The markup command @code{\slashSeparator} is provided as a sensible
+default,  for example
+
+@lilypond[raggedright]
+\paper {
+  systemSeparatorMarkup = \slashSeparator
+}
+
+\relative { c1 \break c1 }
+@end lilypond
+
+
 @end table
 @end quotation
 
diff --git a/input/regression/system-separator.ly b/input/regression/system-separator.ly
new file mode 100644 (file)
index 0000000..e48f316
--- /dev/null
@@ -0,0 +1,22 @@
+\header {
+
+  texidoc = "System separators maybe defined as markups in the
+@code{systemSeparator} field of the bookpaper block. They are centered
+between the boundary staffs of each system. "
+
+}
+
+\paper {
+  systemSeparatorMarkup = \slashSeparator
+
+}
+foobar = \relative { c1 c \break c c  \break c c }
+\book
+{
+  \score {
+     \new GrandStaff <<
+       \new Staff \foobar 
+       \new Staff \foobar 
+     >>
+  }
+}
index e64ef6c8aad7309fc042e0857920b55a4ab51a87..e5d9ee886464477c3b05c9fa277008dc86da257d 100644 (file)
@@ -49,7 +49,6 @@
     beforetitlespace = 10 \mm
     betweentitlespace = 2 \mm
 
-
     raggedbottom = ##f
 
     %%
@@ -57,7 +56,7 @@
     %%
     raggedlastbottom= ##t
 
-    %% ugh.  Should use /etc/papersize and set explicitely for
+    %% ugh.  Should use /etc/papersize and set explicitly for
     %% documentation.
     papersizename = "a4"
 
index a679ee687ddec56989719fc7c355001003e6a5fa..a41a24c633ad33ce2c8a1241a28b65960cf87341 100644 (file)
@@ -1,3 +1,11 @@
+
+slashSeparator = \markup {
+    \hcenter
+    \vcenter \combine
+      \beam #2.0 #0.5 #0.48
+      \raise #0.7 \beam #2.0 #0.5 #0.48
+  }
+
 bookTitleMarkup = \markup {
 
   \column {
index ebfcd540e506c6f294a974cd4091a58c26638a8b..07627ba770dca00ca70f204bde12908c01bab11e 100644 (file)
@@ -332,11 +332,17 @@ of the @code{#'direction} layout property."
     (stack-lines -1 0.0 (chain-assoc-get 'baseline-skip props) cmols)))
 
 (def-markup-command (vcenter layout props arg) (markup?)
-  "Align @code{arg} to its center. "
+  "Align @code{arg} to its center. "
   (let* ((mol (interpret-markup layout props arg)))
     (ly:stencil-align-to! mol Y CENTER)
     mol))
 
+(def-markup-command (hcenter layout props arg) (markup?)
+  "Align @code{arg} to its X center. "
+  (let* ((mol (interpret-markup layout props arg)))
+    (ly:stencil-align-to! mol X CENTER)
+    mol))
+
 (def-markup-command (right-align layout props arg) (markup?)
   "Align @var{arg} on its right edge. "
   (let* ((m (interpret-markup layout props arg)))
@@ -562,6 +568,26 @@ that.
    (* -0.5 (chain-assoc-get 'baseline-skip props))
    Y))
 
+(def-markup-command (beam layout props width slope thickness) (number? number? number?)
+  "Create a beam with the specified parameters."
+
+  (let*
+      ((y (* slope width))
+       (yext (cons (min 0 y) (max 0 y)))
+       (half (/ thickness 2)))
+       
+    (ly:make-stencil
+     (list 'beam width
+          slope
+          thickness
+          (ly:output-def-lookup layout 'blotdiameter))
+     (cons 0 width)
+     (cons (+ (- half) (car yext))
+          (+ half (cdr yext))))
+
+    ))
+
+
 (def-markup-command (normal-size-sub layout props arg) (markup?)
   "Set @var{arg} in subscript, in a normal font size."
   (ly:stencil-translate-axis
index 195196e73211efe32c5da574a02e926421b017d0..5d5895a0245520bf481b6ab47a111cf43a59d458 100644 (file)
@@ -32,6 +32,9 @@
 (define-public (moment-min a b)
   (if (ly:moment<? a b) a b))
 
+(define-public (average x . lst)
+  (/ (+ x (apply + lst)) (1+ (length lst))))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; lily specific variables.
 
index 19193d4fc78df82f1d4c2beab552179070e5f5cb..3b1e91c6537ad41d395f725df57b513a7d178ecf 100644 (file)
    (ly:numbers->string (list letter-col ball-col))
    ;; FIXME: barf
    " /Helvetica-Bold "
-   " draw_ez_ball")
-  
-  "")
+   " draw_ez_ball"))
 
 ;; FIXME: use draw_round_box
 (define (filledbox breapth width depth height)
index ac4283c7a1a3e2d5273b7853b454e817751402a7..f0dbf90324bb332bec5a7b6a9073c7578c056cb7 100644 (file)
        
        (vsize (ly:output-def-lookup layout 'vsize))
        (hsize (ly:output-def-lookup layout 'hsize))
-       
+
+       (system-separator-markup (ly:output-def-lookup layout 'systemSeparatorMarkup))
+       (system-separator-stencil (if (markup? system-separator-markup)
+                                    (interpret-markup layout
+                                                      (page-properties layout)
+                                                      system-separator-markup)
+                                    #f))
        (lmargin (ly:output-def-lookup layout 'leftmargin))
        (leftmargin (if lmargin
                       lmargin
                        (interval-length (ly:stencil-extent head Y))
                        0.0))
 
-       (line-stencils (map ly:paper-system-stencil lines))
        (height-proc (ly:output-def-lookup layout 'page-music-height))
 
        (page-stencil (ly:make-stencil '()
                                      (cons leftmargin hsize)
                                      (cons (- topmargin) 0)))
-       (was-title #t)
+       (last-system #f)
+       (last-y 0.0)
+       (add-to-page (lambda (stencil y)
+                     (set! page-stencil
+                           (ly:stencil-add page-stencil
+                                           (ly:stencil-translate-axis stencil
+                                            (- 0 head-height y topmargin) Y)
+                                           ))))
        (add-system (lambda (stencil-position)
-                    (set! page-stencil
-                          (ly:stencil-add
-                           (ly:stencil-translate-axis
-                            (car stencil-position)
-                            (- 0
-                               head-height
-                               (cadr stencil-position)
-                               topmargin)
-                            Y)
-                           page-stencil)))))
+                    (let*
+                        ((system (car stencil-position))
+                         (stencil (ly:paper-system-stencil system))
+                         (y (cadr stencil-position))
+                         (is-title (ly:paper-system-title?
+                                    (car stencil-position))))
+
+                   
+                      (add-to-page stencil y)
+                      (if (and (ly:stencil? system-separator-stencil)
+                               last-system
+                               (not (ly:paper-system-title? system))
+                               (not (ly:paper-system-title? last-system)))
+                          (add-to-page system-separator-stencil
+                                       (average (- last-y
+                                                   (car (ly:paper-system-staff-extents last-system)))
+                                                (- y
+                                                   (cdr (ly:paper-system-staff-extents system))))))
+                      (set! last-system system)
+                      (set! last-y y)
+                      ))))
 
     (if #f
        (display (list
     (set! page-stencil (ly:stencil-combine-at-edge
                        page-stencil Y DOWN head 0. 0.))
 
-    (map add-system (zip line-stencils offsets))
+    (map add-system (zip lines offsets))
     (if (ly:stencil? foot)
        (set! page-stencil
              (ly:stencil-add