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.
\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 {
+++ /dev/null
-\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
- }
-}
-
-
-\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
| | | |--|
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
}
\score{
\notes \relative c''{
+ #(override-auto-beam-setting '(end * * * *) 1 2)
\time 2/4
% one beam per measure
c8 c c c
\set autoBeaming = ##f
c8 c c c
}
- \paper{
- \translator{
- \VoiceContext
- \override autoBeamSettings #'(end * * * *) = #(ly:make-moment 1 2)
- }
- }
-\paper{raggedright = ##t}
+ \paper{raggedright = ##t}
}
-\version "2.1.22"
+\version "2.1.23"
\header{
texidoc="@cindex Beam Count
" }
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
\context Staff=up { s1 * 6/4 }
\context Staff=down <<
\clef bass
+ #(override-auto-beam-setting '(end * * * *) 1 2 'Score)
\autochange \context Voice \baseWalk
>>
>>
\override Slur #'beautiful = #5.0
\override Slur #'direction = #1
\override Stem #'direction = #-1
- \override autoBeamSettings #'(end * * * *)
- = #(ly:make-moment 1 2)
}
\translator {
\PianoStaffContext
UGH UGH.
settings aren't grob-properties.
*/
- SCM settings = updated_grob_properties (daddy_trans_, ly_symbol2scm ("autoBeamSettings"));
+ SCM settings = get_property ("autoBeamSettings");
/* first guess */
{
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 ())
explicitClefVisibility = #all-visible
explicitKeySignatureVisibility = #all-visible
- autoBeamSettings = #(cons default-auto-beam-settings '())
+ autoBeamSettings = #default-auto-beam-settings
autoBeaming = ##t
scriptDefinitions = #default-script-alist
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)
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))))
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{ }"""))