From 63bd790abbe3fa267409b515c63796cae37e5ad9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Reuter?= Date: Wed, 21 May 2003 21:43:18 +0000 Subject: [PATCH] * lily/gregorian-ligature-engraver.cc, lily/vaticana-ligature-engraver.cc, lily/include/gregorian-ligature.hh, ly/gregorian-init.ly, mf/parmesan-heads.mf: various semivocalis related bugfixes * input/bugs/ligatures.ly: new file demonstrating problems with ligatures --- ChangeLog | 10 + input/bugs/ligatures.ly | 366 ++++++++++++++++++++++++++++ lily/gregorian-ligature-engraver.cc | 26 +- lily/include/gregorian-ligature.hh | 1 - lily/vaticana-ligature-engraver.cc | 50 ++-- ly/gregorian-init.ly | 4 +- mf/parmesan-heads.mf | 17 +- 7 files changed, 435 insertions(+), 39 deletions(-) create mode 100644 input/bugs/ligatures.ly diff --git a/ChangeLog b/ChangeLog index 65ede91751..aa94afd723 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-05-21 Juergen Reuter + + * lily/gregorian-ligature-engraver.cc, + lily/vaticana-ligature-engraver.cc, + lily/include/gregorian-ligature.hh, ly/gregorian-init.ly, + mf/parmesan-heads.mf: various semivocalis related bugfixes + + * input/bugs/ligatures.ly: new file demonstrating problems with + ligatures + 2003-05-21 Heikki Junes * lilypond-mode.el, diff --git a/input/bugs/ligatures.ly b/input/bugs/ligatures.ly new file mode 100644 index 0000000000..99ea7247cf --- /dev/null +++ b/input/bugs/ligatures.ly @@ -0,0 +1,366 @@ +\version "1.7.17" +\header { + title = "Puer natus est nobis" + subtitle = "Antiphona ad introitum VII" + texidoc = "This file pretty nicely demonstrates what still does +not work among ligatures: (i) horozontal spacing is totally broken as +soon as raggedright mode is on (say \"raggedright = ##f\" in the paper +block to see); (ii) the clef does not show on each line; (iii) lily +crashes when removing Stem_engraver, but still using Slur_engraver +(this is useful needed for the \addlyrics feature when no slurs are to +be typeset); (iv) episem causes a syntax error when applied inside of +ligatures (but they are useful only inside...); (v) support for +augmentum dots is missing; (vi) accidentals must be placed before the +ligature (not demonstrated in this example)" + +} + +\include "paper26.ly" +\include "gregorian-init.ly" + +cantus = \notes \transpose c c { + \[ g4 + ( + \pes + ) + d' + \] + d' + \[ d' + ( + \pes e' \flexa + ) + d' + \] + c' + \[ c' + ( + c' + ) + c' + \] + \[ d' + ( + \flexa c' e' \flexa + ) + d' d' + \] + \divisioMaior + \[ g + ( + \pes + ) + d' + \] + \[ d' + ( + \pes e' \flexa + ) + d' + \] + \[ c' + ( + \flexa + ) + b + \] + a + \[ c' + ( + c' \pes + ) + d' + \] + c' c' + \[ c' + ( + \pes d' \flexa c' + ) + c' + \] + \[ g + ( + \pes a \flexa + ) + g + \] + \divisioMaxima + g a c' \[ b + ( + \pes d' e' \pes + ) + f' + \] + \[ d' + ( + \flexa + ) + c' + \] + c' + \divisioMinima + c' c' + \[ d' + ( + \flexa c' e' \flexa + ) + d' + \] + \[ c' + ( + \flexa + ) + b + \] + \[ c' + ( + c' + ) + c' + \] + \[ c' + ( + \flexa a c' \flexa b \virga c' + \inclinatum \deminutum b \inclinatum \deminutum + ) + a + \] + \[ b + ( + \flexa + ) + a + \] + \divisioMaxima + \[ c' + ( + \flexa + ) + b + \] + c' + \[ c' + ( + \pes + e' + \flexa + ) + d' + \] + c' + \[ c' + ( + c' + ) + c' + \] + c' + \[ c' + ( + c' + ) + c' + \] + \[ c' + ( + \pes + d' \flexa b \virga c' + \inclinatum \deminutum b \inclinatum \deminutum + ) + a + \] + \[ b + ( + \flexa + ) + a + \] + \divisioMaior + \[ c' + ( + \pes + ) + e' + \] + d' + \[ g + ( + \pes \semivocalis % epiphonus + ) + c' + \] + c' + \[ c' + ( + c' c' \flexa + ) + a + \] + a + \[ %{ FIXME: \episemInitium%} a + ( + \pes c' \flexa %{ FIXME: \episemFinis%} a \quilisma b + ) + c' + \] + \[ g + ( + \pes a \flexa + ) + g + \] + g + \finalis +} + +verba = \context Lyrics = verba \lyrics { + Pu- er na- tus est no- bis, + et fi- li- us da- tus est no- bis: + cu- ius im- pe- ri- um + su- per hu- me- rum e- ius: + et vo- ca- bi- tur no- men e- ius, + mag- ni con- si- li- i An- ge- lus. + Can- ta- te Do- mi- no can- ti- cum no- vum: + qui- a mi- ra- bi- li- a fe- cit. +} + +\score { + \context StaffGroup < + \context VaticanaStaff < + \context VaticanaVoice < + \addlyrics + \cantus + \verba + > + > +% \context Staff < +% \cantus +% > + > + \paper { + stafflinethickness = \staffspace / 5.0 + linewidth = 137.0 +% width = 137.0 + indent = 0.0 + raggedright = ##f + packed = ##t + +% width = 15.0 \cm %%% no effect? +% gourlay_maxmeasures = 30. +% gourlay_maxmeasures = 1. %%% no effect? +% arithmetic_basicspace = 3.8 +% arithmetic_basicspace = 0.0 %%% no effect? +% arithmetic_multiplier = 8.\pt +% arithmetic_multiplier = 0.\pt %%% no effect? +% + \translator { + \VoiceContext + \name VaticanaVoice + \alias Voice + + % Can not `\remove "Slur_engraver"', since \addlyrics needs + % slurs working. Hence, set slurs transparent instead. + Slur \override #'transparent = ##t + + % N.B.: Warnings of the type "Degenerate bow: infinite steepness + % reqd" arise from the fact that all noteheads of a ligature are + % in the same paper column. Therefore, the (transparent) slurs + % often start and end in the same column, producing the above + % warning. TODO: supress this warning; we need slurs only for + % \addlyrics, not for printing. + + % `\remove "Stem_engraver"' currently produces a crash (see + % below). Hence, set stems transparent instead. + Stem \set #'transparent = ##t + +%{ + +FIXME: + +When removing Stem_engraver from VoiceContext (but still using +Slur_engraver), lily will crash while trying to typeset slurs, since +`()' is not a valid stem: + +In unknown file: + ?: 0* [Slur::after_line_breaking #] + ?: 1* [# # -1] +In /home/reuter/project/lilypond-1.7/share/lilypond/scm/slur.scm: + 43: 2* [not ... + 43: 3* [attached-to-stem # -1] + 10: 4 (let* ((note-columns #) (col #) (stem #)) (and (eq? col #) stem ...)) + ... + 16: 5 [ly:get-grob-property () heads] + +/home/reuter/project/lilypond-1.7/share/lilypond/scm/slur.scm:16:6: In procedure ly_get_grob_property in expression (ly:get-grob-property stem (quote heads)): +/home/reuter/project/lilypond-1.7/share/lilypond/scm/slur.scm:16:6: Wrong type argument in position 1 (expecting grob): () + +%} + + \remove Ligature_bracket_engraver + \consists Vaticana_ligature_engraver + NoteHead \set #'style = #'vaticana_punctum + Script \set #'padding = #0.0 + + % prepare TextSpanner for \episem{Initium|Finis} use + TextSpanner \set #'type = #'line + TextSpanner \set #'edge-height = #'(0 . 0) + TextSpanner \set #'padding = #0.5 + TextSpanner \set #'edge-text = #'("" . "") + } + \translator { + \VoiceContext + \name GregorianTransciptionVoice + \alias Voice + Stem \set #'transparent = ##t + % \remove "Stem_engraver" + % Slur \override #'transparent = ##t + \remove "Slur_engraver" + } + \translator { + \StaffContext + \name GregorianTranscriptionStaff + \alias Staff + \accepts GregorianTranscriptionVoice + BarLine \override #'transparent = ##t + } + \translator { + \StaffContext + \name VaticanaStaff + \alias Staff + \accepts VaticanaVoice + \remove Bar_engraver + \consists Custos_engraver + clefGlyph = #"clefs-vaticana_do" + centralCPosition = #0 + clefPosition = #1 + clefOctaviation = #0 + StaffSymbol \set #'line-count = #4 + StaffSymbol \set #'width = #60.0 % FIXME: unit should be \linewidth + TimeSignature \set #'transparent = ##t + KeySignature \set #'style = #'vaticana + Accidental \set #'style = #'vaticana + Custos \set #'style = #'vaticana + Custos \set #'neutral-position = #3 + Custos \set #'neutral-direction = #-1 + Custos \set #'adjust-if-on-staffline = ##t + } + \translator { + \HaraKiriStaffContext + \accepts VaticanaVoice + \accepts GregorianTranscriptionVoice + } + \translator { + \ScoreContext + \accepts VaticanaStaff + \accepts GregorianTranscriptionStaff + \remove Bar_number_engraver +% SpacingSpanner \set #'spacing-increment = #0.5 + timing = ##f + + % Don't do this exception for transcription -- it will produce + % additional space + barAlways = ##t +% skipBars = ##t + } + } +} diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index ca09fe88fb..68cc9ceb7c 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -76,8 +76,7 @@ void fix_prefix_set (int *current_set, int min_set, int max_set, Grob *primitive fix_prefix ("ascendens", ASCENDENS, current_set, min_set, max_set, primitive); fix_prefix ("oriscus", ORISCUS, current_set, min_set, max_set, primitive); fix_prefix ("quilisma", QUILISMA, current_set, min_set, max_set, primitive); - fix_prefix ("deminutus", DEMINUTUM, current_set, min_set, max_set, primitive); - fix_prefix ("semivocalis", SEMIVOCALIS, current_set, min_set, max_set, primitive); + fix_prefix ("deminutum", DEMINUTUM, current_set, min_set, max_set, primitive); fix_prefix ("cavum", CAVUM, current_set, min_set, max_set, primitive); fix_prefix ("linea", LINEA, current_set, min_set, max_set, primitive); fix_prefix ("pes_or_flexa", LINEA, current_set, min_set, max_set, primitive); @@ -101,13 +100,12 @@ void check_and_fix_all_prefixes (Array primitives) (ORISCUS * to_boolean (primitive->get_grob_property ("oriscus"))) | (QUILISMA * to_boolean (primitive->get_grob_property ("quilisma"))) | (DEMINUTUM * to_boolean (primitive->get_grob_property ("deminutum"))) | - (SEMIVOCALIS * to_boolean (primitive->get_grob_property ("semivocalis"))) | (CAVUM * to_boolean (primitive->get_grob_property ("cavum"))) | (LINEA * to_boolean (primitive->get_grob_property ("linea"))) | (PES_OR_FLEXA * to_boolean (primitive->get_grob_property ("pes-or-flexa"))); /* check: ascendens and descendens exclude each other; same with - auctum and diminutum */ + auctum and deminutum */ if (prefix_set & DESCENDENS) { fix_prefix_set (&prefix_set, @@ -156,17 +154,8 @@ void check_and_fix_all_prefixes (Array primitives) primitive); } - /* check: semivocalis must occur in combination with and only with - pes or flexa */ - if (prefix_set & SEMIVOCALIS) - { - fix_prefix_set (&prefix_set, - SEMIVOCALIS | PES_OR_FLEXA, - SEMIVOCALIS | PES_OR_FLEXA, - primitive); - } - /* check: inclinatum may be prefixed with auctum or diminutum only */ + /* check: inclinatum may be prefixed with auctum or deminutum only */ if (prefix_set & INCLINATUM) { fix_prefix_set (&prefix_set, @@ -174,6 +163,15 @@ void check_and_fix_all_prefixes (Array primitives) INCLINATUM | AUCTUM | DEMINUTUM, primitive); } + /* check: semivocalis (deminutum but not inclinatum) must occur in + combination with and only with pes or flexa */ + else if (prefix_set & DEMINUTUM) + { + fix_prefix_set (&prefix_set, + DEMINUTUM | PES_OR_FLEXA, + DEMINUTUM | PES_OR_FLEXA, + primitive); + } /* check: cavum and linea (either or both) may be applied only upon core punctum */ diff --git a/lily/include/gregorian-ligature.hh b/lily/include/gregorian-ligature.hh index 379506d846..801b34dbf0 100644 --- a/lily/include/gregorian-ligature.hh +++ b/lily/include/gregorian-ligature.hh @@ -27,7 +27,6 @@ #define ORISCUS 0x0040 // attribute "\oriscus" #define QUILISMA 0x0080 // attribute "\quilisma" #define DEMINUTUM 0x0100 // attribute "\deminutum" -#define SEMIVOCALIS 0x0100 // attribute "\semivocalis" #define CAVUM 0x0200 // attribute "\cavum" #define LINEA 0x0400 // attribute "\linea" #define PES_OR_FLEXA 0x0800 // operator "\~" diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 22c05494c1..069550471c 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -65,27 +65,40 @@ Vaticana_ligature_engraver::finish_primitive (Item *first_primitive, { Real next_distance = distance; if (primitive) - { - // determine width of previous head and x-offset + { // determine width of previous head and x-offset Real head_width; Real x_offset; bool is_stacked; + + // upper head of pes is stacked upon lower head of pes ... is_stacked = context_info & PES_UPPER; + + // ... unless this note starts a flexa if (context_info & FLEXA_LEFT) is_stacked = false; - if (!String::compare (glyph_name, "vaticana_cephalicus") && - !(context_info & PES_LOWER)) - is_stacked = true; + + // auctum head is never stacked upon preceding note if (context_info & AUCTUM) is_stacked = false; + + // semivocalis head of epiphonus or cephalicus is stacked upon + // preceding head + if (!String::compare (glyph_name, "vaticana_plica")) + is_stacked = true; // semivocalis head of epiphonus + if (!String::compare (glyph_name, "vaticana_reverse_plica")) + if (context_info & PES_LOWER) + {} // initio debilis => not stacked + else + is_stacked = true; // semivocalis head of cephalicus + if (is_stacked) { /* - * This head is stacked upon another one; hence, it does not - * contribute to the total width of the ligature, hence its - * width is assumed to be 0.0. Moreover, it is shifted to - * the left by its width such that the right side of this - * and the other head are horizontally aligned. + * This head is stacked upon the previous one; hence, it + * does not contribute to the total width of the ligature, + * and its width is assumed to be 0.0. Moreover, it is + * shifted to the left by its width such that the right side + * of this and the other head are horizontally aligned. */ head_width = 0.0; x_offset = join_thickness - @@ -237,10 +250,6 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, if (prefix_set & AUCTUM) glyph_name = "solesmes_stropha_aucta"; else glyph_name = "solesmes_stropha"; - else if (prefix_set & SEMIVOCALIS) - if (pitch > prev_pitch) - glyph_name = "vaticana_epiphonus"; - else glyph_name = "vaticana_cephalicus"; else if (prefix_set & INCLINATUM) if (prefix_set & AUCTUM) glyph_name = "solesmes_incl_auctum"; @@ -248,6 +257,17 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, glyph_name = "solesmes_incl_parvum"; else glyph_name = "vaticana_inclinatum"; + else if (prefix_set & DEMINUTUM) + if (pitch > prev_pitch) + { + prev_glyph_name = "vaticana_epiphonus"; + glyph_name = "vaticana_plica"; + } + else + { + prev_glyph_name = "vaticana_cephalicus"; + glyph_name = "vaticana_reverse_plica"; + } else if (prefix_set & (CAVUM | LINEA)) if ((prefix_set & CAVUM) && (prefix_set & LINEA)) glyph_name = "vaticana_linea_punctum_cavum"; @@ -260,8 +280,6 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, glyph_name = "solesmes_auct_asc"; else glyph_name = "solesmes_auct_desc"; - else if (prefix_set & DEMINUTUM) - glyph_name = "vaticana_plica"; else if ((prefix_set & PES_OR_FLEXA) && (context_info & PES_LOWER) && (context_info & FLEXA_RIGHT)) diff --git a/ly/gregorian-init.ly b/ly/gregorian-init.ly index 98348df6e4..b61397c62b 100644 --- a/ly/gregorian-init.ly +++ b/ly/gregorian-init.ly @@ -25,12 +25,12 @@ pes = \once \property Voice.NoteHead \override #'pes-or-flexa = ##t flexa = \once \property Voice.NoteHead \override #'pes-or-flexa = ##t -semivocalis = - \once \property Voice.NoteHead \override #'semivocalis = ##t oriscus = \once \property Voice.NoteHead \override #'oriscus = ##t quilisma = \once \property Voice.NoteHead \override #'quilisma = ##t +semivocalis = + \once \property Voice.NoteHead \override #'deminutum = ##t deminutum = \once \property Voice.NoteHead \override #'deminutum = ##t diff --git a/mf/parmesan-heads.mf b/mf/parmesan-heads.mf index 38d6b97d8f..b686dc2503 100644 --- a/mf/parmesan-heads.mf +++ b/mf/parmesan-heads.mf @@ -287,7 +287,7 @@ def punctum_char (expr verbose_name, internal_name, ly_name, a_w := 1.09; save a, beta, ht, wd; - ht# = noteheight#; %% * mag; + ht# = noteheight# * mag; 2beta# = ht# * b_h; a# = beta# * a_b; wd# = 2a# / a_w; @@ -532,20 +532,25 @@ punctum_char("Ed. Vat. var pes upper punctum", "vaticana_vupes", false, false, false, false, true, false, false, false, true, 1.0); -% small punctum as used in epiphonus/cephalicus +% small punctum as used in epiphonus punctum_char("Ed. Vat. plica", "vaticana_plica", "vatplicahead", - false, false, false, false, true, - false, false, false, false, 0.5); + false, false, false, false, false, + false, false, false, false, 0.7); % excentric punctum as used in epiphonus punctum_char("Ed. Vat. epiphonus", "vaticana_epiphonus", "vatepiphonushead", false, false, false, false, false, false, true, true, false, 1.0); +% small punctum as used in cephalicus +punctum_char("Ed. Vat. rev. plica", "vaticana_reverse_plica", "vatrplicahead", + false, false, false, false, false, + false, true, false, false, 0.7); + % excentric punctum as used in cephalicus punctum_char("Ed. Vat. cephalicus", "vaticana_cephalicus", "vatcephalicushead", - false, false, false, false, false, + true, false, false, false, false, false, false, true, false, 1.0); % quilisma @@ -617,7 +622,7 @@ fet_beginchar("Solesmes oriscus", "solesmes_oriscus", a_w := 1.09; save a, beta, ht, wd; - ht# = noteheight#; %% * mag; + ht# = noteheight#; 2beta# = ht# * b_h; a# = beta# * a_b; wd# = 2a# / a_w; -- 2.39.2