]> git.donarmstrong.com Git - lilypond.git/commitdiff
''
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 22 Jun 2002 21:18:44 +0000 (21:18 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 22 Jun 2002 21:18:44 +0000 (21:18 +0000)
14 files changed:
ChangeLog
Documentation/user/macros.itexi
config.make.in
input/regression/beam-length.ly
input/regression/rest-pitch.ly
input/trip.ly
input/tutorial/brahms.ly [new file with mode: 0644]
input/tutorial/sammartini.ly
lily/grob.cc
lily/lily-guile.cc
lily/note-collision.cc
lily/parser.yy
scm/music-functions.scm
stepmake/bin/add-html-footer.py

index 06b993dc6e5fe261523a050f8aaa47009ef71558..666ca0a3e9ac9cb92b386d76bf8bb72c6e1f94c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2002-06-22  Han-Wen  <hanwen@cs.uu.nl>
 
+       * lily/note-collision.cc (check_meshing_chords): don't crash if no
+       stems.
+
+       * scm/music-functions.scm (toplevel-music-functions): new
+       definition. Functions to apply automatically. Removes the need for
+       explicitly doing \apply #voicify-music
+
        * lily/grob.cc (do_break_substitution): rename function, use
        global var for criterion argument. Reduces stack usage a little.
 
index 9343d80c3f392b70618bf95809414f98125b00fc..bb7d7cacea3dc0b6f6bb2c76c4168cb8ac08d8da 100644 (file)
@@ -73,7 +73,7 @@ $\\flat$
 @macro separate
 
 @tex
-\\hbox to\\hsize{\\hfill\\smallrm*\\textrm*\\smallrm*\\hfill}
+\medskip
 @end tex
 
 @end macro
@@ -87,17 +87,6 @@ $\\flat$
 @macro separate
 
 @quotation
-@quotation
-@quotation
-@quotation
-@quotation
-@quotation
-***
-@end quotation
-@end quotation
-@end quotation
-@end quotation
-@end quotation
 @end quotation
 @end macro
 @end ifinfo
@@ -105,7 +94,7 @@ $\\flat$
 @ifhtml
 @macro separate
 @html
-<p></p><center>*<font size="+1">*</font>*</center><br>
+<p></p><br><br>
 @end html
 @end macro
 @end ifhtml
index e976cfe25f5501039d6875757fdc973e3ca0478e..b1cb9d284136d8040f7c05b6f5503947bd5cf207 100644 (file)
@@ -12,9 +12,9 @@ USER_CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @GUILE_CFLAGS@
 USER_LDFLAGS = @LDFLAGS@ @GUILE_LDFLAGS@
 EXTRA_LIBES = @EXTRA_LIBES@ @LIBS@
 
-PACKAGE = @PACKAGE@
-package = @package@
-PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE = LILYPOND # @PACKAGE@
+package = lilypond # @package@
+PACKAGE_NAME =  LilyPond #@PACKAGE_NAME@
 
 prefix = @prefix@
 exec_prefix = @exec_prefix@
index e1689107fc4d3e4a4cb8ac97f52c39be332eb472..8cabfb8dcc6cb14ad7a2b83c35aed2b322e3fc72 100644 (file)
@@ -8,9 +8,7 @@ beams should look the same
     
 \score { 
   \context Voice \notes\relative c {
-
                        [d''8 d d] [d g d]
                        c c
-       
   }
 }
index e864dade123c20f27576ead89e6707b71cac13bf..5880a5246dc859da1eb8613f2759da2d5547744b 100644 (file)
@@ -6,7 +6,7 @@ collision will leave it alone."
 
 }
 
-\score { \notes\relative c'' \apply #voicify-music
+\score { \notes\relative c'' 
 {
    a4\rest b4\rest c4\rest
 
index 7342f420fdc2f3c35d8dc92706ebfa3b2cd29841..c0d78f20ff133633b1f22ea50d61f0fcff566f3e 100644 (file)
@@ -99,44 +99,38 @@ fugaIIRight =  \notes   \relative c''   {
 
   %15
   \context Staff <
-    \context Voice = VA { \stemUp [b8 fis8] b4 }
-    \context Voice = VB {  \stemDown fis2 }
+     { [b8 fis8] b4 }\\
+     { fis2 }
   >
 
   \context Staff \notes\relative c''<
-       \context Voice=one {
-       \shiftOff
-       \stemUp
+   {
          e4 -5
-       }
-       \context Voice=two {
-         \shiftOn
-         \stemUp
+       }\\
+       \\
+ {
          cis-4
-       }
-       \context Voice=three {
-         \shiftOnn
-         \stemUp
+       }\\ \\
+       
+        {
          ais-3 
-       }
-       \context Voice=four {
-         \shiftOnnn
-         \stemUp
+       }\\ \\ 
+       {
          fis-2
        }
   >
 
     %16
     \context Staff <
     \context Voice = one {  dis2 dis4 |
+ {  dis2 dis4 |
       cis2 cis4 |
-      b4. [cis8 dis e] }
-    \context Voice = three {  \stemUp \shiftOn [b8 fis] b2 ~ |
+      b4. [cis8 dis e] } \\
+ {   fis2. ~ |
+      fis ~ |
+      fis4 e2 } \\
+ {   [b8 fis] b2 ~ |
       [b8 a!16 gis] a2 ~ |
       a4 gis2 }
-    \context Voice = two {  \stemDown fis2. ~ |
-      fis ~ |
-      fis4 e2 }
   > |
   %19
 }
@@ -149,14 +143,14 @@ fugaIILeft =  \notes {
 
   %15
   \context Staff < 
-    \context Voice = one { \stemDown
+     { 
     \gracetest
     \relative b, < )b2 dis fis a b cis dis> \stemUp ais4 |
-      b2 b4 }
-    \context Voice = two { \stemDown s2 e4 |
-      fis2 fis4 }
+      b2 b4 } \\
+      {  s2 e4 | fis2 fis4 }
   >
-  \stemBoth cis2 [e16( fis a \clef "treble" b] |
+  \stemBoth
+  cis2 [e16( fis a \clef "treble" b] |
   d'4 ) b8 b8 b4 |
   %19
 }
diff --git a/input/tutorial/brahms.ly b/input/tutorial/brahms.ly
new file mode 100644 (file)
index 0000000..02b0f48
--- /dev/null
@@ -0,0 +1,25 @@
+%{
+
+ Brahms Klavierst"ucke op 119, no 1.
+
+%}
+
+\score {
+    \notes\context PianoStaff <
+    \context Staff = up
+    \relative c'' <
+       { fis4-3 ( ~ fis16 )a-5 } \\
+       {
+           \dynamicUp
+           fis16( \> d \! b \translator Staff = down \clef treble g ~ < g8 )e> } \\
+       { s16
+         \property Voice.Stem \set #'transparent = ##t
+         d'
+         \property Voice.Stem \revert #'transparent
+         ~ < d4 b4  > }
+    >
+    \context Staff = down { \time 3/8 \clef bass s4. }
+    >
+    \paper { linewidth = -1. }
+}
+
index d9f648fa17e6adb1d633228e141053eca8b953fe..18b884eaacf208f3d7a4efab357d1ae538e4e258 100644 (file)
@@ -1,55 +1,62 @@
 
 \include "paper16.ly"
-
-stemDown = \property Voice.Stem \override #'direction = #-1
-stemUp = \property Voice.Stem \override #'direction = #1
-stemBoth = \property Voice.Stem \revert #'direction  
-
-viola = \notes \relative c' \context Voice = viola {
+viola = \notes \relative c'  \context Voice = viola {
     <c4-\f-\arpeggio g' c>
-    \stemDown g'8. b,16
+    \stemDown
+    g'8. b,16
     s1 s2. r4
     g
 }
 
-oboes = \notes \relative c'' \context Voice = oboe {
-    \stemUp s4  g8. b,16 c8 r <e'8.^\p g> <f16 a>
+oboes = \notes \relative c'' \context Voice = oboes {
+    \stemUp
+    s4  g8. b,16 c8 r <e'8.^\p g> <f16 a>
     \grace <e8( g> <d4 f> <c2 e>
     \times 2/3 { <d8 \< f> <e g> <f a> }
     <
-        { \times 2/3 { a8 g c } \! c2 }
-        \context Voice = oboeTwo {
-            \stemDown
+        { \stemUp \times 2/3 { a8 g c } \! c2 }
+        \context Voice = second { \stemDown
             \grace {
                 \stemDown
-                [f,16 g] }
+                [f,16 g]
+               \stemBoth }
                 f8 e e2
             }
     >
-    \stemBoth
+
     \grace <c,8( e> <)b8. d8.-\trill> <c16 e> | 
     [<d ( f> < )f8. a>] <)b,8 d> r [<d16( f> <f8. )a>] <b,8 d> r  |
     [<c16( e>  < )e8. g>] <c8 e,>
 }
 
 hoomPah = \repeat unfold 8 \notes
-    \transpose c' { c8 \stemDown g'8 \stemUp }
+    \transpose c' {
+       \translator Staff = down
+       \stemUp
+       c8
+       \translator Staff = up
+       \stemDown
+       c'8 }
 
 bassvoices = \notes \relative c' {
     c4 g8. b,16
     \autochange Staff \context Voice \hoomPah
+    
     \translator Staff = down
-    \stemDown [c8 c'8] r4
+    \stemBoth 
+    
+    [c8 c'8] r4
     <g d'> r4
-    < {\stemUp r2 <e4 c'> <c8 g'> }
-        \context Voice = reallyLow  {\stemDown g2 ~ | g4 c8 } >
+    < { r2 <e4 c'> <c8 g'> } \\
+      { g2 ~ | g4 c8 } >
 }
 
 \score {
     \context PianoStaff \notes <
-        \context Staff = up < \time 2/2
-             \viola
+        \context Staff = up < 
              \oboes
+             \viola
          >
          \context Staff = down < \time 2/2 \clef bass
              \bassvoices
index eb42b0c4973cd6246a3d7c149a6bfc6c41e6a7e1..3121658c01ce40a268ca2e2a781c1d7fdb05cb10 100644 (file)
@@ -390,6 +390,11 @@ set_break_subsititution (SCM criterion)
   break_criterion = criterion;
 }
 
+
+/*
+  TODO: check wether we can do this in-place; now we generate a lot of
+  garbage.
+ */
 SCM
 do_break_substitution (SCM src)
 {
index e5595530cef7cbf946e13a0ca716442d2ef4d6a4..69fb7dfb2cc578b32d71fee77312d92f82f5900b 100644 (file)
@@ -25,6 +25,9 @@
 #include "pitch.hh"
 #include "dimensions.hh"
 
+
+// #define TEST_GC
+
 #ifdef PARANOID
 #include <libguile/gc.h>
 #undef gh_pair_p
index 8dcbae3d2c06c075ffceb67c9ec707b8cca247b6..5468ff529f71e2c095259e70625f90de6ee50cb7 100644 (file)
@@ -80,6 +80,14 @@ check_meshing_chords (Grob*me,
   bool distant_half_collide = false;  
   bool full_collide = false;  
 
+  /*
+    Let's not crash. 
+   */
+  if (!Note_column::stem_l (cu)
+      || !Note_column::stem_l (cd))
+    return ;
+  
+  
   /*
     TODO:
 
@@ -329,7 +337,7 @@ Note_collision_interface::automatic_shift (Grob *me,
        {
          if (shift[i-1] == shift[i])
            {
-             me->warning (_ ("Too many clashing notecolumns.  Ignoring them."));
+             clashes[0]->warning (_ ("Too many clashing notecolumns.  Ignoring them."));
              return tups;
            }
        }
index cc806fe177f7c09442da9c65a4b683f13785f133..698398adcc6b63bd4ef9b9982d7639500469ebc6 100644 (file)
@@ -569,14 +569,15 @@ score_body:
                $$->set_spot (THIS->here_input ());
                SCM m = $1->self_scm ();
                scm_gc_unprotect_object (m);
-               $$->music_ = m;
 
                /*
                        guh.
                */
-               SCM check_func = scm_c_eval_string ("check-start-chords");
-               gh_call1 (check_func, m);
-               
+               SCM check_funcs = scm_c_eval_string ("toplevel-music-functions");
+               for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
+                       m = gh_call1 (gh_car (check_funcs), m);
+               $$->music_ = m;
+
        }
        | SCORE_IDENTIFIER {
                $$ = new Score (*unsmob_score ($1));
index 8eca9bea4585d24d279fff2065f09fcf856cfd41..c7031f4f4230f91a688fb0eac05a5c5507fdc4af 100644 (file)
@@ -35,7 +35,6 @@ written by Rune Zedeler. "
          music 'element
          (unfold-repeats e)))
 
-
     music))
 
 
@@ -223,20 +222,17 @@ this is not an override
        ((es (ly-get-mus-property m 'elements))
        (e (ly-get-mus-property m 'element))
        )
-       
+     (if (pair? es)
+        (ly-set-mus-property m 'elements (map voicify-music es)))
+     (if (music? e)
+        (ly-set-mus-property m 'element  (voicify-music e)))
      (if
       (and (equal? (ly-music-name m) "Simultaneous_music")
           (reduce (lambda (x y ) (or x y))     (map music-separator? es)))
       (voicify-chord m)
-      (begin
-       (if (pair? es)
-           (ly-set-mus-property m 'elements (map voicify-music es)))
-       (if (music? e)
-           (ly-set-mus-property m 'element  (voicify-music e)))
-           
-       m)
-      
       )
+
+     m
      ))
 
 ;;;
@@ -260,8 +256,8 @@ this is not an override
   ))
   
 (define (check-start-chords music)
-  "Check music expression for a Simultaneous_music containing notes
-(ie. Request_chords), without context specification. Called  from parser."
+  "Check music expression for a Simultaneous_music containing notes\n(ie. Request_chords), without context specification. Called  from parser."
+  
      (let*
        ((es (ly-get-mus-property music 'elements))
        (e (ly-get-mus-property music 'element))
@@ -273,8 +269,7 @@ this is not an override
         ((equal? name "Simultaneous_music")
 
          (if (has-request-chord es)
-             (ly-music-message music "Starting score with a chord.
-Please insert an explicit \\context before chord")
+             (ly-music-message music "Starting score with a chord.\nPlease insert an explicit \\context before chord")
              (map check-start-chords es)))
         
         ((equal? name "Sequential_music")
@@ -283,6 +278,8 @@ Please insert an explicit \\context before chord")
          (else (if (music? e) (check-start-chords e )))
        
        ))
-
      music
      )
+
+
+(define toplevel-music-functions (list check-start-chords voicify-music))
index f7cdac7ffbda1dfd586f88177bc9d6d99bb4a4de..9e79f026835aba6a868029624ab0159192f6fcf2 100644 (file)
@@ -235,7 +235,7 @@ def do_file (f):
 
 
        versiontup = string.split(package_version, '.')
-       branch_str = 'stable-branch' 
+       branch_str = 'stable-branch'
        if string.atoi ( versiontup[1]) %  2:
                branch_str = 'development-branch'