2 %% include file for LilyPond
4 %% this file defines various macros to accomodate lilypond output
7 \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
9 % skip if included already
10 \def\SkipLilydefs{\endinput}
11 \ifundefined{EndLilyPondOutput}
12 \def\EndLilyPondOutput{\csname bye\endcsname}
17 \ifundefined{mudelacopyright}
18 \def\mudelacopyright{\copyright\ \number\year}
20 \ifundefined{LilyIdString}
21 \def\LilyIdString{Lily was here}
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 % macros to shorten other definitions
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 \def\musicdef#1#2{\def#1{\musicchar{#2}}}
28 \def\musicchar#1{\musicfnt\char#1}
29 \def\rationalmultiply#1*#2/#3{\multiply #1 by #2 \divide #1 by #3}
32 \def\maccentraise#1#2{\dimen0=\noteheight
33 \rationalmultiply\dimen0*#2%
34 \raise\dimen0\hbox{#1}}
35 \def\maccentdef#1#2#3{\def#1{\maccentraise{\musicchar{#2}}{#3}}}
36 \def\vertcenter#1{\vbox to 0pt{\vss #1\vss}}
38 \def\musicmathdef#1#2{\def#1{\musicmathchar{#2}}}
39 \def\musicmathchar#1{\musicmathfont\char#1}
41 \def\topalign#1{\vbox to 0pt{#1\vss}}
42 \def\botalign#1{\vbox to 0pt{\vss #1}}
44 \def\centeralign#1{\hbox to 0pt{\hss#1\hss}}
45 \def\leftalign#1{\hbox to 0pt{#1\hss}}
46 \def\rightalign#1{\hbox to 0pt{\hss#1}}
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 \newdimen\interlinedist
58 \newdimen\staffrulethickness
59 \newdimen\interstaffrule
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 % set fonts and primary dimensions
67 \staffrulethickness=0.4pt
72 \def\musixsixteendefs{
74 \staffrulethickness=0.4pt
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 \interlinedist=\fontdimen5\musicfnt
86 \smallspace=.3\interlinedist
87 \interstaffrule=\balkheight
88 \divide\interstaffrule by 4
96 \musicmathdef\cup{91} % \cup
97 \musicmathdef\wedge{94} % \wedge
98 \musicmathdef\striepke{0} % heu?
100 %% custom characters --- this should go: add to (meta!) font
101 % \def\myheel{\kern-.5ex\vbox{\cup}\kern-.5ex}
102 % \def\mytoe{\kern-.5ex\vbox{\wedge}\kern-.5ex}
103 \def\myheel{\vbox{\cup}}
104 \def\mytoe{\vbox{\wedge}}
105 % \def\mystriepke{\kern-1.1ex\vbox{\hbox{\kern-.05em\striepke}}\kern-1.1ex}
106 \def\mystriepke{\kern-1.8ex\vbox{\hbox{\kern-.05em\striepke}}\kern-1.8ex}
108 \def\heel{\vbox{\myheel}}
109 \def\toe{\vbox{\mytoe}}
110 \def\backorfront{\mystriepke}
112 \def\bheel{\vbox{\myheel\mystriepke}}
113 \def\btoe{\vbox{\mytoe\mystriepke}}
114 \def\fheel{\vbox{\mystriepke\myheel}}
115 \def\ftoe{\vbox{\mystriepke\mytoe}}
116 \def\heeltoe{\vbox{\myheel\mytoe}}
117 \def\toeheel{\vbox{\mytoe\myheel}}
122 \def\defaultthinbar{\thinbar{\balkheight}}
123 \def\defaultthickbar{\thickbar{\balkheight}}
124 %? what-s wrong with rightalign?
125 \def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\defaultthinbar\hskip\smallspace\defaultthickbar}}
126 \def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}}
127 \def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}}
130 \def\repeatbar{\repeatstopbar}
131 \def\startrepeat{\repeatstartbar}
132 \def\repeatbarstartrepeat{\repeatstopstart}
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 \def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}}
141 \def\thinbar#1{\vrule height #1 width 1.6\staffrulethickness} % TODO parametric.
142 \def\thickbar#1{\vrule height #1 width 2\smallspace}
143 \def\maatstreep#1{\thinbar{#1}}
144 \def\startbar#1{\leftalign{\thickbar{#1}\kern\smallspace\thinbar{#1}}}
145 \def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}}
147 \def\pianobrace#1{{\musicdraw\char#1}}
148 \def\slurcharh#1{{\slurhfont\char#1}}
149 \def\slurcharu#1{{\slurufont\char#1}}
150 \def\slurchard#1{{\slurdfont\char#1}}
151 \def\hslurcharh#1{{\hslurhfont\char#1}}
152 \def\hslurcharu#1{{\hslurufont\char#1}}
153 \def\hslurchard#1{{\hslurdfont\char#1}}
155 \def\generalmeter#1#2{\botalign{\vbox to0.5\balkheight{\vss \meterfont#1}%
157 \vbox to 0.5\balkheight{\vss\meterfont #2}}}
159 % stacked horizontal lines
161 \vbox{\kern-\interstaffrule
162 \n=0\nointerlineskip%
163 \loop\ifnum\n<#1\advance\n by1%
166 \vbox to 0pt{\hrule height #3 width#2%
167 \vss}\nointerlineskip
172 % Ugh. Need to redo this. Wish we had PS.
174 \def\toplines#1{ % why space needed here?
175 \topalign{\hbox{\kern-\notewidth\lines{#1}{1.6\notewidth}{1.6\staffrulethickness}}}}
177 \def\botlines#1{ % idem ditto
178 \botalign{\hbox{\kern-\notewidth\lines{#1}{1.6\notewidth}{1.6\staffrulethickness}}}}
181 % a staffsymbol with #1 lines, width #2
183 \def\linestafsym#1#2{\leftalign{\botalign{\lines{#1}{#2}{\staffrulethickness}}}}
185 \def\stem#1#2{\vrule height#2 depth-#1}
187 \def\placebox#1#2#3{%
188 \botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}%
192 \def\beamslope#1#2{{\count0=#2\advance\count0 by#1\musicfnt\char\count0}}
193 \def\brace#1{\count0=148\advance\count0 by #1\musicdraw\char\count0}
194 \def\crescendosym#1{\count0=84\advance\count0 by #1\musicdraw\char\count0}
195 \def\decrescendosym#1{\count0=116\advance\count0 by #1\musicdraw\char\count0}
196 \def\rulesym#1#2{\vrule height #1 width #2}
197 \def\settext#1{\normaltextfont #1}
198 \def\setitalic#1{\italicfont #1}
199 \def\setdynamic#1{\dynfont #1}
201 % the interline symbol. Redefine to remove it.
202 \def\defaultlineseparator{\vbox{\mussepline\vskip -5pt\mussepline}}
203 \def\lineseparator{\defaultlineseparator}
205 \par\vskip 10pt plus 30pt minus 10pt\par
206 \hskip -5pt\lineseparator
207 \par\vskip 10pt plus 30pt minus 10pt\par
211 \def\interscoreline{\vskip 16pt}
213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214 % big fat marks, if errors are detected.
215 \def\columnerrormark{\placebox{-5pt}{0pt}{\bf C!}}
216 \def\scorelineerrormark{\placebox{0pt}{-10pt}{\bf L!}}
217 \def\unknown{{\bf u}}
220 \ifundefined{documentclass}
221 \footline={\ifnum\pageno=1
222 {\smalltextfont\mudelacopyright\hfil \LilyIdString
223 }\else{\hfil\the\pageno\hfil}\fi
227 \renewcommand{\@oddhead}{}%
228 \renewcommand{\@evenfoot}{}%
229 \renewcommand{\@evenhead}{}%
230 \renewcommand{\@oddfoot}{\ifnum\thepage=1
232 }\else{foo\hfil\the\pageno\hfil}\fi}}
234 \renewcommand{\@oddhead}{}%
235 \renewcommand{\@evenfoot}{}%
236 \renewcommand{\@evenhead}{}%
237 \renewcommand{\@oddfoot}{\ifnum\thepage=1
239 }\else{foo\hfil\the\pageno\hfil}\fi}}