]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/bar-check-redefine.ly (pipeSymbol): new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 2 Apr 2004 12:26:38 +0000 (12:26 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 2 Apr 2004 12:26:38 +0000 (12:26 +0000)
* lily/parser.yy (command_element): allow redefinition of |
meaning.

* lily/break-align-engraver.cc (acknowledge_grob): construct
LeftEdge where the first cause for alignment is coming from.
This makes \override Staff.LeftEdge work as expected.

ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/notation.itely
VERSION
input/regression/bar-check-redefine.ly [new file with mode: 0644]
input/wilhelmus.ly
lily/break-align-engraver.cc
lily/break-align-interface.cc
lily/parser.yy
ly/declarations-init.ly

index 4f3c9629844deb0041975e060ce9ec0c97ab5c22..f99792ae0eb9969ae36373d9402549adedca3f45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2004-04-02  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * input/regression/bar-check-redefine.ly (pipeSymbol): new file.
+
+       * lily/parser.yy (command_element): allow redefinition of |
+       meaning.
+
+       * lily/break-align-engraver.cc (acknowledge_grob): construct
+       LeftEdge where the first cause for alignment is coming from.
+       This makes \override Staff.LeftEdge work as expected.
+
+       
        * lily/slur-performer.cc (Slur_performer): add inits
 
        * lily/beam-performer.cc (Beam_performer): add inits
index 2b7aeff48f580ff78412f54ca1afbad1f086a533..03e075e1d2996f4754c34f67f821319179944221 100644 (file)
@@ -4,6 +4,14 @@
 
 @node Top, , , 
 @top
+@unnumbered New features in 2.2 since 2.0
+
+@itemize @bullet
+
+@item The meaning of the @code{|} in the input can be redefined, by
+ assigning a music expression to @code{pipeSymbol}.
+@end itemize
 
 @unnumbered New features in 2.2 since 2.0
 
@@ -386,7 +394,7 @@ The placement of accidentals on chords and ledgered notes is improved.
 @end itemize
 
 
-@chapter New features in 2.0 since 1.8
+@unnumbered New features in 2.0 since 1.8
 
 @itemize
 
index 3757b978843f2b222ae0605643c49a02f2be7b84..7251f1c5afe22fc69f45fc9f3a67e4738bfee53d 100644 (file)
@@ -698,6 +698,18 @@ score by scanning for failed bar checks and incorrect durations.  To
 speed up this process, you can use @code{skipTypesetting}, described
 in the next section.
 
+It is also possible to redefine the meaning of @code{|}. This is done
+by assigning a music expression to @code{pipeSymbol},
+
+@lilypond
+pipeSymbol = \bar "||"
+
+\score {
+    \notes  { c'2 | c'2 | }
+}
+@end lilypond 
+
+
 @node Skipping corrected music
 @subsection Skipping corrected music
 
diff --git a/VERSION b/VERSION
index 71bf679eed3ad15d04ebe258ca692f040c64ea98..b6bb35054f9b14b6d9fe1b4f144edf74ecf4fcbf 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
-MINOR_VERSION=2
+MINOR_VERSION=3
 PATCH_LEVEL=0
 MY_PATCH_LEVEL=
 
diff --git a/input/regression/bar-check-redefine.ly b/input/regression/bar-check-redefine.ly
new file mode 100644 (file)
index 0000000..0a2ea22
--- /dev/null
@@ -0,0 +1,12 @@
+\version "2.1.3"
+\header {
+    texidoc = "The meaning of @code{|} is stored in the
+identifier @code{pipeSymbol}."
+}
+
+pipeSymbol = \bar "||"
+
+\score {
+    \notes  { c'2 | c'2 | }
+}
+    
index dc4dc20a17da3f1faf381b8660a993459f44658d..ab0eac6695ab88a0d7a33911ac2944b20f5bcfbd 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.2.0"
+\version "2.3.0"
 
 \header {
   texidoc = "Wilhelmus van Nassouwe"
 }
 
 %% hymn tricks
-#(define (override-alist-property grob-name alist-property entry)
+#(define (prepend-grob-property grob-name
+         grob-prop entry)
   (lambda (context)
-    (let* ((grob-properties (ly:context-property context grob-name))
-          (alist-cons (chain-assoc-get alist-property grob-properties '()))
-          (new-alist-cons (assoc-set! alist-cons (car entry) (cdr entry)))
-          (new-props (assoc-set! (car grob-properties)
-                                 alist-property new-alist-cons)))
-      (ly:context-set-property! context grob-name (list new-props)))))
-  
+   (ly:context-pushpop-property context grob-name grob-prop
+    (cons
+     entry
+     (assoc-get grob-prop (car (ly:context-property context grob-name)))))))
+
 #(define (set-extra-space grob-name entry value)
-  (override-alist-property grob-name 'space-alist
-   ;;;huh, broken? --jcn
-   ;;;(cons entry (cons 'fixed-space value))))
+  (prepend-grob-property grob-name 'space-alist
    (cons entry (cons 'extra-space value))))
-      
-noclefs = \notes { s1 \set Staff.Clef = \turnOff }
-margins = {
+
+noclefs = \notes {
+  s1
+  \override Staff.Clef #'break-visibility = #(lambda (dir) (cons #t #t))
+}
+
+setMargins = {
   %% first line left margin
-  \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
+  \context Staff \applycontext #(set-extra-space 'TimeSignature 'first-note 4.5)
   
   %% next lines left margin
-  %% \applycontext #(set-extra-space 'KeySignature 'first-note 15)
-  \applycontext #(set-extra-space 'KeySignature 'staff-bar 15)
+  \context Staff \applycontext #(set-extra-space 'KeySignature 'staff-bar 15)
   
   %% next lines small key-signature margin
-  \applycontext #(set-extra-space 'LeftEdge 'key-signature 1.0)
-
-  %% using StaffSymbol.width now
-  %% right margin
-  %%\applycontext #(set-extra-space 'BarLine 'right-edge 12.5)
+  \context Staff \applycontext #(set-extra-space 'LeftEdge 'key-signature 4.0)
 }
 
-smallBarLines = {
+pipeSymbol = {
   %% Set height of bar line to 2 staff-spaces
-  \override Staff.BarLine #'bar-size-procedure = #(lambda (x) 2)
+  \once \override Staff.BarLine #'bar-size-procedure = #(lambda (x) 2)
   %% Move barline one staff-space up
-  \override Staff.BarLine #'extra-offset = #'(0 . 1)
+  \once \override Staff.BarLine #'extra-offset = #'(0 . 1)
+  \bar "|"
 }
 
 endBarLine = {
-  \revert Staff.BarLine #'bar-size-procedure
-  \revert Staff.BarLine #'extra-offset
-  \override Staff.BarLine #'extra-offset = #'(12 . 0)
-  \bar "|."
+
 }
 
+myBreak = { \bar "" \break }
+
 \paper {
   indent = 0.0\mm
   linewidth = 120.0\mm
@@ -66,27 +62,32 @@ endBarLine = {
 voice = \notes \relative c' {
   \clef violin
   \key g \major
-  \partial 4
-  d4 g g a a b a8
-  b8 c4 b a a g2.
+  d4 | g g a a b | a8 \myBreak
+  b8 | c4 b a a | g2.
 
-  d4 g g a a b a8
-  b8 c4 b a a g2.
+  d4 | g g a a | b a8
+  b8 | c4 b a a| g2.
 
-  b8[ c] d2 e4 d2 c4 b a8
-  b8 c4 b a g a2.
+  b8[ c] | d2 e4 d2 c4 | b a8
+  b8 | c4 b a g | a2.
 
-  d,4 g4.\melisma a8\melismaEnd b2 a2 g4 fis e8
-  d8 e4 g g fis
+  d,4 | g4.\melisma a8\melismaEnd b2 a2 g4 | fis e8
+  d8 | e4 g g fis |
+  
   \override NoteHead #'style = #'neo_mensural
+
   g\breve
+
+
+  \override Staff.BarLine #'extra-offset = #'(12 . 0)
+  \bar "|."
 }
 
 stich = \notes \relative c'' {
   \override Staff.NoteCollision #'merge-differently-dotted = ##t
   \set fontSize = #-3
   %% broken?
-  \override Voice.Stem #'beamed-lengths = #(map (lambda (x) (* 0.2 x)) '(3.26))
+  \override Stem #'beamed-lengths = #(map (lambda (x) (* 0.2 x)) '(3.26))
 
   \voiceTwo
   \partial 4
@@ -147,33 +148,20 @@ linebreaks = \notes {
     \context Staff <<
       \override Staff.StaffSymbol #'width = #'80
       \set Staff.autoBeaming = ##f
-      \margins
-      \smallBarLines
-
+      \set Score.timing = ##f
+      \setMargins
+     
       %% Less vertical space needed with lyrics
       \set Staff.minimumVerticalExtent = #'(2 . 2)
       
-      %% Second time signature
-      %% \override Staff.TimeSignature   #'print-function =
-      %% #(second-time-signature '(3 . 2) Time_signature::print)
-      
       %% Custom time signature
       \override Staff.TimeSignature #'print-function = #Text_item::print
       \override Staff.TimeSignature #'text = #oneHalfNoteTime
-      
-      %% Invisible alternating time signature 
-      \notes {
-       \partial 4 s4
-       \override Staff.TimeSignature #'print-function = #'()
-       \repeat unfold 2 { \time 4/4 s1 \time 2/4 s2 \time 4/4 s1*2 }
-       \time 3/2 s2*3 \time 2/4 s2 \time 4/4 s1*2
-       \time 7/4 s4*7 \time 2/4 s2
-       \time 4/4 s1 \time 4/2 s1*2
-      }
-
+    
       \context Voice = "voice" \voice
-        \linebreaks
-        \noclefs
+      \linebreaks
+      \noclefs
+      
       \context Voice = "stich" \stich
     >>
     \lyricsto "voice" \new Lyrics {
index ef66a137bb7df0893785f3623b35bb408712185f..f1bf4c6383a753ded309ddfe0f99133146490c7e 100644 (file)
@@ -101,8 +101,11 @@ Break_align_engraver::acknowledge_grob (Grob_info inf)
 
          announce_grob (align_, SCM_EOL);
 
-         left_edge_ = make_item ("LeftEdge");
-         add_to_group (left_edge_->get_property ("break-align-symbol"), left_edge_);
+         Context*origin = inf.origin_contexts (this)[0];
+         left_edge_ =  make_item_from_properties (origin,
+                                                  ly_symbol2scm ("LeftEdge"));
+         add_to_group (left_edge_->get_property ("break-align-symbol"),
+                       left_edge_);
          announce_grob (left_edge_, SCM_EOL);
        }
       
@@ -136,9 +139,12 @@ Break_align_engraver::add_to_group (SCM align_name, Item*item)
 }
 
 ENTER_DESCRIPTION (Break_align_engraver,
-/* descr */       "Align grobs with corresponding break-align-symbols into groups, and order the groups according to breakAlignOrder",
-/* creats*/       "BreakAlignment BreakAlignGroup LeftEdge",
-/* accepts */     "",
-/* acks  */       "break-aligned-interface"
-,/* reads */       "",
-/* write */       "");
+                  "Align grobs with corresponding @code{break-align-symbols} into "
+                  "groups, and order the groups according to @code{breakAlignOrder}. "
+                  "The left edge of the alignment gets a separate group, with a symbol @code{left-edge}. "
+                  ,
+                  /* creats*/       "BreakAlignment BreakAlignGroup LeftEdge",
+                  /* accepts */     "",
+                  /* acks  */       "break-aligned-interface",
+                  /* reads */       "",
+                  /* write */       "");
index 3e5f9d38b5ea39bebf027465ea02176aac9896a9..0eab0d9414b964b6d67d40797ca6d39f0001f19a 100644 (file)
@@ -160,7 +160,7 @@ Break_align_interface::do_alignment (Grob *grob)
       /*
        Find the first grob with a space-alist entry.
        */
-      for (SCM s= l->get_property ("elements");
+      for (SCM s = l->get_property ("elements");
           gh_pair_p (s) ; s = gh_cdr (s))
          {
            Grob *elt = unsmob_grob (gh_car (s));
index 9a46520cfdf84110b21bf43155bdc3c7d8ed9460..dcda1be7cc6a35559eb9ada4e119af1d59982812 100644 (file)
@@ -1409,8 +1409,13 @@ command_element:
                $$->set_spot (THIS->here_input ());
        }
        | '|'      {
+               SCM pipe =THIS->lexer_->lookup_identifier ("pipeSymbol");
+
+               if (Music * m = unsmob_music (pipe))
+                       $$ = m->clone ();
+               else
+                       $$ = MY_MAKE_MUSIC ("BarCheck");
 
-               $$ = MY_MAKE_MUSIC ("BarCheck");
                $$->set_spot (THIS->here_input ());
        }
        | TRANSPOSITION pitch {
index d39b6914111fde828cfa13a59e65cb6fc8be7b94..39504deda5c12317defb81f3e488894ada5c1efc 100644 (file)
@@ -31,6 +31,7 @@ break =#(make-event-chord (list (make-penalty-music -10001)))
 noBreak = #(make-event-chord (list (make-penalty-music 10001)))
 
 noBeam = #(make-music 'BeamForbidEvent) 
+pipeSymbol = #(make-music 'BarCheck)
 
 \include "scale-definitions-init.ly"