+2002-09-01 Juergen Reuter <reuter@ipd.uka.de>
+
+ * input/test/ancient-font.ly, input/test/ancient-time.ly,
+ input/test/mensural-ligatures.ly, lily/ligature-head.cc,
+ lily/mensural-ligature-engraver.cc, lily/note-head.cc,
+ lily/time-signature.cc, scm/output-lib.scm: removed obsolete
+ code that sets grob property font-family; also small updates to
+ various input/test files.
+
2002-09-01 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* input/test/tab-staff.ly: removed.
#'line-count = #4
\notes \transpose c' {
- \property Staff.Clef \set #'font-family = #'ancient
- \property Staff.KeySignature \set #'font-family = #'ancient
\property Staff.KeySignature \override #'style = #'vaticana
- \property Staff.Accidental \set #'font-family = #'ancient
\property Staff.Accidental \override #'style = #'vaticana
- \property Voice.NoteHead \set #'font-family = #'ancient
\property Voice.NoteHead \override #'style = #'vaticana_punctum
\key es \major
\clef "vaticana_fa2"
#'line-count = #5
\notes \transpose c' {
- \property Staff.Clef \set #'font-family = #'ancient
\property Voice.autoBeaming = ##f
- \property Voice.NoteHead \set #'font-family = #'ancient
\property Voice.NoteHead \override #'style = #'neo_mensural
- \property Voice.Stem \set #'font-family = #'ancient % ancient flags
- \property Voice.Rest \set #'font-family = #'music
\property Voice.Rest \override #'style = #'neo_mensural
\key a \major
\property Voice.NoteHead \override #'style = #'mensural
\property Voice.Stem \override #'style = #'mensural
\property Voice.Stem \override #'thickness = #1.0
- \property Voice.Rest \set #'font-family = #'ancient
\property Voice.Rest \override #'style = #'mensural
\clef "petrucci_f"
c8 b, c16 b, c32 b, c64 b, c64 b,
% segmentation fault on r8/r16/r32. (Strange: what has
% Voice.Stem style to do with mensural rests?)
\property Voice.Stem \override #'style = #'neo_mensural
- r2 r4 r8 r16 r32 r32
+ r2 r4 r8 r16 r16
\property Voice.Stem \override #'style = #'mensural
\property Staff.forceClef = ##t
\clef "mensural_f"
\alias Voice
\remove Ligature_bracket_engraver
\consists Mensural_ligature_engraver
- NoteHead \set #'font-family = #'ancient
NoteHead \set #'style = #'mensural
- Stem \set #'font-family = #'ancient
% Stem \set #'style = #'mensural %%%%%%%% FIXME: this core dumps
Stem \set #'thickness = #1.0
- Rest \set #'font-family = #'music
Rest \set #'style = #'mensural
autoBeaming = ##f
}
\alias Voice
\remove Ligature_bracket_engraver
% \consists Gregorian_ligature_engraver %%%%%%%% TODO: not yet implemented
- NoteHead \set #'font-family = #'ancient
NoteHead \set #'style = #'vaticana_punctum
autoBeaming = ##f
}
\alias Staff
\accepts MensuralVoice
\consists Custos_engraver
- TimeSignature \set #'font-family = #'ancient
TimeSignature \set #'style = #'mensural
- KeySignature \set #'font-family = #'ancient
KeySignature \set #'style = #'mensural
- Accidental \set #'font-family = #'ancient
Accidental \set #'style = #'mensural
- Custos \set #'font-family = #'ancient
Custos \set #'style = #'mensural
Custos \set #'neutral-position = #3
Custos \set #'neutral-direction = #-1
Custos \set #'adjust-if-on-staffline = ##t
- Clef \set #'font-family = #'ancient
clefGlyph = #"clefs-petrucci_c2"
clefPosition = #-2
clefOctavation = #0
\remove Time_signature_engraver
StaffSymbol \set #'thickness = #2.0
StaffSymbol \set #'line-count = #4
- KeySignature \set #'font-family = #'ancient
KeySignature \set #'style = #'vaticana
- Accidental \set #'font-family = #'ancient
Accidental \set #'style = #'vaticana
- Custos \set #'font-family = #'ancient
Custos \set #'style = #'vaticana
Custos \set #'neutral-position = #4
Custos \set #'neutral-direction = #-1
Custos \set #'adjust-if-on-staffline = ##t
- Clef \set #'font-family = #'ancient
clefGlyph = #"clefs-vaticana_do"
clefPosition = #1
clefOctavation = #0
\score {
\notes {
- \property Staff.TimeSignature \override #'style = #'oldC4/4
- \property Staff.TimeSignature \override #'font-family = #'ancient
+ \property Staff.TimeSignature \override #'style = #'neo_mensural
s1
}
}
\include "paper26.ly"
-% Note the horizontal alignment of the fermatas that obeys to the
+% Note that the horizontal alignment of the fermatas obeys to the
% graphical width of the ligatures rather to the musical moment in time.
% This is intended behaviour.
voice = \notes \transpose c'' {
\property Score.timing = ##f
\property Score.defaultBarType = "empty"
- \property Voice.NoteHead \set #'font-family = #'ancient
- \property Voice.NoteHead \override #'style = #'mensural
g\longa c\breve a\breve f\breve d'\longa^\fermata
\bar "|"
\[
\bar "||"
}
-upperStaff = \context Staff = upperStaff <
- \context MensuralVoice <
- \voice
- >
->
-
-lowerStaff = \context Staff = lowerStaff <
- \context TranscribedVoice <
- \voice
- >
->
-
\score {
\context ChoirStaff <
- \upperStaff
- \lowerStaff
+ \context MensuralStaff = upperStaff <
+ \context MensuralVoice <
+ \voice
+ >
+ >
+ \context Staff = lowerStaff <
+ \context Voice <
+ \voice
+ >
+ >
>
\paper {
stafflinethickness = \staffspace / 5.0
\alias Voice
\remove Ligature_bracket_engraver
\consists Mensural_ligature_engraver
- }
- \translator {
- \VoiceContext
- \name TranscribedVoice
- \alias Voice
- \remove Mensural_ligature_engraver
- \consists Ligature_bracket_engraver
+ NoteHead \set #'style = #'mensural
}
\translator {
\StaffContext
+ \name MensuralStaff
+ \alias Staff
\accepts MensuralVoice
- \accepts TranscribedVoice
- }
+ \consists Custos_engraver
+ TimeSignature \set #'style = #'mensural
+ KeySignature \set #'style = #'mensural
+ Accidental \set #'style = #'mensural
+ Custos \set #'style = #'mensural
+ Custos \set #'neutral-position = #3
+ Custos \set #'neutral-direction = #-1
+ Custos \set #'adjust-if-on-staffline = ##t
+ clefGlyph = #"clefs-petrucci_g"
+ clefPosition = #-2
+ clefOctavation = #-0
+ }
\translator {
\HaraKiriStaffContext
\accepts MensuralVoice
- \accepts TranscribedVoice
}
+ \translator {
+ \ScoreContext
+ \accepts MensuralStaff
+ }
}
}
* "rhythmic-head-interface" in the interfaces list. Otherwise, text
* scripts (such as fermata) are horizontally aligned with the end of
* the ligature rather than with the associated head. Why?
- *
- * TODO: if properties font-family and style are not set properly
- * (e.g. by a user erronously setting font-family to #'music),
- * lilypond currently crashes with the message: "lilypond:
- * ../flower/include/interval.hh:28: Real Interval_t<double>::center()
- * const: Assertion `!empty_b ()' failed.". The code of this class
- * should be clever enough to foresee a potential crash, print a
- * warning, and supply sensible default values that avoid the crash.
*/
MAKE_SCHEME_CALLBACK (Ligature_head,brew_molecule,1);
SCM
gh_scm2double (thickness_scm) : 1.4;
thickness *= finished_ligature_->get_paper ()->get_var ("linethickness");
- /*
- * FIXME: Since character "noteheads--1mensural" is defined in
- * parmesan font only, the right-hand expression in the
- * following assignment evaluates to a width of 0.0, in case
- * font-family of finished_ligature_ is _not_ set to "ancient"
- * (by default, it is; see grob properties of MensuralLigature
- * in scm/grob-description.scm). This may arise severe problems
- * in the future when switching between fonts (e.g. mensural
- * versus neo-mensural).
- */
Real head_width =
Font_interface::get_default_font (finished_ligature_)->
find_by_name ("noteheads--1mensural").extent (X_AXIS).length ();
- if (head_width == 0.0)
- {
- programming_error ("Mensural_ligature_engraver: failed evaluating head_width (most probably a font-family selection problem)");
- }
-
SCM flexa_width_scm =
finished_ligature_->get_grob_property ("flexa-width");
Real flexa_width = (flexa_width_scm != SCM_EOL) ?
}
Molecule
-internal_brew_molecule (Grob *me, bool ledger_take_space)
+internal_brew_molecule (Grob *me, bool ledger_take_space)
{
SCM style = me->get_grob_property ("style");
if (!gh_symbol_p (style))
SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log,
ly_quote_scm (style),
SCM_UNDEFINED);
- SCM scm_pair = scm_primitive_eval (exp);
- SCM scm_font_char = ly_car (scm_pair);
- SCM scm_font_family = ly_cdr (scm_pair);
+ SCM scm_font_char = scm_primitive_eval (exp);
String font_char = "noteheads-" + ly_scm2string (scm_font_char);
- String font_family = ly_scm2string (scm_font_family);
- me->set_grob_property("font-family", ly_symbol2scm (font_family.to_str0 ()));
Font_metric * fm = Font_interface::get_default_font (me);
Molecule out = fm->find_by_name (font_char);
if (out.empty_b())
{
- me->warning (_f ("Symbol `%s' not found in family `%s'",
- font_char.to_str0 (), font_family.to_str0 ()));
+ me->warning (_f ("note head `%s' not found", font_char.to_str0 ()));
}
+
int interspaces = Staff_symbol_referencer::line_count (me)-1;
int pos = (int)rint (Staff_symbol_referencer::get_position (me));
if (abs (pos) - interspaces > 1)
}
Molecule
-Time_signature::special_time_signature (Grob *me, SCM style, int n, int d)
+Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
{
- String st = ly_scm2string (scm_symbol_to_string (style));
- SCM scm_n = gh_int2scm (n);
- SCM scm_d = gh_int2scm (d);
- SCM exp = scm_list_n (ly_symbol2scm ("find-timesig-symbol"),
- scm_n, scm_d, ly_quote_scm (style),
- SCM_UNDEFINED);
- SCM scm_pair = scm_primitive_eval (exp);
- SCM scm_font_char = ly_car (scm_pair);
- SCM scm_font_family = ly_cdr (scm_pair);
- String font_char = ly_scm2string (scm_font_char);
- String font_family = ly_scm2string (scm_font_family);
- me->set_grob_property("font-family", ly_symbol2scm (font_family.to_str0 ()));
-
- Molecule m =
- Font_interface::get_default_font (me)->find_by_name ("timesig-" + font_char);
- if (!m.empty_b ())
- return m;
+ String style = ly_scm2string (scm_symbol_to_string (scm_style));
+
+ if (style == "numbered")
+ return numbered_time_signature (me, n, d);
+
+ if ((style == "default") || (style == ""))
+ style = to_string ("C");
+
+ if (style == "C")
+ {
+ if /* neither C2/2 nor C4/4 */
+ (((n != 2) || (d != 2)) &&
+ ((n != 4) || (d != 4)))
+ {
+ return numbered_time_signature (me, n, d);
+ }
+ }
+
+ String char_name = style + to_string (n) + "/" + to_string (d);
+ me->set_grob_property ("font-family", ly_symbol2scm ("music"));
+ Molecule out =
+ Font_interface::get_default_font (me)->find_by_name ("timesig-" + char_name);
+ if (!out.empty_b ())
+ return out;
/*
- If there is no such symbol, we default without warning to the
- numbered style.
- */
+ If there is no such symbol, we default to the numbered style.
+ (Here really with a warning!)
+ */
+ me->warning (_f ("time signature symbol `%s' not found; "
+ "reverting to numbered style", char_name));
return numbered_time_signature (me, n, d);
}
;; silly, use alist?
(define (find-notehead-symbol duration style)
(case style
- ((xcircle) (cons "2xcircle" "music"))
- ((harmonic) (cons "0neo_mensural" "music"))
+ ((xcircle) "2xcircle")
+ ((harmonic) "0neo_mensural")
((baroque)
;; Oops, I actually would not call this "baroque", but, for
;; backwards compatibility to 1.4, this is supposed to take
;; brevis, longa and maxima from the neo-mensural font and all
;; other note heads from the default font. -- jr
(if (< duration 0)
- (cons (string-append (number->string duration) "neo_mensural") "music")
- (cons (number->string duration) "music")))
+ (string-append (number->string duration) "neo_mensural")
+ (number->string duration)))
((mensural)
- (cons (string-append (number->string duration) (symbol->string style))
- "music"))
+ (string-append (number->string duration) (symbol->string style)))
((neo_mensural)
- (cons (string-append (number->string duration) (symbol->string style))
- "music"))
+ (string-append (number->string duration) (symbol->string style)))
((default)
;; The default font in mf/feta-bolletjes.mf defines a brevis, but
;; neither a longa nor a maxima. Hence let us, for the moment,
;; should look exactly like the brevis of the default font, but
;; with a stem exactly like that of the quarter note. -- jr
(if (< duration -1)
- (cons (string-append (number->string duration) "neo_mensural") "music")
- (cons (number->string duration) "music")))
+ (string-append (number->string duration) "neo_mensural")
+ (number->string duration)))
(else
(if (string-match "vaticana*|hufnagel*|medicaea*" (symbol->string style))
- (cons (symbol->string style) "music")
- (cons (string-append (number->string (max 0 duration))
- (symbol->string style))
- "music")))))
+ (symbol->string style)
+ (string-append (number->string (max 0 duration))
+ (symbol->string style))))))
(define (note-head-style->attachment-coordinates style duration)
'(1.0 . 0.0)
)))
-(define (find-timesig-symbol nom denom style)
- (case style
- ((mensural)
- (cons (string-append
- "mensural"
- (number->string nom)
- "/"
- (number->string denom))
- "ancient"))
- ((neo_mensural)
- (cons (string-append
- "neo_mensural"
- (number->string nom)
- "/"
- (number->string denom))
- "ancient"))
- ((numbered)
- (cons (string-append
- (number->string nom)
- "/"
- (number->string denom))
- "music"))
- (else
- ;; default: use "C" style when possible, otherwise return ""
- (cons
- (case nom
- ((2)
- (case denom
- ((2) "C2/2")
- (else "")))
- ((4)
- (case denom
- ((4) "C4/4")
- (else "")))
- (else ""))
- "music"))))
-
(define (string-encode-integer i)
(cond
((= i 0) "o")