]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/test/ac-extra-voice.ly (accompany): remove file.
authorhanwen <hanwen>
Fri, 13 Feb 2004 22:33:59 +0000 (22:33 +0000)
committerhanwen <hanwen>
Fri, 13 Feb 2004 22:33:59 +0000 (22:33 +0000)
* scripts/convert-ly.py (FatalConversionError.subst_in_trans):
conversion rule for \translator{}. Apply everywhere.

* lily/auto-beam-engraver.cc (test_moment): use
updated_grob_properties() to retrieve autoBeam settings.

* lily/rest-collision.cc (do_shift): ignore rests with beams.
(do_shift): rewrite only-rests case: use common refpoints: the
routine will have sensible results when other rest-translations
have taken place.

* input/GNUmakefile (SUBDIRS): remove ascii-art

12 files changed:
ChangeLog
input/mutopia/E.Satie/petite-ouverture-a-danser.ly
input/test/ac-extra-voice.ly [deleted file]
input/test/beam-auto-4-8.ly
input/test/beam-auto-override.ly
input/test/beam-count.ly
input/test/slur-ugly.ly
lily/auto-beam-engraver.cc
lily/rest-collision.cc
ly/engraver-init.ly
scm/auto-beam.scm
scripts/convert-ly.py

index 8fa2ed45b13e755d22db5398f99a15ea909882c2..1618a1a47f9520b2b3ea6b26a3a30071d064bf62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-02-13  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * input/test/ac-extra-voice.ly (accompany): remove file.
+
+       * input/test/maximum-rest-count.ly: remove file.
+
        * scripts/convert-ly.py (FatalConversionError.subst_in_trans):
        conversion rule for \translator{}. Apply everywhere.  
 
index 249decf4a7fb94f6dff84778549d21026d6998b4..f0806ec3f1ebcd1d739c56c0ade19c13849d16dc 100644 (file)
@@ -139,14 +139,14 @@ lower = \context Staff \notes \relative c{
        \clef bass
         \lower
       >>
+           \override Slur #'attachment = #'(stem . stem)
+           #(override-auto-beam-setting '(end 1 8 * *)  1 4)
+           #(override-auto-beam-setting '(end 1 16 * *)  1 4)
     >>
 
   \paper {
     \translator{
            \VoiceContext
-           \override Slur #'attachment = #'(stem . stem)
-           \override autoBeamSettings #'(end 1 8 * *) = #(ly:make-moment 1 4)
-           \override autoBeamSettings #'(end 1 16 * *) = #(ly:make-moment 1 4)
     }
   }
   \midi {
diff --git a/input/test/ac-extra-voice.ly b/input/test/ac-extra-voice.ly
deleted file mode 100644 (file)
index 8850ceb..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-\version "2.1.23"
-
-%% I don't know what this example is supposed to do.  delete it?
-%% It shows how to use the autochange feature together with an extra
-%% voice.  When I needed to typeset this example, I found it not trivial
-%% and dumped a piece of it here.  Move to refman?
-
-\header{
-    texidoc="When using automatic staff changes for the one voice, the
-other voice must be given a name explicitely."
-}
-
-global = \notes{
-    \key a \minor
-    \time 6/4
-}
-
-melody = \notes\relative c''{
-    r2 r r 
-    r2 r r
-    r4 a'8-- \< a-- a-- a-- c-- b\!-- a-\> gis f e\!
-    es8 \grace b c r4 r2 r
-}
-
-basloopje = \notes\relative c{
-    d,8( a' d f a d f d a f d a)
-}
-
-accompany = \repeat unfold 4  \basloopje
-
-\score{
-    \notes \context PianoStaff<<
-       \context Staff=up <<
-           \global
-           \context Voice=foo{
-               \voiceOne
-               \melody 
-           }
-       >>
-       \context Staff=down<<
-           \global
-           \clef bass
-           \autochange  \context Voice \accompany
-       >>
-    >>
-
-    \paper {
-       \translator{ 
-           \StaffContext
-           \override autoBeamSettings #'(end * * * *)
-        = #(ly:make-moment 1 2)
-       }
-    }
-    \midi {
-       \tempo 4 = 54
-    }
-}
-
-
index ae4117b3438db8050144a6c4a1df1c0fbc99ce99..9e80019b339f9ce20c2e65136787b90b8ef22d79 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.1.22"
+\version "2.1.23"
 % keep for now, although merging into beam-auto-override is a possibility.
 \header {
        texidoc = "@cindex Auto Beaming 4/8
@@ -26,7 +26,7 @@ You can override LilyPond's automatic beaming.
      |  |  |   |--|
     x| x| x|  x| x|
 %}
-     \override autoBeamSettings  #'(end * * * *) = #(ly:make-moment 2 4)
+     #(override-auto-beam-setting '(end * * * *)  2 4)
      c8 c c c16 c
 
   }
index ca7811d969378556bc4403602dd7591fd23243a8..50c627c88cd417071a3c1119cbb56c435c976ae6 100644 (file)
@@ -25,6 +25,7 @@ The beam will be ended also when now % beamAutoEnd = 0.
 
 \score{
     \notes \relative c''{
+        #(override-auto-beam-setting '(end * * * *)  1 2)
        \time 2/4
        % one beam per measure
        c8 c c c
@@ -42,13 +43,7 @@ The beam will be ended also when now % beamAutoEnd = 0.
        \set autoBeaming = ##f
        c8 c c c
     }
-    \paper{
-       \translator{
-           \VoiceContext
-           \override autoBeamSettings #'(end * * * *) = #(ly:make-moment 1 2)
-       }
-    }
-\paper{raggedright = ##t}
+    \paper{raggedright = ##t}
 }
 
 
index f2ac4a48a98fdda499b737c896fcae831c3c4a8d..e815fbd90a0b22ea18111f1b8826a09b401cb8b2 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.1.22"
+\version "2.1.23"
 \header{
        texidoc="@cindex Beam Count
 
@@ -9,7 +9,7 @@ two sets of four 32nds joined as if they were 8th notes.
 " }
 
 fragment = \notes {
-  \override autoBeamSettings  #'(end * * * *) = #(ly:make-moment 1 4)
+  #(override-auto-beam-setting '(end * * * *)  1 4)
   f32 g a b b a g f
 
   f32 g a b 
index f85c21316ec89ed54693ee99eb87c478f840d87e..621a2a82108b7781649d3681f9a1226165d546c5 100644 (file)
@@ -15,6 +15,7 @@ baseWalk = \notes \relative c {
     \context Staff=up { s1 * 6/4 }
     \context Staff=down <<
       \clef bass
+      #(override-auto-beam-setting '(end * * * *)  1 2 'Score)
       \autochange  \context Voice \baseWalk
     >>
   >>
@@ -25,8 +26,6 @@ baseWalk = \notes \relative c {
       \override Slur #'beautiful = #5.0
       \override Slur #'direction = #1
       \override Stem #'direction = #-1
-      \override autoBeamSettings #'(end * * * *)
-     = #(ly:make-moment 1 2)
     }
     \translator {
       \PianoStaffContext
index 9b743ca57ad59a815662620236664ac9fd936d20..5696550ffb2863fb794825b28b44ecc6b79c6f38 100644 (file)
@@ -149,7 +149,7 @@ Auto_beam_engraver::test_moment (Direction dir, Moment test_mom)
     UGH UGH.
     settings aren't grob-properties.
    */
-  SCM settings = updated_grob_properties (daddy_trans_, ly_symbol2scm ("autoBeamSettings"));
+  SCM settings = get_property ("autoBeamSettings");
   
   /* first guess */
   
index a0f7e744913840dc110440a3fc7fb3f762361c01..25b7636dfa1b3664a227bf6072e2409bed83ba56 100644 (file)
@@ -195,10 +195,20 @@ Rest_collision::do_shift (Grob *me)
        {
          warning (_ ("too many colliding rests"));
        }
-      Grob * rcol = rests[0];
-      Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
+      Grob * rcol = 0;
+      Direction dir = CENTER;
+
+      for (int i= rests.size (); !rcol && i--;)
+       if (Note_column::dir (rests[i]))
+         {
+           dir = Note_column::dir (rests[i]);
+           rcol = rests[i];
+         }
+
+      if (!rcol)
+       return SCM_UNSPECIFIED;
       
-      Direction dir = Note_column::dir (rests[0]);
+      Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
       
       Interval restdim = rcol->extent (common, Y_AXIS);
       if (restdim.is_empty ())
index 08ac5604b3b35c3dcd7c137901dec53c235bfab9..82a9a4a1f6eced5a6545c53f2417e22bda939041 100644 (file)
@@ -456,7 +456,7 @@ AncientRemoveEmptyStaffContext = \translator {
     
     explicitClefVisibility = #all-visible
     explicitKeySignatureVisibility = #all-visible
-    autoBeamSettings = #(cons default-auto-beam-settings '())
+    autoBeamSettings = #default-auto-beam-settings
     autoBeaming = ##t
     scriptDefinitions = #default-script-alist
 
index 7a16470a352ecf87aa42ff2120e8b9b8cf55f4a6..85f303d043b47f52e97daad5281f018b28c4ed61 100644 (file)
@@ -116,7 +116,7 @@ a fresh copy of the  list-head is made."
                   setting))
   )
 
-(define-public (override-auto-beam-setting setting num den)
+(define-public (override-auto-beam-setting setting num den . rest)
   (ly:export
    (context-spec-music
     (make-apply-context (lambda (c)
@@ -124,18 +124,19 @@ a fresh copy of the  list-head is made."
                           c 'autoBeamSettings
                           setting (ly:make-moment num den))
                          ))
-    'Voice)
-  ))
+    (if (and (pair? rest) (symbol? (car rest)))
+       (car rest)
+       'Voice)
+  )))
 
-(define-public (revert-auto-beam-setting setting)
+(define-public (revert-auto-beam-setting setting . rest)
   (ly:export
    (context-spec-music
     (make-apply-context (lambda (c)
                          (revert-property-setting
                           c 'autoBeamSettings
                           setting)))
-    
-    'Voice)))
-  
-
+    (if (and (pair? rest) (symbol? (car rest)))
+       (car rest)
+       'Voice))))
 
index 5a7f4473d5767d0c925af0827cd6943db18a9a43..e396af48236cd640126707cd4153069a7d847c47 100644 (file)
@@ -1876,14 +1876,19 @@ conversions.append (((2,1,22), conv, """new syntax for property settings:
 def conv (str):
        def subst_in_trans (match):
                s = match.group (0)
-               s = re.sub (r'([a-zA-Z]+)\s*\\override',
-                             r'\\override \1', s)
-               s = re.sub (r'([a-zA-Z]+)\s*\\set',
-                             r'\\override \1', s)
-               s = re.sub (r'([a-zA-Z]+)\s*\\revert',
-                             r'\\revert \1', s)
+               s = re.sub (r'\s([a-zA-Z]+)\s*\\override',
+                             r' \\override \1', s)
+               s = re.sub (r'\s([a-zA-Z]+)\s*\\set',
+                             r' \\override \1', s)
+               s = re.sub (r'\s([a-zA-Z]+)\s*\\revert',
+                             r' \\revert \1', s)
                return s
        str = re.sub (r'\\(translator|with)\s*{[^}]+}',  subst_in_trans, str)
+
+       str = re.sub (r"""\\override\s*autoBeamSettings\s*#([^=]+)\s*=\s*#\(ly:make-moment\s+(\d+)\s+(\d)\s*\)""",
+                     r"""#(override-auto-beam-setting \1 \2 \3)""",
+                     str)
+       
        return str
        
 conversions.append (((2,1,23), conv, """Property setting syntax in \\translator{ }"""))