convert rule.
* Documentation/user/refman.itely (Fingering instructions): adjust manual.
* lily/new-fingering-engraver.cc (position_scripts): don't crash
for borderline cases (e.g. 1 fingering.)
(position_scripts): revise interface, use fingerOrientations to
set fingering positions.
2003-08-30 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * scripts/convert-ly.py (FatalConversionError.conv): fingering
+ convert rule.
+
+ * Documentation/user/refman.itely (Fingering instructions): adjust manual.
+
* lily/new-fingering-engraver.cc (position_scripts): don't crash
for borderline cases (e.g. 1 fingering.)
+ (position_scripts): revise interface, use fingerOrientations to
+ set fingering positions.
* scm/document-translation.scm (context-doc): add aliases to
automated documentation.
<< c-1 e-2 g-3 b-5 >> 4
@end lilypond
-Setting @code{fingerHorizontalDirection} will put the fingerings next
-to the note head:
+Setting @code{fingeringOrientations} will put fingerings next
+to note heads:
@lilypond[verbatim,singleline,fragment,relative=1]
- \property Voice.fingerHorizontalDirection = #LEFT
- << c-1 es-2 g-4 bes-5 >> 4
- \property Voice.fingerHorizontalDirection = #RIGHT
- << c-1 es-2 g-4 bes-5 >> 4
+ \property Voice.fingeringOrientations = #'(left down)
+ <<c-1 es-2 g-4 bes-5 >> 4
+ \property Voice.fingeringOrientations = #'(up right down)
+ <<c-1 es-2 g-4 bes-5 >> 4
@end lilypond
@seealso
\score {
\notes \relative c'{
- <<g_0>> 4
- <<g_1>> 4
- <<c''^5>> 4
- <<e,^6>> 4
- <<f,_1>> 4
- << c-1 e-3>> 4
- <<c-1 e-3 g-5 >> 4
- <<c-1 e-2 g-3 b-5 >> 4
- <<c-1 e-2 g-3 b-5 d-6 f-7 a-8 c-9 >> 4
- \property Voice.fingerHorizontalDirection = #LEFT
- << c-1 es-3 g-5 >> 4
- \property Voice.fingerHorizontalDirection = #RIGHT
- << c-1 e-2 g-3 b-5 >> 4\arpeggio
- \property Voice.fingerHorizontalDirection = #LEFT
- << c_1 e-2 g-3 b^5 >> 4
+ <<c-1 e-2 g-3 b-4 d-5 f-6 a-7 c-8 >> 4
+
+ \property Voice.fingeringOrientations = #'(left)
+ << c-1 e-2 g-3 b-5 >> 4
+
+ \property Voice.fingeringOrientations = #'(down left)
+ << c-1 e-2 g-3 b-5 >> 4
+
+ \property Voice.fingeringOrientations = #'(down left up)
+ << c-1 e-2 g-3 b-5 >> 4
+
+ \property Voice.fingeringOrientations = #'(up left)
+ << c-1 e-2 g-3 b-5 >> 4
+
+ \property Voice.fingeringOrientations = #'(right)
+ << c-1 e-2 g-3 b-5 >> 4
+
+
}
fingerings_[i].position_ = gh_scm2int (fingerings_[i].head_ -> get_grob_property( "staff-position"));
}
- SCM fhd = get_property ("fingerHorizontalDirection");
-
for (int i = fingerings_.size(); i--;)
for (int j = heads_.size() ; j--;)
Side_position_interface::add_support (fingerings_[i].script_, heads_[j]);
SCM d = fingerings_[i].finger_event_->get_mus_property ("direction");
if (to_dir (d))
{
- if (to_dir (d) == UP)
- {
- up.push (fingerings_[i]);
- }
- else
- down.push (fingerings_[i]);
+ ((to_dir (d) == UP) ? up : down ).push (fingerings_[i]);
fingerings_.del (i);
}
}
fingerings_.sort (&Finger_tuple::compare);
-
- if (ly_dir_p (fhd))
+ SCM orientations = get_property ("fingeringOrientations");
+
+ bool up_p = scm_memq (ly_symbol2scm ("up"), orientations) != SCM_BOOL_F;
+ bool down_p = scm_memq (ly_symbol2scm ("down"), orientations) != SCM_BOOL_F;
+ bool left_p = scm_memq (ly_symbol2scm ("left"), orientations) != SCM_BOOL_F;
+ bool right_p = scm_memq (ly_symbol2scm ("right"), orientations) != SCM_BOOL_F;
+ Direction hordir = (right_p) ? RIGHT : LEFT;
+ if (left_p || right_p)
{
- if (!up.size())
+ if (up_p && !up.size () && fingerings_.size ())
up.push (fingerings_.pop());
- if (fingerings_.size () && !down.size())
+
+ if (down_p && !down.size () && fingerings_.size())
{
down.push (fingerings_[0]);
fingerings_.del(0);
horiz.concat (fingerings_);
}
- else
+ else if (up_p && down_p)
{
int center = fingerings_.size() / 2;
down.concat (fingerings_.slice (0,center));
up.concat (fingerings_.slice (center, fingerings_.size()));
}
-
+ else if (up_p)
+ {
+ up.concat (fingerings_);
+ fingerings_ .clear ();
+ }
+ else
+ {
+ if (!down_p)
+ warning(_ ("Fingerings are also not down?! Putting them down anyway."));
+ down.concat (fingerings_);
+ fingerings_.clear();
+ }
+
for (int i = 0; i < horiz.size(); i++)
{
Finger_tuple ft = horiz[i];
f->add_offset_callback (Self_alignment_interface::aligned_on_self_proc, Y_AXIS);
f->add_offset_callback (Side_position_interface::aligned_side_proc, X_AXIS);
- f->set_grob_property ("direction", fhd);
+ f->set_grob_property ("direction", gh_int2scm (hordir));
typeset_grob (f);
}
pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*")
pedalSostenutoStyle = #'mixed
-
+ fingeringOrientations = #'(up down)
tupletNumberFormatFunction = #denominator-tuplet-formatter
subdivideBeams = ##f
custos
)
barCheckSynchronize = ##t
-
+
%% chord names:
chordNameFunction = #ignatzek-chord-names
majorSevenSymbol = #whiteTriangleMarkup
"Used to set the relative size of all grobs
in a context. This is done using the @code{Font_size_engraver}.")
-(translator-property-description 'fingerHorizontalDirection integer?
- "If set, put the middle fingerings to
-the side of the note head. Use LEFT, RIGHT or unset.")
+(translator-property-description
+ 'fingeringOrientations list?
+ "List of symbols, containing left, right, up and/or down. This list determines where fingerings are put wrt. to the chord being fingered.")
(translator-property-description 'forceClef boolean? "Show clef symbol, even if it hasn't changed. Only active for the first clef after the property is set, not for the full staff.")
sys.stderr.write ("context-spec-music takes a symbol for the context now. Update by hand."
raise FatalConversionError()
+ str = re.sub ('fingerHorizontalDirection *= *#(LEFT|-1)',
+ "fingeringOrientations = #'(up down left)", str)
+ str = re.sub ('fingerHorizontalDirection *= *#(RIGHT|1)',
+ "fingeringOrientations = #'(up down right)", str)
+
return str
- conversions.append (((1,9,3), conv, """\acciaccatura misspelling"""))
+ conversions.append (((1,9,3), conv,
+ """\acciaccatura misspelling, fingerHorizontalDirection -> fingeringOrientations"""))
+
+
+
################################
# END OF CONVERSIONS