+
+2002-09-09 Juergen Reuter <reuter@ipd.uka.de>
+
+ * input/test/accid.ly: updated test file to show all available
+ accidentals styles
+
+ * lily/accidental.cc, lily/key-signature-interface.cc,
+ lily/include/accidental-interface.hh: added method
+ get_fontcharname() to provide proper fall-back cases for missing
+ accidentals; print warning if font char lookup fails
+
+ * lily/time-signature.cc: fixed documentation bug
+
2002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* lily/musical-request.cc: do ADD_MUSIC for String_number_req.
* lily/include/music-iterator.hh (class Music_iterator): smobify
music-iterator; many changes throughout. They are now constructed
- through procedures that return the smobbed iterator.
+ through procedures that return to the smobbed iterator.
* lily/include/*.hh: all derived_mark() functions are now const.
* Documentation/user/refman.itely: very minor corrections and
rephrasing of the reference manual -- revision up to line #400.
+ * Documentation/user/refman.itely: replaced all occurrence "staffs"
+ with "staves".
+
2002-09-07 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* lily/lexer.ll: scan E_DIGIT
moving the tie-engraver into the Thread context and turning on and off
ties per Thread.
-Switching staffs when a tie is active will not work.
+Switching staves when a tie is active will not work.
@node Automatic note splitting
@subsection Automatic note splitting
You are encouraged to use @code{\repeat} for repetitions. See
@ref{Repeats}.
-In scores with many staffs, the barlines are automatically placed at
-top level, and they are connected between different staffs of a
+In scores with many staves, the barlines are automatically placed at
+top level, and they are connected between different staves of a
@internalsref{StaffGroup}:
@lilypond[fragment, verbatim]
< \context StaffGroup <
@refbugs
-Auto knee beams can not be used together with hara kiri staffs.
+Auto knee beams can not be used together with hara kiri staves.
[TODO from bugs]
@end lilypond
The placement of these grace notes is synchronized between different
-staffs, using this grace timing.
+staves, using this grace timing.
@lilypond[relative=2,verbatim,fragment]
< \context Staff = SA { e4 \grace { c16 d e f } e4 }
Grace note synchronization can also lead to surprises. Staff notation,
such as key signatures, barlines, etc. are also synchronized. Take
-care when you mix staffs with grace notes and staffs without.
+care when you mix staves with grace notes and staves without.
@lilypond[relative=2,verbatim,fragment]
< \context Staff = SA { e4 \bar "|:" \grace c16 d4 }
@subsection Vertical spacing
@cindex vertical spacing
-@cindex distance between staffs
+@cindex distance between staves
@cindex staff distance
@cindex between staves, distance
The height of each system is determined automatically by lilypond, to
keep systems from bumping into each other, some minimum distances are
-set. By changing these, you can put staffs closer together, and thus
+set. By changing these, you can put staves closer together, and thus
put more systems onto one page.
Normally staves are stacked vertically. To make
@internalsref{VerticalAlignment} object, which lives at
@internalsref{Score} level.
-The piano staffs are handled a little differently: to make cross-staff
+The piano staves are handled a little differently: to make cross-staff
beaming work correctly, it necessary that the distance between staves
is fixed. This is also done with a @internalsref{VerticalAlignment}
object, created in @internalsref{PianoStaff}, but a forced distance is
VerticalAlignment \override #'forced-distance = #9
@}
@end example
-This would bring the staffs together at a distance of 9 staff spaces,
+This would bring the staves together at a distance of 9 staff spaces,
and again this is measured from the center line of each staff.
\score {
\context Voice \notes\relative c {
\time 3/4
- cisis'' cisis! cisis? |
+ \property Staff.Accidental \set #'style = #'default
+ cisis''^"Accidental style = \#'default" cisis! cisis? |
+ cis cis! cis? |
+ c c! c? |
+ ces ces! ces? |
+ ceses ceses! ceses? |
+ \break
+
+ \property Staff.Accidental \set #'style = #'hufnagel
+ cisis^"Accidental style = \#'hufnagel" cisis! cisis? |
+ cis cis! cis? |
+ c c! c? |
+ ces ces! ces? |
+ ceses ceses! ceses? |
+ \break
+
+ \property Staff.Accidental \set #'style = #'medicaea
+ cisis^"Accidental style = \#'medicaea" cisis! cisis? |
+ cis cis! cis? |
+ c c! c? |
+ ces ces! ces? |
+ ceses ceses! ceses? |
+ \break
+
+ \property Staff.Accidental \set #'style = #'vaticana
+ cisis^"Accidental style = \#'vaticana" cisis! cisis? |
+ cis cis! cis? |
+ c c! c? |
+ ces ces! ces? |
+ ceses ceses! ceses? |
+ \break
+
+ \property Staff.Accidental \set #'style = #'mensural
+ cisis^"Accidental style = \#'mensural" cisis! cisis? |
cis cis! cis? |
c c! c? |
ces ces! ces? |
return boxes;
}
+/*
+ * Some styles do not provide all flavours of accidentals, e.g. there
+ * is currently no sharp accidental in vaticana style. In these cases
+ * this function falls back to one of the other styles.
+ */
+String
+Accidental_interface::get_fontcharname(String style, int alteration)
+{
+ if (style == "hufnagel")
+ switch (alteration)
+ {
+ case -2: return "-2";
+ case -1: return "hufnagel-1";
+ case 0: return "vaticana0";
+ case 1: return "mensural1";
+ case 2: return "2";
+ }
+ if (style == "medicaea")
+ switch (alteration)
+ {
+ case -2: return "-2";
+ case -1: return "medicaea-1";
+ case 0: return "vaticana0";
+ case 1: return "mensural1";
+ case 2: return "2";
+ }
+ if (style == "vaticana")
+ switch (alteration)
+ {
+ case -2: return "-2";
+ case -1: return "vaticana-1";
+ case 0: return "vaticana0";
+ case 1: return "mensural1";
+ case 2: return "2";
+ }
+ if (style == "mensural")
+ switch (alteration)
+ {
+ case -2: return "-2";
+ case -1: return "mensural-1";
+ case 0: return "vaticana0";
+ case 1: return "mensural1";
+ case 2: return "2";
+ }
+ if (style == "neo_mensural")
+ style = ""; // currently same as default
+ if (style == "default")
+ style = "";
+ return style + to_string (alteration);
+}
+
MAKE_SCHEME_CALLBACK (Accidental_interface,brew_molecule,1);
SCM
Accidental_interface::brew_molecule (SCM smob)
Grob *me = unsmob_grob (smob);
bool smaller = false;
bool parens = false;
-
+
bool caut = to_boolean (me->get_grob_property ("cautionary"));
if (caut)
{
parens = gh_equal_p (cstyle, ly_symbol2scm ("parentheses"));
smaller = gh_equal_p (cstyle, ly_symbol2scm ("smaller"));
}
-
+
SCM scm_style = me->get_grob_property ("style");
String style;
if (gh_symbol_p (scm_style))
{
/*
preferably no name for the default style.
- */
+ */
style = "";
}
-
Font_metric *fm = 0;
if (smaller)
{
Molecule mol;
for (SCM s = me->get_grob_property ("accidentals");
- gh_pair_p (s); s= gh_cdr (s))
+ gh_pair_p (s); s = gh_cdr (s))
{
- SCM entry = gh_car (s);
-
-
- Molecule acc (fm->find_by_name (String ("accidentals-") +
- style +
- to_string (gh_scm2int(entry))));
-
- mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1);
+ int alteration = gh_scm2int (gh_car (s));
+ String font_char = get_fontcharname (style, alteration);
+ Molecule acc (fm->find_by_name ("accidentals-" + font_char));
+
+ if (acc.empty_b())
+ {
+ me->warning (_f ("accidental `%s' not found", font_char));
+ }
+ else
+ {
+ mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1);
+ }
}
if (parens)
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
static bool has_interface (Grob*);
+ static String get_fontcharname(String style, int alteration);
static Array<Box> Accidental_interface::accurate_boxes (Grob *me,Grob**common);
};
#include "lookup.hh"
#include "lily-guile.hh"
#include "lily-proto.hh"
-
+#include "accidental-interface.hh"
struct Key_signature_interface
{
Grob*me =unsmob_grob (smob);
Real inter = Staff_symbol_referencer::staff_space (me)/2.0;
-
+
SCM scm_style = me->get_grob_property ("style");
String style;
if (gh_symbol_p (scm_style))
Molecule mol;
SCM c0s = me->get_grob_property ("c0-position");
- int c0p=0;
+ int c0p = 0;
if (gh_number_p (c0s))
- c0p = gh_scm2int (c0s);
+ c0p = gh_scm2int (c0s);
/*
SCM lists are stacks, so we work from right to left, ending with
the cancellation signature.
*/
+ Font_metric *fm = Font_interface::get_default_font (me);
for (SCM s = newas; gh_pair_p (s); s = ly_cdr (s))
{
- SCM what = ly_caar (s);
- int alter = gh_scm2int (ly_cdar (s));
- int pos = alteration_pos (what, alter, c0p);
-
- Molecule m = Font_interface::get_default_font (me)->
- find_by_name (String ("accidentals-") + style + to_string (alter));
- m.translate_axis (pos * inter, Y_AXIS);
- mol.add_at_edge (X_AXIS, LEFT, m, 0);
+ int alteration = gh_scm2int (ly_cdar (s));
+ String font_char =
+ Accidental_interface::get_fontcharname (style, alteration);
+ Molecule acc (fm->find_by_name ("accidentals-" + font_char));
+
+ if (acc.empty_b())
+ {
+ me->warning (_f ("accidental `%s' not found", font_char));
+ }
+ else
+ {
+ SCM what = ly_caar (s);
+ int pos = alteration_pos (what, alteration, c0p);
+ acc.translate_axis (pos * inter, Y_AXIS);
+ mol.add_at_edge (X_AXIS, LEFT, acc, 0);
+ }
}
Item *it = dynamic_cast<Item*> (me) ;
|| ly_cdr (found) != ly_cdar (old))
{
SCM what = ly_caar (old);
- int alter = 0;
- int pos = alteration_pos (what, alter, c0p);
+ int alteration = 0;
+ int pos = alteration_pos (what, alteration, c0p);
Molecule m = natural;
m.translate_axis (pos* inter, Y_AXIS);
4/4 and 2/2 are typeset as C and struck C, respectively. All
other time signatures are written with two digits.
- @item @code{old}
+ @item @code{neo_mensural}
2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
- typeset with old-style mensuration marks. All other time
+ typeset with neo-mensural style mensuration marks. All other time
+ signatures are written with two digits.
+
+ @item @code{mensural}
+ 2/2, 3/2, 2/4, 3/4, 4/4, 6/4, 9/4, 4/8, 6/8 and 9/8 are
+ typeset with mensural style mensuration marks. All other time
signatures are written with two digits.
@item @code{1xxx}
All time signatures are typeset with a single
digit, e.g. 3/2 is written as 3. (Any symbol starting
with the digit @code{1} will do.)
-
- @item @code{C}@var{M}@code{/}@var{N},
-@code{old}@var{M}@code{/}@var{N} or
- @code{old6/8alt}
- Tells LilyPond to use a specific symbol as time signature,
- regardless of the actual time signature.
@end table
See also the test-file @file{input/test/time.ly}.