%%
%% include file for LilyPond

\def\mdef#1#2{\def#1{{\musicfnt\char#2}}}

%% musix defs
\parindent=0pt
\newdimen\interlinedist
	\newcount\n
	\newdimen\balkhoog
	\newdimen\staffrulethickness
	\newdimen\interstaffrule

\def\musixtwentydefs{
	\font\textfont=cmr10
	\font\slurufont=xslu20
	\font\slurdfont=xsld20
	\font\slurhfont=xslz20
	\font\hslurufont=xslhu20
	\font\hslurdfont=xslhd20
	\font\hslurhfont=xslhz20
	\font\musicfnt=musix20
	\balkhoog=20pt
	\staffrulethickness=0.4pt

	\musixcalc
}
\def\musixsixteendefs{
	\font\textfont=cmr8
	\font\slurufont=xslu16
	\font\slurdfont=xsld16
	\font\slurhfont=xslz20 % sigh
	\font\hslurufont=xslhu16
	\font\hslurdfont=xslhd16
	\font\hslurhfont=xslhz20
	\font\musicfnt=musix16
	\balkhoog=16pt
	\staffrulethickness=0.4pt

	\musixcalc
}

\def\musixcalc{
	\interstaffrule=\balkhoog
	\advance\interstaffrule by-\staffrulethickness
	\divide\interstaffrule by 4
	\advance\interstaffrule by -\staffrulethickness
}


\def\slurcharh#1{{\slurhfont\char#1}}
\def\slurcharu#1{{\slurufont\char#1}}
\def\slurchard#1{{\slurdfont\char#1}}
\def\hslurcharh#1{{\hslurhfont\char#1}}
\def\hslurcharu#1{{\hslurufont\char#1}}
\def\hslurchard#1{{\hslurdfont\char#1}}

\mdef\quartball{'007}
\mdef\halfball{'010}
\mdef\wholeball{'011}
\mdef\halfrest{'074}
\mdef\wholerest{'075}
\mdef\quartrest{62}
\mdef\eighthrest{63}
\mdef\sixteenthrest{64}
\mdef\thirtysecondrest{65}
\mdef\sharp{52}
\mdef\flat{50}
\mdef\natural{54}
\mdef\sharpsharp{53}
\mdef\flatflat{51}

\mdef\singledot{'00}
\mdef\doubledot{'01}
\mdef\tripledot{'02}
\mdef\mussepline{155}

\mdef\violinclef{71}
\mdef\bassclef{73}
\mdef\cviolinclef{72}
\mdef\cbassclef{74}

\mdef\deigthflag{45}
\mdef\dsixteenthflag{46}
\mdef\dthirtysecondflag{47}

% pointing up
\mdef\ueigthflag{40}
\mdef\usixteenthflag{41}
\mdef\uthirtysecondflag{42}

\def\maatstreep{\vrule height\balkhoog}
\def\finishbar{\vrule height\balkhoog  width 1pt}
\def\generalmeter#1#2{\vbox to 0pt{\vss\textfont\hbox{#1}\hbox{#2}}}
\def\lineseparator{\vbox{\mussepline\vskip -5pt\mussepline}}

\def\beauty{%
	\par\vskip 10pt plus 30pt minus 10pt\par
	\hskip -5pt\lineseparator
	\par\vskip 10pt plus 30pt minus 10pt\par
}

\def\interstaffline{%
	\vskip 10pt
}
\def\ugly{\nointerlineskip\par
\vskip 40pt\par\vbox{\hbox to 0pt{\vrule width30pt height1pt\hss}}\par\vskip 40pt
}
\def\interscoreline{\beauty}


\def\lines#1#2{%
 \vbox{\kern-\interstaffrule
	\n=0\nointerlineskip%
	\loop\ifnum\n<#1\advance\n by1%
		\kern\interstaffrule
		\hrule height \staffrulethickness width#2
		\repeat
	}}

\def\toplines#1{ % why space needed here?
	\vbox to 0pt{\hbox{\kern-6pt\lines{#1}{12pt}}\vss}}
\def\botlines#1{ % idem ditto
	\vbox to 0pt{\vss\hbox{\kern-6pt\lines{#1}{12pt}}}}

%
% a staffsymbol with #1 lines, width #2
% bottom at baseline
\def\linestafsym#1#2{\hbox to 0pt{\vbox to 0pt{\vss\lines{#1}{#2}}\hss}}

\def\vcenter#1{\vbox to 0pt{\vss #1\vss}}
\def\topalign#1{\vbox to 0pt{#1\vss}}

\def\eigthflag{\topalign{\ueigthflag}}
\def\sixteenthflag{\topalign{\usixteenthflag}}
\def\thirtysecondflag{\topalign{\uthirtysecondflag}}

\def\cquartrest{\vcenter\quartrest}
\def\ceighthrest{\vcenter\eighthrest}
\def\csixteenthrest{\vcenter\sixteenthrest}
\def\cthirtysecondrest{\vcenter\thirtysecondrest}

\def\lsingledot{\kern-6pt\singledot}
\def\ldoubledot{\kern-6pt\doubledot}
\def\ltripledot{\kern-6pt\tripledot}



\def\stem#1#2{\vrule height#2 depth-#1}

\def\placebox#1#2#3{%
	\vbox to 0pt{\vss\hbox{\raise #1\hbox to 0pt{\kern #2{}#3\hss}}}%
}


\def\beamslope#1#2{{\count0=#2\advance\count0 by#1\musicfnt\char\count0}}
\def\rulesym#1#2{\vrule height #1 width #2}