summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex')
-rw-r--r--Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex897
1 files changed, 601 insertions, 296 deletions
diff --git a/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex b/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex
index ef99b7cdeeb..f75dc7af463 100644
--- a/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex
+++ b/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-signs.tex
@@ -1,6 +1,6 @@
%GregorioTeX file.
%
-% Copyright (C) 2007-2016 The Gregorio Project (see CONTRIBUTORS.md)
+% Copyright (C) 2007-2017 The Gregorio Project (see CONTRIBUTORS.md)
%
% This file is part of Gregorio.
%
@@ -22,15 +22,16 @@
\def\grebarbracewidth{.58879}%
-\gre@debugmsg{general}{Loading gregoriotex-signs.tex}%
-\gre@declarefileversion{gregoriotex-signs.tex}{4.1.5}% GREGORIO_VERSION
+\gre@declarefileversion{gregoriotex-signs.tex}{5.0.1}% GREGORIO_VERSION
\def\gre@usestylecommon{%
+ \gre@trace{gre@usestylecommon}%
\ifgre@usestylefont\else %
\gre@usestylefonttrue%
\gre@setstylefont %
\fi %
\relax %
+ \gre@trace@end%
}%
\gresetglyphstyle{default}%
@@ -44,6 +45,7 @@
\gre@disablemorafalse
\def\greprintsigns#1#2{%
+ \gre@trace{greprintsigns{#1}{#2}}%
\IfStrEqCase{#2}{%
{enable}%
{%
@@ -78,6 +80,7 @@
}[% all other cases
\gre@error{Unrecognized second argument for \protect\greprintsigns}%
]%
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -103,6 +106,10 @@
% #1 is the type of discretionary, for penalty assignment. Recognized types:
% - 0: clef change
\def\GreDiscretionary#1#2#3{%
+ \gre@trace{GreDiscretionary{#1}{#2}{#3}}%
+ \gre@save@additionalspaces %
+ \directlua{gregoriotex.adjust_line_height(\gre@insidediscretionary, true)}%
+ \gre@restore@additionalspaces %
\global\let\gre@hskip\kern %
\global\let\gre@penalty\gre@falsepenalty %
\global\xdef\gre@insidediscretionary{\number 1}%
@@ -121,6 +128,7 @@
\global\let\gre@hskip\hskip %
\global\let\gre@penalty\gre@truepenalty %
\relax %
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -132,6 +140,7 @@
\gre@showcleftrue
\def\gresetclef#1{%
+ \gre@trace{gresetclef{#1}}%
\IfStrEqCase{#1}{%
{visible}%
{\gre@showcleftrue}%
@@ -140,22 +149,18 @@
}[% all other cases
\gre@error{Unrecognized option "#1" for \protect\gresetclef\MessageBreak Possible options are: 'visible' and 'invisible'}%
]%
+ \gre@trace@end%
}%
-
-\def\greremoveclef{% OBSOLETE
- \gre@obsolete{\protect\greremoveclef}{\protect\gresetclef{invisible}}%
-}%
-
-\def\grenormalclef{% OBSOLETE
- \gre@obsolete{\protect\grenormalclef}{\protect\gresetclef{visible}}%
-}%
-
-%% marcro to define the clef that will appear at the beginning of the lines
-% the first argument is the type : f or c, and the second is the height
-% the third argument is whether we must type a space after or not (0 if not, 1 if yes)
-% if the fourth argument is 3, it means that we must not put a flat after the key, otherwise it's the height of the flat
+%% macro to define the clef that will appear at the beginning of the lines
+%% #1 c or f: type of first clef
+%% #2 int: line of first clef
+%% #3 int: 0 if not space, 1 if normal space, 2 for short space
+%% #4 int: height of the flat of first clef, 3 for no flat
+%% #5, #6, #7 = #1, #2, #3 for second clef
\def\GreSetLinesClef#1#2#3#4#5#6#7{%
+ \gre@trace{GreSetLinesClef{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
+ \gre@save@clef{#1}{#2}{#4}{#5}{#6}{#7}%
\gre@localleftbox{%
\gre@skip@temp@four = \gre@dimen@additionalleftspace\relax%
\kern\gre@skip@temp@four %
@@ -163,7 +168,7 @@
\unkern %
\ifgre@showclef%
\gre@skip@temp@four = \gre@space@skip@afterclefnospace\relax%
- \hbox{\gre@typeclef{#1}{#2}{0}{#3}{#4}{#5}{#6}{#7}\hskip\gre@skip@temp@four}%
+ \hbox{\gre@typeclef{#1}{#2}{0}{#3}{#4}{#5}{#6}{#7}\gre@hskip\gre@skip@temp@four}%
\else %
\gre@skip@temp@four = \gre@space@dimen@noclefspace\relax%
\hbox{\kern\gre@skip@temp@four}%
@@ -172,37 +177,45 @@
\xdef\gre@clefflatheight{#4}%
\xdef\gre@cleftwoflatheight{#7}%
\relax%
+ \gre@trace@end%
+}%
+
+% defines the largest clef of the score
+% arguments are the same as \GreSetLinesClef except that the #3 of
+% \GreSetLineClef is removed (always 1)
+\def\GreSetLargestClef#1#2#3#4#5#6{%
+ \gre@trace{GreSetLargestClef{#1}{#2}{#3}{#4}{#5}{#6}}%
+ \gre@boxclef{#1}{#2}{0}{1}{#3}{#4}{#5}{#6}%
+ \gre@update@clefwidth@largest{\wd\gre@box@temp@width}%
+ \relax%
}%
\def\gre@save@clef#1#2#3#4#5#6{%
+ \gre@trace{gre@save@clef{#1}{#2}{#3}{#4}{#5}{#6}}%
\global\let\gre@clef=#1\relax%
\xdef\gre@clefheight{#2}%
\xdef\gre@clefflatheight{#3}%
\global\let\gre@cleftwo=#4\relax%
\xdef\gre@cleftwoheight{#5}%
\xdef\gre@cleftwoflatheight{#6}%
+ \gre@trace@end%
}%
%% macro redrawing a key from clefnum, useful for vertical space changes
\def\gre@updatelinesclef{%
+ \gre@trace{gre@updatelinesclef}%
\GreSetLinesClef{\gre@clef}{\gre@clefheight}{1}{\gre@clefflatheight}%
{\gre@cleftwo}{\gre@cleftwoheight}{\gre@cleftwoflatheight}\relax %
+ \gre@trace@end%
}%
\newbox\gre@box@temp@clef%
\newbox\gre@box@temp@cleftwo%
-% macro that typesets the clef
-% arguments are :
-%% #1: the type of the clef : c or f
-%% #2: the line of the clef (1 is the lowest)
-%% #3: if we must use small clef characters (inside a line) or not 0: if not inside, 1 if inside
-%% #4: if we must type a space after or not
-%% #5: if 3, it means that we must not put a flat after the clef, otherwise it's the height of the flat
-%% #6: the type of the secondary clef : c or f
-%% #7: the line of the secondary clef (1 is the lowest)
-%% #8: if 3, it means that we must not put a flat after the secondary clef, otherwise it's the height of the flat
-\def\gre@typeclef#1#2#3#4#5#6#7#8{%
- \setbox\gre@box@temp@width=\hbox{%
+
+% sets \gre@box@temp@width with the clef, the arguments are the same as \gre@typeclef
+\def\gre@boxclef#1#2#3#4#5#6#7#8{%
+ \gre@trace{gre@boxclef{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
+ \global\setbox\gre@box@temp@width=\hbox{%
\ifcase#7%
\gre@typesingleclef{#1}{#2}{#3}{#5}%
\else %
@@ -222,15 +235,111 @@
\fi %
\fi %
}%
+ \gre@trace@end%
+}
+
+\def\gre@saveclefextrema#1#2{%
+ \gre@trace{gre@saveclefextrema{#1}{#2}}%
+ % compute the clef extrema
+ \ifcase#1\or % first@1
+ \global\let\gre@pitch@cleftop\gre@pitch@e %
+ \global\let\gre@pitch@clefbottom\gre@pitch@c %
+ \ifcase#2\or\or % second@2
+ \global\let\gre@pitch@cleftop\gre@pitch@g %
+ \or % second@3
+ \global\let\gre@pitch@cleftop\gre@pitch@i %
+ \or % second@4
+ \global\let\gre@pitch@cleftop\gre@pitch@k %
+ \or % second@5
+ \global\let\gre@pitch@cleftop\gre@pitch@m %
+ \fi %
+ \or % first@2
+ \global\let\gre@pitch@cleftop\gre@pitch@g %
+ \global\let\gre@pitch@clefbottom\gre@pitch@e %
+ \ifcase#2\or % second@1
+ \global\let\gre@pitch@clefbottom\gre@pitch@c %
+ \or\or % second@3
+ \global\let\gre@pitch@cleftop\gre@pitch@i %
+ \or % second@4
+ \global\let\gre@pitch@cleftop\gre@pitch@k %
+ \or % second@5
+ \global\let\gre@pitch@cleftop\gre@pitch@m %
+ \fi %
+ \or % first@3
+ \global\let\gre@pitch@cleftop\gre@pitch@i %
+ \global\let\gre@pitch@clefbottom\gre@pitch@g %
+ \ifcase#2\or % second@1
+ \global\let\gre@pitch@clefbottom\gre@pitch@c %
+ \or % second@2
+ \global\let\gre@pitch@clefbottom\gre@pitch@e %
+ \or\or % second@4
+ \global\let\gre@pitch@cleftop\gre@pitch@k %
+ \or % second@5
+ \global\let\gre@pitch@cleftop\gre@pitch@m %
+ \fi %
+ \or % first@4
+ \global\let\gre@pitch@cleftop\gre@pitch@k %
+ \global\let\gre@pitch@clefbottom\gre@pitch@i %
+ \ifcase#2\or % second@1
+ \global\let\gre@pitch@clefbottom\gre@pitch@c %
+ \or % second@2
+ \global\let\gre@pitch@clefbottom\gre@pitch@e %
+ \or % second@3
+ \global\let\gre@pitch@clefbottom\gre@pitch@g %
+ \or\or % second@5
+ \global\let\gre@pitch@cleftop\gre@pitch@m %
+ \fi %
+ \or % first@5
+ \global\let\gre@pitch@cleftop\gre@pitch@m %
+ \global\let\gre@pitch@clefbottom\gre@pitch@k %
+ \ifcase#2\or % second@1
+ \global\let\gre@pitch@clefbottom\gre@pitch@c %
+ \or % second@2
+ \global\let\gre@pitch@clefbottom\gre@pitch@e %
+ \or % second@3
+ \global\let\gre@pitch@clefbottom\gre@pitch@g %
+ \or % second@4
+ \global\let\gre@pitch@clefbottom\gre@pitch@i %
+ \fi %
+ \fi %
+ \gre@trace@end%
+}%
+
+\def\GreInitialClefPosition#1#2{%
+ \gre@trace{GreInitialClefPosition{#1}{#2}}%
+ \ifgre@showclef %
+ \gre@saveclefextrema{#1}{#2}%
+ \fi %
+ \gre@trace@end%
+}%
+
+% macro that typesets the clef
+% arguments are :
+%% #1: the type of the clef : c or f
+%% #2: the line of the clef (1 is the lowest)
+%% #3: if we must use small clef characters (inside a line) or not 0: if not inside, 1 if inside
+%% #4: 0: no space after, 1: normal space after, 2: short space after
+%% #5: if 3, it means that we must not put a flat after the clef, otherwise it's the height of the flat
+%% #6: the type of the secondary clef : c or f
+%% #7: the line of the secondary clef (1 is the lowest)
+%% #8: if 3, it means that we must not put a flat after the secondary clef, otherwise it's the height of the flat
+\def\gre@typeclef#1#2#3#4#5#6#7#8{%
+ \gre@trace{gre@typeclef{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
+ \gre@saveclefextrema{#2}{#7}%
+ \gre@boxclef{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
\ifcase#3%
- \global\gre@dimen@clefwidth=\wd\gre@box@temp@width %
+ \gre@update@clefwidth@current{\wd\gre@box@temp@width}%
\fi %
\copy\gre@box@temp@width %
- \gre@skip@temp@two=\gre@space@skip@spaceafterlineclef\relax%
- \ifnum#4=0\relax %
+ \ifcase#4 %
\gre@skip@temp@two=\gre@space@skip@afterclefnospace\relax%
+ \or %
+ \gre@skip@temp@two=\gre@space@skip@spaceafterlineclef\relax%
+ \else %
+ \gre@skip@temp@two=\gre@space@skip@shortspaceafterlineclef\relax%
\fi %
\gre@hskip\gre@skip@temp@two %
+ \gre@trace@end%
}%
% macro that typesets one clef
@@ -240,6 +349,7 @@
%% #3: if we must use small key characters (inside a line) or not 0: if not inside, 1 if inside
%% #4: if 3, it means that we must not put a flat after the key, otherwise it's the height of the flat
\def\gre@typesingleclef#1#2#3#4{%
+ \gre@trace{gre@typesingleclef{#1}{#2}{#3}{#4}}%
\ifcase#2 %
\or%
\gre@calculate@glyphraisevalue{\gre@pitch@c}{0}{}%
@@ -272,15 +382,25 @@
\GreFlat{#4}{1}{}{}{}%
\fi %
\relax %
+ \gre@trace@end%
}%
% macro that writes the initial key, and sets the next keys to the same value
% if #3 is 3, it means that we must not put a flat after the key, otherwise it's the height
% of the flat
-\def\GreSetInitialClef#1#2#3#4#5#6{%
+\def\GreSetInitialClef#1#2#3#4#5#6#7{%
+ \gre@trace{GreSetInitialClef{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
\gre@save@clef{#1}{#2}{#3}{#4}{#5}{#6}%
\ifgre@showclef%
- \gre@typeclef{#1}{#2}{0}{1}{#3}{#4}{#5}{#6}%
+ \ifnum\gre@initiallines=1\relax %
+ \ifnum#7=1\relax %
+ \gre@typeclef{#1}{#2}{0}{1}{#3}{#4}{#5}{#6}%
+ \else %
+ \gre@typeclef{#1}{#2}{0}{2}{#3}{#4}{#5}{#6}%
+ \fi %
+ \else %
+ \gre@typeclef{#1}{#2}{0}{1}{#3}{#4}{#5}{#6}%
+ \fi %
\else%
\gre@skip@temp@four = \gre@space@dimen@noclefspace\relax%
\hbox{\kern\gre@skip@temp@four}%
@@ -292,6 +412,7 @@
\gre@adjustsecondline %
\fi %
\relax%
+ \gre@trace@end%
}%
% macro called when the key changes
@@ -300,6 +421,7 @@
% if #4 is 3, it means that we must not put a flat after the key, otherwise it's the height
% of the flat
\def\GreChangeClef#1#2#3#4#5#6#7{%
+ \gre@trace{GreChangeClef{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
% it makes no sense to change the clef when there is no clef...
\gresetclef{visible}%
\gre@save@clef{#1}{#2}{#4}{#5}{#6}{#7}%
@@ -310,28 +432,55 @@
\gre@skip@temp@four = \gre@space@skip@clefchangespace\relax%
\gre@hskip\gre@skip@temp@four %
\else %
- % here it means that there is a bar before the clef, so we skip the difference between the normal space and the space around bars with clef changes
- \gre@skip@temp@four = -\gre@space@skip@spacearoundclefbars\relax%
- \gre@hskip\gre@skip@temp@four %
+ \ifdim\gre@skip@bar@lastskip=0pt\else % we're after a bar:
+ % here it means that there is a bar before the clef, so we skip the difference between the normal space and the space around bars with clef changes
+ \gre@skip@temp@four = -\gre@space@skip@spacearoundclefbars\relax%
+ \gre@hskip\gre@skip@temp@four %
+ \fi %
\fi %
+ \GreNoBreak %
\gre@typeclef{#1}{#2}{1}{0}{#4}{#5}{#6}{#7}%
- \gre@skip@temp@four = \gre@space@skip@clefchangespace\relax%
+ \ifnum\gre@insidediscretionary=0\relax %
+ \gre@skip@temp@four = \gre@space@skip@clefchangespace\relax%
+ \else %
+ \gre@skip@temp@four = \gre@space@skip@interwordspacenotes\relax%
+ \fi %
\gre@hskip\gre@skip@temp@four %
+ \GreNoBreak %
\relax%
+ \gre@trace@end%
}%
% custos just typesets a custos, useful for before the key changes for example
% #1 is the height
-% #2 is indicating if the custo ends the line
-\def\GreCustos#1{%
+\def\GreCustos#1#2{%
+ \gre@trace{GreCustos{#1}{#2}}%
+ \GreNoBreak %
\ifdim\gre@skip@bar@lastskip=0pt\else % we're after a bar:
\kern-\gre@skip@bar@lastskip %
+ \GreNoBreak %
+ \fi %
+ \ifgre@firstglyph% we check if it is the first glyph
+ \global\gre@firstglyphfalse%
+ \ifnum\gre@insidediscretionary=0\else %
+ \gre@skip@temp@four=\gre@space@skip@interwordspacenotes %
+ \kern\gre@skip@temp@four%
+ \GreNoBreak %
+ \fi %
+ \else%
+ \ifgre@endofscore %
+ \gre@skip@temp@four=\gre@space@skip@spacebeforeeolcustos %
+ \else %
+ \gre@skip@temp@four=\gre@space@skip@spacebeforeinlinecustos %
+ \fi %
+ \kern\gre@skip@temp@four%
+ \GreNoBreak %
\fi %
- \gre@skip@temp@four = \gre@space@skip@spacebeforeinlinecustos\relax%
- \kern\gre@skip@temp@four%
+ \gre@custosalteration{#1}{#2}%
+ \GreNoBreak%
\gre@calculate@glyphraisevalue{#1}{0}{}%
%here we need some tricks to draw the line before the custos (for the color)
- \setbox\gre@box@temp@width=\hbox{\gre@pickcustos{#1}}%
+ \setbox\gre@box@temp@width=\hbox{\gre@pickcustos{#1}{1}}%
\gre@dimen@temp@three=\wd\gre@box@temp@width %
\ifgre@showlines %
\ifnum#1<\gre@pitch@belowstaff\relax %
@@ -354,26 +503,30 @@
\kern\gre@skip@bar@lastskip %
\GreNoBreak %
\fi %
+ \directlua{gregoriotex.adjust_line_height(\gre@insidediscretionary)}%
\relax %
+ \gre@trace@end%
}%
% typesets a custos for the end of the score
-\def\GreFinalCustos#1{%
+\def\GreFinalCustos#1#2{%
+ \gre@trace{GreFinalCustos{#1}{#2}}%
\GreNoBreak%
- \gre@dimen@temp@four = \glueexpr(\gre@space@skip@spacebeforeeolcustos)\relax%
- \kern\gre@dimen@temp@four %
- \GreNoBreak%
- \GreCustos{#1}%
+ \GreCustos{#1}{#2}%
\gre@endofglyphcommon %
+ \gre@trace@end%
}
% the argument is the height
-\edef\gre@nextcustos{\gre@pitch@dummy}%
-\def\GreNextCustos#1{%
- \gre@debugmsg{custos}{nextcustos = #1}%
+\edef\gre@nextcustospitch{\gre@pitch@dummy}%
+\edef\gre@nextcustosalteration{}%
+\def\GreNextCustos#1#2{%
+ \gre@trace{GreNextCustos{#1}{#2}}%
+ \gre@debugmsg{custos}{nextcustos = #1,#2}%
\ifnum\gre@insidediscretionary=0\relax %
\gre@debugmsg{custos}{not discretionary}%
- \edef\gre@nextcustos{#1}%
+ \edef\gre@nextcustospitch{#1}%
+ \edef\gre@nextcustosalteration{#2}%
\ifgre@blockeolcustos\else%
\gre@debugmsg{custos}{not blocked}%
\gre@calculate@glyphraisevalue{#1}{0}{}%
@@ -381,12 +534,19 @@
\setbox\gre@box@temp@width=\hbox{%
% we type a hskip and the we type the custos
\gre@hskip\gre@space@skip@spacebeforeeolcustos\relax %
- \gre@pickcustos{#1}\relax %
+ \gre@custosalteration{#1}{#2}%
+ \GreNoBreak%
+ \raise \gre@dimen@glyphraisevalue%
+ \hbox{%
+ \gre@pickcustos{#1}{2}\relax %
+ }%
}%
\gre@dimen@temp@three=\wd\gre@box@temp@width %
% we make \wd\gre@box@temp@sign contain the width of a custos
\setbox\gre@box@temp@sign=\hbox{%
- \gre@pickcustos{#1}\relax %
+ \gre@custosalteration{#1}{#2}%
+ \GreNoBreak%
+ \gre@pickcustos{#1}{0}\relax %
}%
\gre@localrightbox{%
\ifgre@showlines %
@@ -396,17 +556,18 @@
\gre@additionaltopcustoslineend %
\fi\fi %
\fi %
- \raise \gre@dimen@glyphraisevalue%
\copy\gre@box@temp@width %
}%
\fi %
\fi %
\relax%
+ \gre@trace@end%
}%
% macro that typesets an additional line at the top for custos at end of line
\def\gre@additionaltopcustoslineend{%
+ \gre@trace{gre@additionalaltopcustoslineend}%
\gre@dimen@temp@five=\dimexpr(\gre@dimen@staffheight %
+ \gre@space@dimen@spacebeneathtext %
+ \gre@space@dimen@spacelinestext %
@@ -416,10 +577,6 @@
\raise\gre@dimen@temp@five %
\hbox to 0pt{%
\gre@style@additionalstafflines %
- \ifx\gre@empty@additionalstafflinesformat\greadditionalstafflinesformat% OBSOLETE
- \else % OBSOLETE
- \gre@obsolete{\protect\greadditionalstafflinesformat}{\protect\grechangestyle{additionalstafflinesformat}}% OBSOLETE
- \fi% OBSOLETE
\kern\gre@dimen@temp@three %
\gre@dimen@temp@five=\dimexpr(\wd\gre@box@temp@sign + \gre@space@dimen@additionalcustoslineswidth)\relax%
\kern-\gre@dimen@temp@five %
@@ -428,9 +585,11 @@
\endgre@style@additionalstafflines%
}%
\relax %
+ \gre@trace@end%
}%
\def\gre@additionalbottomcustoslineend{%
+ \gre@trace{gre@additionalbottomcustoslineend}%
\gre@dimen@temp@five=\dimexpr(\gre@space@dimen@spacebeneathtext %
+ \gre@space@dimen@spacelinestext %
+ \gre@dimen@additionalbottomspace %
@@ -440,10 +599,6 @@
\raise\gre@dimen@temp@five %
\hbox to 0pt{%
\gre@style@additionalstafflines %
- \ifx\gre@empty@additionalstafflinesformat\greadditionalstafflinesformat% OBSOLETE
- \else % OBSOLETE
- \gre@obsolete{\protect\greadditionalstafflinesformat}{\protect\grechangestyle{additionalstafflinesformat}}% OBSOLETE
- \fi% OBSOLETE
\kern\gre@dimen@temp@three %
\gre@dimen@temp@five=\dimexpr(\wd\gre@box@temp@sign+\gre@space@dimen@additionalcustoslineswidth)\relax%
\kern-\gre@dimen@temp@five %
@@ -452,11 +607,13 @@
\endgre@style@additionalstafflines%
}%
\relax %
+ \gre@trace@end%
}%
% same macros, but for a custos in the middle
\def\gre@additionaltopcustoslinemiddle{%
+ \gre@trace{gre@additionaltopcustoslinemiddle}%
\gre@dimen@temp@five=\dimexpr(\gre@dimen@staffheight %
+ \gre@space@dimen@spacebeneathtext %
+ \gre@space@dimen@spacelinestext %
@@ -466,10 +623,6 @@
\raise\gre@dimen@temp@five %
\hbox to 0pt{%
\gre@style@additionalstafflines %
- \ifx\gre@empty@additionalstafflinesformat\greadditionalstafflinesformat% OBSOLETE
- \else % OBSOLETE
- \gre@obsolete{\protect\greadditionalstafflinesformat}{\protect\grechangestyle{additionalstafflinesformat}}% OBSOLETE
- \fi% OBSOLETE
\hss %
\kern\gre@dimen@temp@three %
\gre@dimen@temp@five=\dimexpr((\gre@space@dimen@additionalcustoslineswidth*2)+\wd\gre@box@temp@sign)\relax %
@@ -478,9 +631,11 @@
\endgre@style@additionalstafflines%
}%
\relax %
+ \gre@trace@end%
}%
\def\gre@additionalbottomcustoslinemiddle{%
+ \gre@trace{gre@additionalbottomcustoslinemiddle}%
\gre@dimen@temp@five=\dimexpr(\gre@space@dimen@spacebeneathtext %
+ \gre@space@dimen@spacelinestext %
+ \gre@dimen@additionalbottomspace %
@@ -490,10 +645,6 @@
\raise\gre@dimen@temp@five %
\hbox to 0pt{%
\gre@style@additionalstafflines %
- \ifx\gre@empty@additionalstafflinesformat\greadditionalstafflinesformat% OBSOLETE
- \else % OBSOLETE
- \gre@obsolete{\protect\greadditionalstafflinesformat}{\protect\grechangestyle{additionalstafflinesformat}}% OBSOLETE
- \fi% OBSOLETE
\hss %
\kern\gre@dimen@temp@three %
\gre@dimen@temp@five=\dimexpr((\gre@space@dimen@additionalcustoslineswidth*2)+\wd\gre@box@temp@sign)\relax %
@@ -502,9 +653,42 @@
\endgre@style@additionalstafflines%
}%
\relax %
+ \gre@trace@end%
+}%
+
+\newif\ifgre@usecustosalteration%
+\gre@usecustosalterationtrue%
+\def\gresetcustosalteration#1{%
+ \gre@trace{gresetcustosalteration{#1}}%
+ \IfStrEqCase{#1}{%
+ {visible}{\gre@usecustosalterationtrue}%
+ {invisible}{\gre@usecustosalterationfalse}%
+ }[% all other cases
+ \gre@error{Unrecognized option "#1" for \protect\gresetcustosalteration\MessageBreak Possible options are: 'visible' and 'invisible'}%
+ ]%
+ \gre@trace@end%
+}%
+\def\gre@custosalteration#1#2{%
+ \gre@trace{gre@custosalteration{#1}{#2}}%
+ \ifgre@usecustosalteration %
+ \IfStrEq{#2}{}{}{\csname Gre#2\endcsname{#1}{0}{}{}{}}%
+ \fi %
+ \gre@trace@end%
}%
-\def\gre@pickcustos#1{%
+% #2 is 0 for measurement only, 1 in the normal case, 2 for the right box
+\def\gre@pickcustos#1#2{%
+ \gre@trace{gre@pickcustos{#1}{#2}}%
+ % set attributes to adjust the line height for the pitch of the custos
+ \ifcase#2% 0
+ \or % 1
+ \global\advance\gre@attr@glyph@id by 1\relax %
+ \GreGlyphHeights{#1}{#1}%
+ \or % 2
+ \ifgre@eolshiftsenabled %
+ \GreGlyphHeights{#1}{#1}%
+ \fi %
+ \fi %
\ifcase#1%
\or\or%
\or\gre@fontchar@custostopmiddle %
@@ -566,6 +750,7 @@
\or\gre@fontchar@custosbottomlong %
\or\gre@fontchar@custosbottommiddle %
\fi%
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -580,24 +765,30 @@
\@ifnextchar[{\gre@setbracerendering}{\gre@setallbracerendering}%
}%
\def\gre@setallbracerendering#1{%
+ \gre@trace{gre@setallbracerendering{#1}}%
\gre@@setbracerendering{brace}{#1}%
\gre@@setbracerendering{underbrace}{#1}%
\gre@@setbracerendering{curlybrace}{#1}%
\gre@@setbracerendering{barbrace}{#1}%
+ \gre@trace@end%
}%
\def\gre@setbracerendering[#1]#2{%
+ \gre@trace{gre@setbracerendering[#1]{#2}}%
\IfStrEqCase{#1}{%
{brace}{\gre@@setbracerendering{#1}{#2}}%
{underbrace}{\gre@@setbracerendering{#1}{#2}}%
{curlybrace}{\gre@@setbracerendering{#1}{#2}}%
{barbrace}{\gre@@setbracerendering{#1}{#2}}%
}[\gre@error{Unrecognized option "#1" for \protect\gresetbracerendering\MessageBreak Possible options are: 'brace', 'underbrace', 'curlybrace', and 'barbrace'}]%
+ \gre@trace@end%
}%
\def\gre@@setbracerendering#1#2{%
+ \gre@trace{gre@@setbracerendering{#1}{#2}}%
\IfStrEqCase{#2}{%
{font}{\csname gre@metapost@#1false\endcsname}%
{metapost}{\csname gre@metapost@#1true\endcsname}%
}[\gre@error{Unrecognized option "#2" for \protect\gresetbracerendering\MessageBreak Possible options are: 'font' and 'metapost'}]%
+ \gre@trace@end%
}%
\gdef\gre@fontchar@curlybrace{\gre@font@music\GreCPCurlyBrace}%
@@ -613,9 +804,11 @@
% #4: 1 if we shift to the beginning of the last glyph, 0 otherwise
% #5: 1 if we put an accentus above or not
\def\GreOverCurlyBrace#1#2#3#4#5{%
+ \gre@trace{GreOverCurlyBrace{#1}{#2}{#3}{#4}{#5}}%
\ifgre@boxing\else %
\gre@brace@common{#1}{#2}{#3}{#4}{#5}{\gre@pitch@overbraceglyph}{\gre@fontchar@curlybrace}%
\fi %
+ \gre@trace@end%
}%
% #1: the width
@@ -623,9 +816,11 @@
% #3: a horizontal shift
% #4: 1 if we shift to the beginning of the last glyph, 0 otherwise
\def\GreOverBrace#1#2#3#4{%
+ \gre@trace{GreOverBrace{#1}{#2}{#3}{#4}}%
\ifgre@boxing\else %
\gre@brace@common{#1}{#2}{#3}{#4}{0}{\gre@pitch@overbraceglyph}{\gre@fontchar@brace}%
\fi %
+ \gre@trace@end%
}%
% #1: the width
@@ -633,9 +828,11 @@
% #3: a horizontal shift
% #4: 1 if we shift to the beginning of the last glyph, 0 otherwise
\def\GreUnderBrace#1#2#3#4{%
+ \gre@trace{GreUnderBrace{#1}{#2}{#3}{#4}}%
\ifgre@boxing\else %
\gre@brace@common{#1}{#2}{#3}{#4}{0}{\gre@pitch@underbrace}{\gre@fontchar@underbrace}%
\fi %
+ \gre@trace@end%
}%
% #1: the width
@@ -646,6 +843,7 @@
% #6: the pitch at which to compute the height
% #7: the brace character
\def\gre@brace@common#1#2#3#4#5#6#7{%
+ \gre@trace{gre@brace@common{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
\ifnum#4=1\relax %
\setbox\gre@box@temp@sign=\hbox{\gre@fontchar@punctum}%
\gre@dimen@temp@five=\wd\gre@box@temp@sign %
@@ -695,12 +893,15 @@
\kern\gre@dimen@temp@five %
\fi %
\relax %
+ \gre@trace@end%
}%
% #1 : the width
% #2 : the brace character
\def\gre@draw@fontbrace#1#2{%
+ \gre@trace{gre@draw@fontbrace{#1}{#2}}%
\setbox\gre@box@temp@sign=\hbox{#2}%
\gre@resizebox{#1}{\ht\gre@box@temp@sign}{#2}%
+ \gre@trace@end%
}%
% #1: the width, or * for the bar brace width
@@ -717,7 +918,7 @@
% #1: the width
\def\gre@draw@curlybrace#1{%
- \gre@debugmsg{general}{curly brace width = #1}%
+ \gre@trace{gre@draw@curlybrace{#1}}%
\gre@metapost{
\grebracemetapostpreamble{#1}
transform t;
@@ -765,10 +966,12 @@
transformed t;
endfig;
}%
+ \gre@trace@end%
}%
% #1: the width
\def\gre@draw@brace#1{%
+ \gre@trace{gre@draw@brace{#1}}%
\gre@draw@roundbrace{#1}{.89500}{
(-.00192,.70347) % start the top
.. controls (-.00192,.70525) and (-.00134,.70740)
@@ -788,10 +991,12 @@
.. controls (.01103,.69500) and (-.00192,.69508)
.. (-.00192,.70347) -- cycle
}%
+ \gre@trace@end%
}%
% #1: the width
\def\gre@draw@underbrace#1{%
+ \gre@trace{gre@draw@underbrace{#1}}%
\gre@draw@roundbrace{#1}{.25500}{
(-.00192,.24653) % start the bottom
.. controls (-.00192,.24475) and (-.00134,.24260)
@@ -811,12 +1016,14 @@
.. controls (.01103,.25500) and (-.00192,.25492)
.. (-.00192,.24653) -- cycle
}%
+ \gre@trace@end%
}%
% #1: the width
% #2: height of the bounding box
% #3: metapost commands to draw the outline
\def\gre@draw@roundbrace#1#2#3{%
+ \gre@trace{gre@draw@roundbrace{#1}{#2}{#3}}%
\gre@debugmsg{general}{round brace width = #1}%
\gre@metapost{
\grebracemetapostpreamble{#1}
@@ -838,12 +1045,14 @@
transformed t;
endfig;
}%
+ \gre@trace@end%
}%
% #1 : x-distance
% #2 : y-distance
% #3 : -1 for below, 1 for above
\def\gre@draw@slur#1#2#3{%
+ \gre@trace{gre@draw@slur{#1}{#2}{#3}}%
\gre@metapost{
\grebracemetapostpreamble{\directlua{gregoriotex.hypotenuse([[#1]],[[#2]])}}
transform t;
@@ -862,6 +1071,7 @@
) transformed t withpen pencircle scaled 0.3;
endfig;
}%
+ \gre@trace@end%
}%
\newdimen\greslurheight
@@ -872,6 +1082,7 @@
% #5 : y-distance
% #6 : end height if #6 not given
\def\GreSlur#1#2#3#4#5#6{%
+ \gre@trace{GreSlur{#1}{#2}{#3}{#4}{#5}{#6}}%
\ifgre@boxing\else %
\ifnum\number#2 > 0\relax %
\gre@calculate@glyphraisevalue{#1}{15}{}%
@@ -902,9 +1113,11 @@
}}%
\fi %
\relax %
+ \gre@trace@end%
}%
% #1: id of the variable length brace within the score
+% this function cannot be traced because doing so interferes with it producing something which TeX recognizes as a number
\def\GreVarBraceLength#1{%
\ifgre@boxing\else %
\directlua{gregoriotex.var_brace_len(#1)}%
@@ -915,6 +1128,7 @@
% #2: 0 = no left-shift, 1 = left-shift 1 punctum, 2 = left shift 1/2 punctum
% #3: 1 if the start, 2 if the end
\def\GreVarBraceSavePos#1#2#3{%
+ \gre@trace{GreVarBraceSavePos{#1}{#2}{#3}}%
\ifgre@boxing\else %
\ifcase#2 % 0
\gre@debugmsg{general}{save case 0}%
@@ -932,9 +1146,10 @@
\gre@savepos %
\kern.5\wd\gre@box@temp@sign %
\fi %
- \directlua{gregoriotex.var_brace_note_pos(#1, #3)}%
+ \directlua{gregoriotex.save_length(#1, #3)}%
\fi %
\relax %
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -951,10 +1166,11 @@
% #3 is 1 in case of a punctommora in the note before the last note of a podatus, porrectus or torculus resupinus, 0 otherwise.
% #4 is 1 if we are at a punctum inclinatum, 0 otherwise
\def\gre@punctum@mora#1#2#3#4{%
+ \gre@trace{gre@punctum@mora{#1}{#2}{#3}{#4}}%
\GreNoBreak %
\ifcase#2\relax %
\gre@skip@temp@four = \gre@space@skip@spacebeforesigns\relax%
- \hskip\gre@skip@temp@four%
+ \gre@hskip\gre@skip@temp@four%
\or %
\gre@skip@temp@four = \gre@space@skip@spacebeforesigns\relax%
\kern\gre@skip@temp@four %
@@ -1022,35 +1238,36 @@
\fi %
\GreNoBreak %
\relax%
+ \gre@trace@end%
}%
\def\GrePunctumMora#1#2#3#4{%
+ \gre@trace{GrePunctumMora{#1}{#2}{#3}{#4}}%
\ifgre@disablemora\else %
\gre@punctum@mora{#1}{#2}{#3}{#4}%
\fi %
\relax %
+ \gre@trace@end%
}
% a function to typeset an augmentum duplex, easy enough to be understood...
\def\GreAugmentumDuplex#1#2#3{%
+ \gre@trace{GreAugmentumDuplex{#1}{#2}{#3}}%
\ifgre@boxing\else %
\GrePunctumMora{#1}{1}{#3}{0}%
\fi %
\GrePunctumMora{#2}{0}{0}{0}%
\relax %
+ \gre@trace@end%
}%
-\gdef\grelowchoralsignstyle#1{\relax}% OBSOLETE
-\let\gre@empty@lowchoralsignstyle\grelowchoralsignstyle%
-\gdef\grehighchoralsignstyle#1{\relax}% OBSOLETE
-\let\gre@empty@highchoralsignstyle\grehighchoralsignstyle%
-
% quite simple function: #1 is the height, #2 is the string, #3 is #2 of punctum mora, #4 is #3 of punctum mora
% #3 is 1 if it must be a bit higher
\def\GreLowChoralSign#1#2#3{%
+ \gre@trace{GreLowChoralSign{#1}{#2}{#3}}%
\GreNoBreak %
\gre@skip@temp@four = \gre@space@skip@beforelowchoralsignspace\relax%
- \hskip\gre@skip@temp@four %
+ \gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\ifnum#3=1\relax %
\gre@calculate@glyphraisevalue{#1}{12}{}%
@@ -1058,30 +1275,16 @@
\gre@calculate@glyphraisevalue{#1}{10}{}%
\fi %
\raise\gre@dimen@glyphraisevalue\hbox{\gre@style@lowchoralsign#2\endgre@style@lowchoralsign}%
- \ifx\gre@empty@lowchoralsignstyle\grelowchoralsignstyle% OBSOLETE
- \else% OBSOLETE
- \gre@obsolete{\protect\grelowchoralsignstyle}{\protect\grechangestyle{lowchoralsign}}% OBSOLETE
- \fi% OBSOLETE
\relax %
+ \gre@trace@end%
}%
\def\GreHighChoralSign#1#2#3{%
+ \gre@trace{GreHighChoralSign{#1}{#2}{#3}}%
\GreNoBreak %
\gre@vepisemaorrare{#1}{#3}{}{3}{\gre@style@highchoralsign#2\endgre@style@highchoralsign}%
- \ifx\gre@empty@highchoralsignstyle\grehighchoralsignstyle% OBSOLETE
- \else% OBSOLETE
- \gre@obsolete{\protect\grehighchoralsignstyle}{\protect\grechangestyle{highchoralsign}}% OBSOLETE
- \fi% OBSOLETE
- \relax %
-}%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% macros for the typesetting of linea
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\def\GreLinea#1#2#3#4#5#6{%
- \GreGlyph{\GreCPLinea}{#1}{#2}{#3}{#4}{#5}{#6}%
\relax %
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1110,6 +1313,7 @@
% #6 is the type of sign (1: vertical episema, 2: rare sign, 3: choral sign)
% #7 is the choral sign if relevant
\def\gre@vepisemaorrareaux#1#2#3#4#5#6#7{%
+ \gre@trace{gre@vepisemaorrareaux{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
% first we set \gre@dimen@temp@three to the width of the last glyph
\gre@dimen@temp@three=\gre@dimen@lastglyphwidth\relax%
\setbox\gre@box@temp@sign=\hbox{\gre@font@music #2}%
@@ -1150,6 +1354,7 @@
\advance\gre@dimen@temp@three by -2\gre@dimen@temp@two %
\kern\gre@dimen@temp@three%
\relax%
+ \gre@trace@end%
}%
\directlua{gregoriotex.emit_offset_macros()}%
@@ -1163,6 +1368,7 @@
% #4 is type (1: vertical episema, 2: rare sign, 3: choral sign, 4: brace above the bar)
% #5 is the choral sign if relevant
\def\gre@vepisemaorrare#1#2#3#4#5{%
+ \gre@trace{gre@vepisemaorrare{#1}{#2}{#3}{#4}{#5}}%
\ifgre@boxing\else %
\ifcase#4\or %
% if it is a vertical episema, we call the normal calculateglyphvalue
@@ -1185,22 +1391,28 @@
\gre@v@case{#2}{#3}{#4}{#5}%
\fi %
\relax%
+ \gre@trace@end%
}%
\def\GreVEpisema#1#2{%
+ \gre@trace{GreVEpisema{#1}{#2}}%
\ifgre@disablevepisema\else %
\gre@vepisemaorrare{#1}{#2}{\GreCPVEpisema}{1}{}%
\fi %
\relax %
+ \gre@trace@end%
}%
\def\GreBarBrace#1{%
+ \gre@trace{GreBarBrace{#1}}%
\gre@vepisemaorrare{\gre@pitch@overbraceglyph}{#1}{%
\gre@render@barbrace%
}{4}{}%
\relax %
+ \gre@trace@end%
}%
\def\gre@render@barbrace{%
+ \gre@trace{gre@render@barbrace}%
\hbox{%
\ifgre@metapost@barbrace %
\gre@draw@brace{*}%
@@ -1208,36 +1420,70 @@
\gre@fontchar@abovebarbrace %
\fi %
}%
+ \gre@trace@end%
}%
\def\GreBarVEpisema#1{%
+ \gre@trace{GreBarVEpisema{#1}}%
\gre@vepisemaorrare{\gre@pitch@barvepisema}{#1}{\GreCPVEpisema}{1}{}%
\relax %
+ \gre@trace@end%
}%
\def\GreAccentus#1#2{%
+ \gre@trace{GreAccentus{#1}{#2}}%
\gre@vepisemaorrare{#1}{#2}{\GreCPAccentus}{2}{}%
\relax %
+ \gre@trace@end%
}%
\def\GreSemicirculus#1#2{%
+ \gre@trace{GreSemicirculus{#1}{#2}}%
\gre@vepisemaorrare{#1}{#2}{\GreCPSemicirculus}{2}{}%
\relax %
+ \gre@trace@end%
}%
\def\GreCirculus#1#2{%
+ \gre@trace{GreCirculus{#1}{#2}}%
\gre@vepisemaorrare{#1}{#2}{\GreCPCirculus}{2}{}%
\relax %
+ \gre@trace@end%
}%
\def\GreReversedAccentus#1#2{%
+ \gre@trace{GreReversedAccentus{#1}{#2}}%
\gre@vepisemaorrare{#1}{#2}{\GreCPAccentusReversus}{2}{}%
\relax %
+ \gre@trace@end%
}%
\def\GreReversedSemicirculus#1#2{%
+ \gre@trace{GreReversedSemicirculus{#1}{#2}}%
\gre@vepisemaorrare{#1}{#2}{\GreCPSemicirculusReversus}{2}{}%
\relax %
+ \gre@trace@end%
+}%
+
+\def\GreMusicaFictaFlat#1#2{%
+ \gre@trace{GreMusicaFictaFlat{#1}{#2}}%
+ \gre@vepisemaorrare{#1}{#2}{\GreCPFlat}{2}{}%
+ \relax %
+ \gre@trace@end%
+}%
+
+\def\GreMusicaFictaNatural#1#2{%
+ \gre@trace{GreMusicaFictaNatural{#1}{#2}}%
+ \gre@vepisemaorrare{#1}{#2}{\GreCPNatural}{2}{}%
+ \relax %
+ \gre@trace@end%
+}%
+
+\def\GreMusicaFictaSharp#1#2{%
+ \gre@trace{GreMusicaFictaSharp{#1}{#2}}%
+ \gre@vepisemaorrare{#1}{#2}{\GreCPSharp}{2}{}%
+ \relax %
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1262,6 +1508,7 @@
% end of #1
% #4 argument is the same as in hepisorline
\def\gre@hepisorlineaux#1#2#3#4{%
+ \gre@trace{gre@hepisorlineaux{#1}{#2}{#3}{#4}}%
\ifcase#3% case 0
% first we set \gre@dimen@temp@three to the width of the last glyph
\gre@dimen@temp@three=\gre@dimen@lastglyphwidth\relax%
@@ -1313,24 +1560,23 @@
\advance\gre@dimen@temp@three by -\gre@dimen@temp@two %
\kern\gre@dimen@temp@three %
\relax%
+ \gre@trace@end%
}%
% another dumb top function
\def\GreAdditionalLine#1#2#3{%
+ \gre@trace{GreAdditionalLine{#1}{#2}{#3}}%
\ifgre@showlines %
\ifgre@boxing\else %
- \xdef\gre@dimen@savedglyphraise{\the\gre@dimen@glyphraisevalue}%
+ \xdef\gre@saved@dimen@glyphraise{\the\gre@dimen@glyphraisevalue}%
\gre@style@additionalstafflines %
- \ifx\gre@empty@additionalstafflinesformat\greadditionalstafflinesformat% OBSOLETE
- \else % OBSOLETE
- \gre@obsolete{\protect\greadditionalstafflinesformat}{\protect\grechangestyle{additionalstafflinesformat}}% OBSOLETE
- \fi% OBSOLETE
\gre@hepisorline{\gre@pitch@dummy}{#1}{#2}{#3}{f}{}{}%
\endgre@style@additionalstafflines%
- \gre@dimen@glyphraisevalue=\gre@dimen@savedglyphraise\relax%
+ \gre@dimen@glyphraisevalue=\gre@saved@dimen@glyphraise\relax%
\fi %
\fi %
\relax %
+ \gre@trace@end%
}%
% #1 0 for over staff,
@@ -1345,20 +1591,19 @@
% 2 for #6 space after
% #6 custom space after, used if #4 is 2
\def\GreDrawAdditionalLine#1#2#3#4#5#6{%
+ \gre@trace{GreDrawAdditionalLine{#1}{#2}{#3}{#4}{#5}{#6}}%
\ifgre@showlines %
- \xdef\gre@dimen@savedglyphraise{\the\gre@dimen@glyphraisevalue}%
+ \xdef\gre@saved@dimen@glyphraise{\the\gre@dimen@glyphraisevalue}%
\gre@style@additionalstafflines %
- \ifx\gre@empty@additionalstafflinesformat\greadditionalstafflinesformat% OBSOLETE
- \else % OBSOLETE
- \gre@obsolete{\protect\greadditionalstafflinesformat}{\protect\grechangestyle{additionalstafflinesformat}}% OBSOLETE
- \fi% OBSOLETE
\gre@drawadditionalline{#1}{#2}{#3}{#4}{#5}{#6}%
\endgre@style@additionalstafflines%
- \gre@dimen@glyphraisevalue=\gre@dimen@savedglyphraise\relax%
+ \gre@dimen@glyphraisevalue=\gre@saved@dimen@glyphraise\relax%
\fi %
\relax %
+ \gre@trace@end%
}
\def\gre@drawadditionalline#1#2#3#4#5#6{%
+ \gre@trace{gre@drawadditionalline{#1}{#2}{#3}{#4}{#5}{#6}}%
\ifcase#3 % 0
\gre@dimen@temp@five=0pt\relax %
\or % 1
@@ -1399,6 +1644,7 @@
\vrule height \gre@dimen@stafflineheight %
width \gre@dimen@temp@two %
}%
+ \gre@trace@end%
}
% a function to typeset a horizontal line (additional line or episema).
@@ -1423,6 +1669,7 @@
%% 4 : low in space below note
%% 5 : high in space below note
\def\gre@hepisorline#1#2#3#4#5#6#7{{%
+ \gre@trace{gre@hepisorline{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
\ifcase#4 % 0
\gre@calculate@glyphraisevalue{#1}{9}{#7}%
\or % 1
@@ -1436,6 +1683,7 @@
\global\gre@dimen@glyphraisevalue=\dimexpr\gre@dimen@glyphraisevalue#6\relax %
\gre@h@case{#2}{#3}{#4}{#5}%
\relax%
+ \gre@trace@end%
}}%
% dumb top function
@@ -1451,6 +1699,7 @@
%% 4 : low in space below note
%% 5 : high in space below note
\def\GreHEpisema#1#2#3#4#5#6#7#8#9{%
+ \gre@trace{GreHEpisema{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%
\ifgre@boxing\else\ifgre@disablehepisema\else %
\gre@prephepisemaledgerlineheuristics%
#7%
@@ -1462,20 +1711,14 @@
\gre@resetledgerlineheuristics%
\fi\fi %
\relax %
+ \gre@trace@end%
}%
\newif\ifgre@hepisemabridge
\gre@hepisemabridgetrue
-\def\AddHEpisemusBridges{%OBSOLETE
- \gre@obsolete{\protect\AddHEpisemusBridges}{\protect\gresethepisema{bridge}}%
-}%
-
-\def\RemoveHEpisemusBridges{%OBSOLETE
- \gre@obsolete{\protect\RemoveHEpisemusBridges}{\protect\gresethepisema{break}}%
-}%
-
\def\gresethepisema#1{%
+ \gre@trace{gresethepisema{#1}}%
\IfStrEqCase{#1}{%
{bridge}%
{\gre@hepisemabridgetrue}%
@@ -1484,6 +1727,7 @@
}[% all other cases
\gre@error{Unrecognized option, #1, for \protect\gresethepisema\MessageBreak Possible options are: 'bridge' and 'break'}%
]%
+ \gre@trace@end%
}%
% same but for a "bridge episema" after the last note of a glyph (element, syllable) if the next episema is at the same height
@@ -1500,6 +1744,7 @@
%% 4 : low in space below note
%% 5 : high in space below note
\def\GreHEpisemaBridge#1#2#3#4#5#6{%
+ \gre@trace{GreHEpisemaBridge{#1}{#2}{#3}{#4}{#5}{#6}}%
\ifgre@hepisemabridge%
\ifgre@boxing\else %
\gre@prephepisemaledgerlineheuristics%
@@ -1532,6 +1777,7 @@
\fi %
\fi %
\relax %
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1540,119 +1786,156 @@
% we define two types of macro for each four bar : when it is inside a syllable, and when it is not
-\def\GreInVirgula#1#2{%
- \gre@writebar{0}{1}{#1}{#2}%
+\def\GreInVirgula#1#2#3{%
+ \gre@trace{GreInVirgula{#1}{#2}{#3}}%
+ \gre@writebar{0}{1}{#1}{#2}{#3}%
\relax%
+ \gre@trace@end%
}%
-\def\GreVirgula#1#2{%
- \gre@writebar{0}{0}{#1}{#2}%
+\def\GreVirgula#1#2#3{%
+ \gre@trace{GreVirgula{#1}{#2}{#3}}%
+ \gre@writebar{0}{0}{#1}{#2}{#3}%
\relax%
+ \gre@trace@end%
}%
-\def\GreInDivisioMinima#1#2{%
- \gre@writebar{1}{1}{#1}{#2}%
+\def\GreInDivisioMinima#1#2#3{%
+ \gre@trace{GreInDivisioMinima{#1}{#2}{#3}}%
+ \gre@writebar{1}{1}{#1}{#2}{#3}%
\relax%
+ \gre@trace@end%
}%
-\def\GreDivisioMinima#1#2{%
- \gre@writebar{1}{0}{#1}{#2}%
+\def\GreDivisioMinima#1#2#3{%
+ \gre@trace{GreDivisioMinima{#1}{#2}{#3}}%
+ \gre@writebar{1}{0}{#1}{#2}{#3}%
\relax%
+ \gre@trace@end%
}%
\def\GreInDivisioMinor#1#2{%
- \gre@writebar{2}{1}{#1}{#2}%
+ \gre@trace{GreInDivisioMinor{#1}{#2}}%
+ \gre@writebar{2}{1}{#1}{#2}{0}%
\relax%
+ \gre@trace@end%
}%
\def\GreDivisioMinor#1#2{%
- \gre@writebar{2}{0}{#1}{#2}%
+ \gre@trace{GreDivisioMinor{#1}{#2}}%
+ \gre@writebar{2}{0}{#1}{#2}{0}%
\relax%
+ \gre@trace@end%
}%
\def\GreInDivisioMaior#1#2{%
- \gre@writebar{3}{1}{#1}{#2}%
+ \gre@trace{GreInDivisioMaior{#1}{#2}}%
+ \gre@writebar{3}{1}{#1}{#2}{0}%
\relax%
+ \gre@trace@end%
}%
\def\GreDivisioMaior#1#2{%
- \gre@writebar{3}{0}{#1}{#2}%
+ \gre@trace{GreDivisioMaior{#1}{#2}}%
+ \gre@writebar{3}{0}{#1}{#2}{0}%
\relax%
+ \gre@trace@end%
}%
\def\GreDominica#1#2#3{%
+ \gre@trace{GreDominica{#1}{#2}{#3}}%
\ifcase#1\or %
- \gre@writebar{6}{0}{#2}{#3}%
+ \gre@writebar{6}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{7}{0}{#2}{#3}%
+ \gre@writebar{7}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{8}{0}{#2}{#3}%
+ \gre@writebar{8}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{9}{0}{#2}{#3}%
+ \gre@writebar{9}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{10}{0}{#2}{#3}%
+ \gre@writebar{10}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{11}{0}{#2}{#3}%
+ \gre@writebar{11}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{12}{0}{#2}{#3}%
+ \gre@writebar{12}{0}{#2}{#3}{0}%
\or %
- \gre@writebar{13}{0}{#2}{#3}%
+ \gre@writebar{13}{0}{#2}{#3}{0}%
\fi %
\relax%
+ \gre@trace@end%
}%
\def\GreInDominica#1#2#3{%
+ \gre@trace{GreInDominica{#1}{#2}{#3}}%
\ifcase#1\or %
- \gre@writebar{6}{1}{#2}{#3}%
+ \gre@writebar{6}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{7}{1}{#2}{#3}%
+ \gre@writebar{7}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{8}{1}{#2}{#3}%
+ \gre@writebar{8}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{9}{1}{#2}{#3}%
+ \gre@writebar{9}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{10}{1}{#2}{#3}%
+ \gre@writebar{10}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{11}{1}{#2}{#3}%
+ \gre@writebar{11}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{12}{1}{#2}{#3}%
+ \gre@writebar{12}{1}{#2}{#3}{0}%
\or %
- \gre@writebar{13}{1}{#2}{#3}%
+ \gre@writebar{13}{1}{#2}{#3}{0}%
\fi %
\relax%
+ \gre@trace@end%
}%
\def\GreInDivisioFinalis#1#2{%
+ \gre@trace{GreInDivisioFinalis{#1}{#2}}%
\ifgre@endofscore %
- \gre@writebar{5}{1}{#1}{#2}%
+ \gre@writebar{5}{1}{#1}{#2}{0}%
\else %
- \gre@writebar{4}{1}{#1}{#2}%
+ \gre@writebar{4}{1}{#1}{#2}{0}%
\fi %
\relax%
+ \gre@trace@end%
}%
\def\GreDivisioFinalis#1#2{%
+ \gre@trace{GreDivisioFinalis{#1}{#2}}%
\ifgre@endofscore %
- \gre@writebar{5}{0}{#1}{#2}%
+ \gre@writebar{5}{0}{#1}{#2}{0}%
\else %
- \gre@writebar{4}{0}{#1}{#2}%
+ \gre@writebar{4}{0}{#1}{#2}{0}%
\fi %
\relax%
+ \gre@trace@end%
}%
-% #1 is #2 of gre@writebar
-% #2 is #3 of gre@writebar
+% #1 is #2 of gre@writebar (@standalone or nothing)
+% #2 is #3 of gre@writebar (@text or @notext, only if standalone)
+% #3 is #5 of gre@writebar (@short or nothing)
% emits the suffix of the space
-\def\gre@bar@space@suffix#1#2{%
- \ifcase#1\ifgre@newbarspacing %
- \ifcase#2 @standalone@notext\or @standalone@text\fi %
- \fi\fi %
+% this function cannot be traced because it appears inside \csname constructs
+\def\gre@bar@space@suffix#1#2#3{%
+ \ifgre@newbarspacing %
+ \ifcase#1 %
+ \ifcase#3 %
+ \ifcase#2 @standalone@notext\or @standalone@text\fi %
+ \or %
+ \ifcase#2 @standalone@notext@short\or @standalone@text@short\fi %
+ \fi %
+ \else %
+ \ifcase#3 \or @short\fi %
+ \fi %
+ \else %
+ \ifcase#3 \or @short\fi %
+ \fi %
}%
\newcount\gre@count@shiftaftermora
\gre@count@shiftaftermora=5
\def\gresetshiftaftermora#1{%
+ \gre@trace{gresetshiftaftermora{#1}}%
\IfStrEqCase{#1}{%
{always}%
{\gre@count@shiftaftermora=5}%
@@ -1669,6 +1952,7 @@
}[% all other cases
\gre@error{Unrecognized option "#1" in gresetshiftaftermora\MessageBreak Possible options are: 'always', 'barsonly', 'notesonly', 'barsnotextonly', 'barsinsideonly' and 'never'}%
]%
+ \gre@trace@end%
}%
% width of a punctum mora, reinitalized at each score
@@ -1681,6 +1965,7 @@
% - 1 for the general case
% - 2 when the punctum mora is before a bar
\def\gre@get@unkern@aftermora#1{%
+ \gre@trace{gre@get@unkern@aftermora{#1}}%
\ifdim\gre@dimen@morawidth=0pt\relax %
\setbox\gre@box@temp@width=\hbox{\gre@font@music\gre@fontchar@punctummora}%
\global\gre@dimen@morawidth=\wd\gre@box@temp@width %
@@ -1691,9 +1976,11 @@
\global\gre@skip@punctummorashift=\glueexpr - \gre@dimen@morawidth - \gre@space@skip@spacebeforesigns + \gre@space@skip@moraadjustmentbar\relax %
\fi %
\relax %
+ \gre@trace@end%
}
\def\gre@unkern@bar@aftermora{%
+ \gre@trace{gre@unkern@bar@aftermora}%
\ifgre@newbarspacing%
% don't apply a negative kern on the first glyph
% while boxing, otherwise the box width will be wrong
@@ -1711,6 +1998,7 @@
\kern\gre@skip@punctummorashift %
\fi%
\relax %
+ \gre@trace@end%
}
\newskip\gre@skip@bar@lastskip% skip after last bar
@@ -1720,38 +2008,19 @@
%% 2: is 0 if it is in a syllable containing only this bar, 1 otherwise
%% 3: is 0 if there's no text under the bar or 1 if there is text under the bar
%% 4: macros that may happen before the skip after the bar (typically GreVEpisema)
-\def\gre@writebar#1#2#3#4{%
+%% 5: 0 for the normal version of spaces, 1 for the short one (virgula and minima only)
+\def\gre@writebar#1#2#3#4#5{%
+ \gre@trace{gre@writebar{#1}{#2}{#3}{#4}{#5}}%
% first, for the bar to be really centered, if the last glyph has a punctum
% mora, we kern of the corresponding space. We do it only in the case
% of a bar in the middle of other notes.
\ifgre@lastendswithmora %
- \ifgre@newbarspacing %
- \ifnum\gre@count@shiftaftermora=0\else\ifnum\gre@count@shiftaftermora=4\else %
- % new bar spacing takes care of punctum mora on its own, but only when
- % bar has its own syllable
- \ifcase #2\or %
- \gre@unkern@bar@aftermora %
- \fi %
- \fi\fi %
- \else %
- \ifcase\gre@count@shiftaftermora\or %
- % barsinsideonly
- \ifcase #2\or %
- \gre@unkern@bar@aftermora %
- \fi %
- \or %
- % barsnotextonly
- \ifcase #3\relax %
- \gre@unkern@bar@aftermora %
- \fi %
- \or %
- % barsonly
- \gre@unkern@bar@aftermora %
- \or\or %
- % always
+ \ifnum\gre@count@shiftaftermora=0\else\ifnum\gre@count@shiftaftermora=4\else %
+ % if bar doesn’t has its own syllable, then we need to take care of the kern after a punctum mora here
+ \ifcase #2\or %
\gre@unkern@bar@aftermora %
\fi %
- \fi %
+ \fi\fi %
\fi %
\gre@newglyphcommon %
\gre@calculate@glyphraisevalue{\gre@pitch@bar}{0}{}% bar glyphs are made to be at this height
@@ -1768,7 +2037,7 @@
\gre@skip@temp@four=0pt\relax %
\ifcase#1 % 0 : virgula
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@virgula\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@virgula\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1777,12 +2046,12 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@virgula\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@virgula\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 1 : minima
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@minima\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@minima\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1791,12 +2060,12 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@minima\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@minima\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 2 : minor
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@minor\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@minor\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1805,12 +2074,12 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@minor\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@minor\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 3 : maior
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@maior\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@maior\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1819,12 +2088,12 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@maior\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@maior\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 4 : finalis
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@finalis\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@finalis\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1833,12 +2102,12 @@
\gre@fontchar@divisiofinalis%
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@finalis\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@finalis\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 5 : final finalis
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@finalfinalis\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@finalfinalis\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1847,7 +2116,7 @@
\gre@fontchar@divisiofinalis%
\ifgre@newbarspacing %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@finalfinalis\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@finalfinalis\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1856,7 +2125,7 @@
% we need to adjust the height of the bar a little so that it is perfectly aligned with the bottom (or the top for some bars) of the staff line, which is not the case by default if \gre@stafflinefactor is not 10.
\advance\gre@dimen@glyphraisevalue by -\gre@dimen@stafflinediff\relax%
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1865,14 +2134,14 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 7 : dominican bar 2
\gre@calculate@glyphraisevalue{\gre@pitch@e}{0}{}%
\advance\gre@dimen@glyphraisevalue by \gre@dimen@stafflinediff\relax%
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1881,12 +2150,12 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 8 : dominican bar 3
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1896,12 +2165,12 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 9 : dominican bar 4
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1911,14 +2180,14 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 10 : dominican bar 5
\gre@calculate@glyphraisevalue{\gre@pitch@i}{0}{}%
\advance\gre@dimen@glyphraisevalue by -\gre@dimen@stafflinediff\relax%
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1927,14 +2196,14 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 11 : dominican bar 6
\gre@calculate@glyphraisevalue{\gre@pitch@i}{0}{}%
\advance\gre@dimen@glyphraisevalue by \gre@dimen@stafflinediff\relax%
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1943,14 +2212,14 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 12 : dominican bar 7
\gre@calculate@glyphraisevalue{\gre@pitch@k}{0}{}%
\advance\gre@dimen@glyphraisevalue by -\gre@dimen@stafflinediff\relax%
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1959,14 +2228,14 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\or % 13 : dominican bar 8
\gre@calculate@glyphraisevalue{\gre@pitch@k}{0}{}%
\advance\gre@dimen@glyphraisevalue by \gre@dimen@stafflinediff\relax%
\ifnum\gre@count@temp@one=1\relax %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\GreNoBreak %
\fi %
@@ -1975,7 +2244,7 @@
#4\relax %
\ifnum\gre@count@temp@one=1\relax %
\GreNoBreak %
- \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}\endcsname\relax%
+ \gre@skip@temp@four = \csname gre@space@skip@bar@dominican\gre@bar@space@suffix{#2}{#3}{#5}\endcsname\relax%
\gre@hskip\gre@skip@temp@four %
\fi %
\fi %
@@ -1984,7 +2253,9 @@
\gre@debugmsg{spacing}{Last bar space: \the\gre@skip@temp@four}%
\global\gre@dimen@lastglyphwidth=\wd\gre@box@temp@width %
\directlua{gregoriotex.adjust_line_height(\gre@insidediscretionary)}%
+ \global\gre@firstglyphfalse %
\relax%
+ \gre@trace@end%
}%
\def\gre@fontchar@divisiomaior{%
@@ -2017,6 +2288,7 @@
%macro to end a line with a divisio finalis
\def\GreFinalDivisioFinalis#1{%
+ \gre@trace{GreFinalDivisioFinalis{#1}}%
\GreBarSyllable{\GreSetThisSyllable{}{}{}{}{}}{}{}{1}{\GreSetNextSyllable{}{}{}{}{}\GreLastOfLine}{}{16}{}{%
\ifgre@newbarspacing\else %
\gre@hskip\gre@space@skip@bar@finalfinalis %
@@ -2027,16 +2299,19 @@
#1%
}%
\relax%
+ \gre@trace@end%
}%
%macro to end a line with a divisio maior
\def\GreFinalDivisioMaior#1{%
+ \gre@trace{GreFinalDivisioMaior{#1}}%
\GreBarSyllable{\GreSetThisSyllable{}{}{}{}{}}{}{}{1}{\GreSetNextSyllable{}{}{}{}{}\GreLastOfLine}{}{16}{}{%
\GreLastOfScore %
\GreDivisioMaior{0}{}%
#1%
}%
\relax%
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2050,6 +2325,7 @@
% macro for manipulating above flag
\def\gresetlinesbehindpunctumcavum#1{%
+ \gre@trace{gresetlinesbehindpunctumcavum{#1}}%
\IfStrEqCase{#1}{%
{visible}%
{\gre@hidepclinesfalse}%
@@ -2058,14 +2334,7 @@
}[% all other cases
\gre@error{Unrecognized option "#1" for \protect\gresetlinesbehindpunctumcavum\MessageBreak Possible options are: 'visible' and 'invisible'}%
]%
-}%
-
-\def\GreHidePCLines{%OBSOLETE
- \gre@obsolete{\protect\GreHidePCLines}{\protect\gresetlinesbehindpunctumcavum{invisible}}%
-}%
-
-\def\GreDontHidePCLines{%OBSOLETE
- \gre@obsolete{\protect\GreDontHidePCLines}{\protect\gresetlinesbehindpunctumcavum{visible}}%
+ \gre@trace@end%
}%
% flag to indicate that lines behind an alteration should be hidden
@@ -2075,6 +2344,7 @@
% macro for manipulating above flag
\def\gresetlinesbehindalteration#1{%
+ \gre@trace{gresetlinesbehindalteration{#1}}%
\IfStrEqCase{#1}{%
{visible}%
{\gre@hidealtlinesfalse}%
@@ -2083,14 +2353,7 @@
}[% all other cases
\gre@error{Unrecognized option "#1" for \protect\gresetlinesbehindalteration\MessageBreak Possible options are: 'visible' and 'invisible'}%
]%
-}%
-
-\def\GreHideAltLines{%OBSOLETE
- \gre@obsolete{\protect\GreHideAltLines}{\protect\gresetlinesbehindalteration{invisible}}%
-}%
-
-\def\GreDontHideAltLines{%OBSOLETE
- \gre@obsolete{\protect\GreDontHideAltLines}{\protect\gresetlinesbehindalteration{visible}}%
+ \gre@trace@end%
}%
% is last glyph a cavum?
@@ -2100,16 +2363,18 @@
% 2 if previous glyph is a cavum (which is the most interesting information)
\gre@count@lastglyphiscavum=0
-% the argument is the character with which we fill the hole, and we suppose that
+% #1 is the character with which we fill the hole, and we suppose that
% isonaline and glyphraisevalue are correctly set.
-\def\gre@fillhole#1{%
+% #2 is 0 for alteration or 1 for normal cavum
+\def\gre@fillhole#1#2{%
+ \gre@trace{gre@fillhole{#1}{#2}}%
\ifgre@boxing\else %
\global\gre@count@lastglyphiscavum=1\relax %
\setbox\gre@box@temp@sign=\hbox{#1}%
+ \ifcase#2\raise \gre@dimen@glyphraisevalue\fi%
\hbox to 0pt{%
{%
\color{grebackgroundcolor}%
- \raise \gre@dimen@glyphraisevalue%
\copy\gre@box@temp@sign %
}%
%\pdfliteral{}% this is a ugly hack for old versions of LuaTeX to work
@@ -2118,6 +2383,7 @@
\GreNoBreak %
\fi %
\relax %
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2133,6 +2399,7 @@
% #6 are the signs to typeset after the glyph (almost all signs)
% #7 is the line:char:column for a textedit link
\def\gre@alteration#1#2#3#4#5#6#7{%
+ \gre@trace{gre@alteration{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
\setbox\gre@box@temp@width=\hbox{\gre@pointandclick{#2}{#7}}%
\ifnum#4=0\relax %
\gre@newglyphcommon %
@@ -2145,7 +2412,7 @@
\kern-\gre@skip@temp@one %
\gre@calculate@glyphraisevalue{#1}{0}{}%
\ifgre@hidealtlines %
- \gre@fillhole{#3}%
+ \gre@fillhole{#3}{0}%
\fi %
\raise \gre@dimen@glyphraisevalue%
\copy\gre@box@temp@width%
@@ -2168,115 +2435,153 @@
\directlua{gregoriotex.adjust_line_height(\gre@insidediscretionary)}%
\fi %
\relax %
+ \gre@trace@end%
}%
% This macro typesets a flat on the height provided by #1.
% #2 is 1 if the flat is part of a clef.
\def\GreFlat#1#2#3#4#5{%
+ \gre@trace{GreFlat{#1}{#2}{#3}{#4}{#5}}%
\gre@alteration{#1}{\gre@fontchar@flat}{\gre@fontchar@flathole}{#2}{#3}{#4}{#5}%
\relax%
+ \gre@trace@end%
}%
% Same as the one before, but for naturals.
\def\GreNatural#1#2#3#4#5{%
+ \gre@trace{GreNatural{#1}{#2}{#3}{#4}{#5}}%
\gre@alteration{#1}{\gre@fontchar@natural}{\gre@fontchar@naturalhole}{#2}{#3}{#4}{#5}%
\relax%
+ \gre@trace@end%
}%
% Same as the one before, but for sharps.
\def\GreSharp#1#2#3#4#5{%
+ \gre@trace{GreSharp{#1}{#2}{#3}{#4}{#5}}%
\gre@alteration{#1}{\gre@fontchar@sharp}{\gre@fontchar@sharphole}{#2}{#3}{#4}{#5}%
\relax%
+ \gre@trace@end%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% macros for typesetting punctum cavum
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\gre@fontchar@punctumcavum{\gre@font@music\GreCPPunctumCavum}%
-\def\gre@fontchar@lineapunctumcavum{\gre@font@music\GreCPLineaPunctumCavum}%
-\def\gre@fontchar@punctumcavumhole{\gre@font@music\GreCPPunctumCavumHole}%
-\def\gre@fontchar@lineapunctumcavumhole{\gre@font@music\GreCPLineaPunctumCavumHole}%
-
\def\gresetpunctumcavum#1{%
+ \gre@trace{gresetpunctumcavum{#1}}%
\IfStrEqCase{#1}{%
{alternate}%
{%
- \grechangeglyph{PunctumCavum}{greciliae}{.caeciliae}%
- \grechangeglyph{LineaPunctumCavum}{greciliae}{.caeciliae}%
- \grechangeglyph{PunctumCavumHole}{greciliae}{.caeciliae}%
- \grechangeglyph{LineaPunctumCavumHole}{greciliae}{.caeciliae}%
+ \grechangecavumglyph{Punctum}{greciliae-hollow}{.caeciliae}[greciliae-hole][.caeciliae]%
+ \grechangecavumglyph{LineaPunctum}{greciliae-hollow}{.caeciliae}[greciliae-hole][.caeciliae]%
}%
{normal}%
{%
- \greresetglyph{PunctumCavum}%
- \greresetglyph{LineaPunctumCavum}%
- \greresetglyph{PunctumCavumHole}%
- \greresetglyph{LineaPunctumCavumHole}%
+ \greresetcavumglyph{Punctum}%
+ \greresetcavumglyph{LineaPunctum}%
}%
}[% all other cases
\gre@error{Unrecognized option "#1" for \protect\gresetpunctumcavum\MessageBreak Possible options are: 'alternate' and 'normal'}%
]%
+ \gre@trace@end%
}%
-
-\def\UseAlternatePunctumCavum{%OBSOLETE
- \gre@obsolete{\protect\UseAlternatePunctumCavum}{\protect\gresetpunctumcavum{alternate}}%
-}%
-
-\def\UseNormalPunctumCavum{%OBSOLETE
- \gre@obsolete{\protect\UseNormalPunctumCavum}{\protect\gresetpunctumcavum{normal}}%
-}%
-
-\def\gre@char@cavum#1#2#3#4#5#6#7#8{%
- \setbox\gre@box@temp@width=\hbox{#7}%
- \global\gre@dimen@lastglyphwidth=\wd\gre@box@temp@width %
- \gre@skip@temp@four = \gre@dimen@lastglyphwidth\relax%
- \kern\gre@skip@temp@four %
- #4\relax %
- \kern-\gre@skip@temp@four %
- \gre@calculate@glyphraisevalue{#1}{0}{}%
+\def\GreCavum#1{%
+ \gre@trace{GreCavum{#1}}%
\ifgre@hidepclines%
- \gre@fillhole{#8}%
+ \gre@fillhole{{\gre@font@music@hole\csname GreHoleCP#1\endcsname}}{1}%
\fi %
- \GreGlyph{#7}{#1}{#2}{#3}{}{#5}{#6}%
- %\relax %
-}%
-
-\def\GrePunctumCavum#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@fontchar@punctumcavum}{\gre@fontchar@punctumcavumhole}%
-}%
-
-\def\GreLineaPunctumCavum#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@fontchar@lineapunctumcavum}{\gre@fontchar@lineapunctumcavumhole}%
-}%
-
-\def\GrePunctumCavumInclinatum#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@font@music\GreCPPunctumCavumInclinatum}{\gre@font@music\GreCPPunctumCavumInclinatumHole}%
-}%
-
-\def\GrePunctumCavumInclinatumAuctus#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@font@music\GreCPPunctumCavumInclinatumAuctus}{\gre@font@music\GreCPPunctumCavumInclinatumAuctusHole}%
-}%
-
-\def\GreOriscusCavum#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@font@music\GreCPOriscusCavum}{\gre@font@music\GreCPOriscusCavumHole}%
-}%
-
-\def\GreOriscusCavumAuctus#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@font@music\GreCPOriscusCavumReversus}{\gre@font@music\GreCPOriscusCavumReversusHole}%
+ {\gre@font@music@hollow\csname GreHollowCP#1\endcsname}%
+ \gre@trace@end%
}%
-\def\GreOriscusCavumDeminutus#1#2#3#4#5#6{%
- \gre@char@cavum{#1}{#2}{#3}{#4}{#5}{#6}%
- {\gre@font@music\GreCPOriscusCavumDeminutus}{\gre@font@music\GreCPOriscusCavumDeminutusHole}%
+% #1 is 0 for left or 1 for right bracket
+% #2 is the height of the lowest note within the brackets
+% #3 is the height of the highest note within the brackets
+% #4 is the point-and-click string
+\def\GreBracket#1#2#3#4{%
+ \gre@trace{GreBracket{#1}{#2}{#3}{#4}}%
+ \gre@newglyphcommon %
+ \ifcase\numexpr#1\relax\else\GreNoBreak\fi% no break before right bracket
+ \setbox\gre@box@temp@width=\hbox{\gre@pointandclick{\gre@font@music %
+ \csname GreCPBracket%
+ \ifcase\numexpr#1\relax Left\else Right\fi%
+ % Logic:
+ % if low pitch is on a line or below the staff:
+ % if high pitch is on a line or above the staff:
+ % use short bracket
+ % else:
+ % use normal bracket
+ % else:
+ % if high pitch is on a line or above the staff:
+ % use normal bracket
+ % else:
+ % use long bracket
+ \ifnum\numexpr#2\relax>\numexpr\gre@pitch@belowstaff\relax % low pitch not below staff
+ % numexpr+/ rounds rather than truncates
+ \ifnum\numexpr#2/2\relax=\numexpr(#2+1)/2\relax % =odd, low pitch not on a line
+ \ifnum\numexpr#3\relax<\numexpr\gre@pitch@abovestaff\relax % high pitch not above staff
+ \ifnum\numexpr#3/2\relax=\numexpr(#3+1)/2\relax % =odd, high pitch not on a line
+ Long%
+ \fi %
+ \fi %
+ \else % =even, low pitch on a line
+ \ifnum\numexpr#3\relax<\numexpr\gre@pitch@abovestaff\relax % high pitch not above staff
+ \ifnum\numexpr#3/2\relax=\numexpr(#3+1)/2\relax\else % =even, high pitch on a line
+ Short%
+ \fi %
+ \else % high pitch above staff
+ Short%
+ \fi %
+ \fi %
+ \else % low pitch below staff
+ % same as above!
+ \ifnum\numexpr#3\relax<\numexpr\gre@pitch@abovestaff\relax % high pitch not above staff
+ \ifnum\numexpr#3/2\relax=\numexpr(#3+1)/2\relax\else % =even, high pitch on a line
+ Short%
+ \fi %
+ \else % high pitch above staff
+ Short%
+ \fi %
+ \fi %
+ \ifcase\numexpr#3-#2\relax %
+ Zero%
+ \or One%
+ \or Two%
+ \or Three%
+ \or Four%
+ \or Five%
+ \or Six%
+ \or Seven%
+ \or Eight%
+ \or Nine%
+ \or Ten%
+ \or Eleven%
+ \or Twelve%
+ \or Thirteen%
+ \or Fourteen%
+ \fi%
+ \endcsname %
+ }{#4}}%
+ \global\gre@dimen@lastglyphwidth=\wd\gre@box@temp@width %
+ \gre@calculate@glyphraisevalue{#2}{17}{}%
+ \raise\gre@dimen@glyphraisevalue%
+ \copy\gre@box@temp@width%
+ \ifcase\numexpr#1\relax
+ \GreNoBreak% no break after left bracket
+ \ifgre@firstglyph%
+ \gre@debugmsg{bolshift}{making adjustments for leading bracket}%
+ \global\advance\gre@dimen@notesaligncenter by \wd\gre@box@temp@width\relax %
+ \global\gre@dimen@bolextra = \wd\gre@box@temp@width\relax%
+ \gre@debugmsg{bolshift}{bolextra: \the\gre@dimen@bolextra}%
+ \fi %
+ \GreNoBreak% no break after left bracket
+ \fi %
+ \directlua{gregoriotex.adjust_line_height(\gre@insidediscretionary)}%
+ \gre@endofglyphcommon %
+ \relax%
+ \gre@trace@end%
}%