From: Han-Wen Nienhuys Date: Fri, 13 Feb 2004 22:33:59 +0000 (+0000) Subject: * input/test/ac-extra-voice.ly (accompany): remove file. X-Git-Tag: release/2.1.23~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3da2e3bab450a9282c5530438e2fc38ed8f66dc8;p=lilypond.git * input/test/ac-extra-voice.ly (accompany): remove file. * 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 --- diff --git a/ChangeLog b/ChangeLog index 8fa2ed45b1..1618a1a47f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-02-13 Han-Wen Nienhuys + * 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. diff --git a/input/mutopia/E.Satie/petite-ouverture-a-danser.ly b/input/mutopia/E.Satie/petite-ouverture-a-danser.ly index 249decf4a7..f0806ec3f1 100644 --- a/input/mutopia/E.Satie/petite-ouverture-a-danser.ly +++ b/input/mutopia/E.Satie/petite-ouverture-a-danser.ly @@ -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 index 8850ceb644..0000000000 --- a/input/test/ac-extra-voice.ly +++ /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 - } -} - - diff --git a/input/test/beam-auto-4-8.ly b/input/test/beam-auto-4-8.ly index ae4117b343..9e80019b33 100644 --- a/input/test/beam-auto-4-8.ly +++ b/input/test/beam-auto-4-8.ly @@ -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 } diff --git a/input/test/beam-auto-override.ly b/input/test/beam-auto-override.ly index ca7811d969..50c627c88c 100644 --- a/input/test/beam-auto-override.ly +++ b/input/test/beam-auto-override.ly @@ -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} } diff --git a/input/test/beam-count.ly b/input/test/beam-count.ly index f2ac4a48a9..e815fbd90a 100644 --- a/input/test/beam-count.ly +++ b/input/test/beam-count.ly @@ -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 diff --git a/input/test/slur-ugly.ly b/input/test/slur-ugly.ly index f85c21316e..621a2a8210 100644 --- a/input/test/slur-ugly.ly +++ b/input/test/slur-ugly.ly @@ -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 diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 9b743ca57a..5696550ffb 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -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 */ diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index a0f7e74491..25b7636dfa 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -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 ()) diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 08ac5604b3..82a9a4a1f6 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -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 diff --git a/scm/auto-beam.scm b/scm/auto-beam.scm index 7a16470a35..85f303d043 100644 --- a/scm/auto-beam.scm +++ b/scm/auto-beam.scm @@ -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)))) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 5a7f4473d5..e396af4823 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -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{ }"""))