2 %% include file for LilyPond
4 %% this file defines various macros to accomodate lilypond output
6 %% let's not make par before endinput
9 \def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}
11 % skip if included already
12 \def\SkipLilydefs{\endinput}
13 \ifundefined{EndLilyPondOutput}
14 \def\EndLilyPondOutput{\csname bye\endcsname}
19 \ifundefined{mudelacopyright}
20 \def\mudelacopyright{\copyright\ \number\year}
22 \ifundefined{LilyIdString}
23 \def\LilyIdString{Lily was here}
25 \ifundefined{documentclass}
26 \input lilypond-plaintex
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 % macros to shorten other definitions
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 \def\musicmathdef#1#2{\def#1{\musicmathchar{#2}}}
35 \def\musicmathchar#1{\musicmathfont\char#1}
37 \def\topalign#1{\vbox to 0pt{#1\vss}}
38 \def\botalign#1{\vbox to 0pt{\vss #1}}
40 \def\centeralign#1{\hbox to 0pt{\hss#1\hss}}
41 \def\leftalign#1{\hbox to 0pt{#1\hss}}
42 \def\rightalign#1{\hbox to 0pt{\hss#1}}
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 \newdimen\interlinedist
51 \newdimen\stemthickness
52 \newcount\n %duh. meaningful identifiers.
56 \newdimen\staffrulethickness
57 \newdimen\interstaffrule
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 % set fonts and primary dimensions
65 \font\smalltextfont=cmr8
66 \font\textmusic=cmmi12
70 \font\smalltextfont=cmr6
71 \font\textmusic=cmmi10
74 \font\smalltextfont=cmr6
78 \font\smalltextfont=cmr5
86 \csname cmrtwenty\texsuffix\endcsname
90 \def\musixsixteendefs{
92 \csname cmrsixteen\texsuffix\endcsname
95 \def\musixtwentysixdefs{
96 \csname cmrtwentysix\texsuffix\endcsname
100 \def\musixthirteendefs{
102 \csname cmrthirteen\texsuffix\endcsname
105 \def\musixelevendefs{
106 \csname cmreleven\texsuffix\endcsname
111 \def\textsharp{\raise.4ex\hbox{\textmusic\char"5D}}
112 \def\textnatural{\raise.4ex\hbox{\textmusic\char"5C}}
113 \def\textflat{\raise.2ex\hbox{\textmusic\char"5B}}
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117 % do derivative calcs
119 % this has to be synced with the font definition
121 \staffheight=\mudelapaperbarsize pt
123 % ugh. Can extract ex dim from TFM
124 \interlinedist=\staffheight
125 \divide\interlinedist by 4
126 \notewidth=\mudelapapernotewidth pt
128 \smallspace=.3\interlinedist
129 \interstaffrule=\staffheight
130 \divide\interstaffrule by 4
131 \staffrulethickness=\mudelapaperrulethickness pt
132 \stemthickness=\staffrulethickness
137 % stacked horizontal lines
139 \def\interscoreline{\vskip 16pt}
140 \def\setdynamic#1{\dynfont #1}
141 \def\setfinger#1{\fingerfont #1}
142 \def\setnumber#1{\fetanummer #1}
143 \def\setmark#1{\markfont #1}
145 % big fat marks, if errors are detected.
146 \def\columnerrormark{\placebox{-5pt}{0pt}{\bf C!}}
147 \def\scorelineerrormark{\placebox{0pt}{-10pt}{\bf L!}}
148 \def\errormark{{\bf E!}}
149 \def\unknown{{\bf u}}
158 \def\defaultthinbar{\thinbar{\staffheight}}
159 \def\defaultthickbar{\thickbar{\staffheight}}
160 %? what-s wrong with rightalign?
161 \def\repeatstopbar{\rightalign{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar}}
162 \def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}}
163 \def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern2\smallspace\repeatcolon}}
167 \fetdef\repeatcolon{18}
168 \def\repeatbar{\repeatstopbar}
169 \def\startrepeat{\repeatstartbar}
170 \def\repeatbarstartrepeat{\repeatstopstart}
172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
176 \def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}}
177 \def\thinbar#1{\dimen0=#1%
178 \vrule height .5\dimen0 depth .5\dimen0 width 1.6\staffrulethickness} % TODO parametric.
179 \def\thickbar#1{\dimen0=#1%
180 \vrule height .5\dimen0 depth .5\dimen0 width 2\smallspace}
181 \def\maatstreep#1{\thinbar{#1}}
182 \def\startbar#1{\leftalign{\thickbar{#1}\kern\smallspace\thinbar{#1}}}
183 \def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}}
184 \def\fatdoublebar#1{\hbox{\phantom{\repeatcolon\kern2\smallspace}\thickbar{#1}\kern\smallspace\thickbar{#1}}}
189 % see e.g. input/test/beam-pos.ly
191 % something's wrong with the aligment; sometimes all symbols
192 % look to be placed a bit too high (there's an ugly fix for
193 % the staccato-dot in script.cc)
194 % but this varies from line to line: it seems that xdvi
195 % does some rounding; i can't really check this from screen on i
198 \def\rulesym#1#2{\dimen0=#1%
199 \vrule height .5\dimen0 depth .5\dimen0 width #2}
200 \def\shiftedrulesym#1#2{\dimen0=#1%
201 \vrule height .7\dimen0 depth .3\dimen0 width #2}
202 \def\tinyrulesym#1#2{\dimen0=#1%
203 \vrule height .1\dimen0 depth .1\dimen0 width #2}
204 %would be nice for checking alignment
205 \def\openrulesym#1#2{\dimen0=#1%
206 \vbox to \dimen0{\vss%
207 \hbox{\vrule height .1\dimen0 width #2}%
208 \hbox{\vrule height .2\dimen0 width 0pt}%
209 \hbox{\vrule height .4\dimen0 width #2}%
210 \hbox{\vrule height .2\dimen0 width 0pt}%
211 \hbox{\vrule height .1\dimen0 width #2}%
213 %\let\rulesym\shiftedrulesym
214 %\let\rulesym\tinyrulesym
215 %\let\rulesym\openrulesym
217 % the interline symbol. Redefine to remove it.
218 \def\defaultlineseparator{\vbox{\mussepline\vskip -5pt\mussepline}}
219 \def\lineseparator{\defaultlineseparator}
221 \par\vskip 10pt plus 30pt minus 10pt\par
222 \hskip -5pt\lineseparator
223 \par\vskip 10pt plus 30pt minus 10pt\par
227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231 % macros suck. \ifundefined{nolilyfooter} gives wierd errors from time
233 \ifx\csname nolilyfooter\endcsname\relax
234 \message{footer defined}%
235 \csname lilyfooter\texsuffix\endcsname
237 \message{page empty!}
238 \csname nolilyfooter\texsuffix\endcsname