lilypond-0.0.28
[lilypond.git] / lilyponddefs.tex
blobfd0d0ed0bafe4623857c3d3fef1c83ab02491299
1 %%
2 %% include file for LilyPond
4 \def\mdef#1#2{\def#1{\mchar{#2}}}
5 \def\mchar#1{\musicfnt\char#1}
6 \def\rationalmultiply#1*#2/#3{\multiply #1 by #2 \divide #1 by #3}
7 \def\maccentraise#1#2{\dimen0=\noteheight
8 \rationalmultiply\dimen0*#2%
9 \raise\dimen0\hbox{#1}}
10 \def\maccentdef#1#2#3{\def#1{\maccentraise{\mchar{#2}}{#3}}}
11 \def\vcenter#1{\vbox to 0pt{\vss #1\vss}}
13 \def\topalign#1{\vbox to 0pt{#1\vss}}
14 \def\botalign#1{\vbox to 0pt{\vss #1}}
16 \def\centeralign#1{\hbox to 0pt{\hss#1\hss}}
17 \def\leftalign#1{\hbox to 0pt{#1\hss}}
18 \def\rightalign#1{\hbox to 0pt{\hss#1}}
21 %% musix defs
22 \parindent=0pt
23 \newdimen\smallspace
24 \newdimen\interlinedist
25 \newcount\n
26 \newdimen\balkhoog
27 \newdimen\notewidth
28 \newdimen\noteheight
29 \newdimen\notewidthhalf
30 \newdimen\notewidthdouble
31 \newdimen\staffrulethickness
32 \newdimen\interstaffrule
33 \newdimen\balkhalf
34 \def\musixtwentydefs{
35 \font\textfont=cmr10
36 \font\meterfont=cmbx12
37 \font\slurufont=xslu20
38 \font\slurdfont=xsld20
39 \font\slurhfont=xslz20
40 \font\hslurufont=xslhu20
41 \font\hslurdfont=xslhd20
42 \font\hslurhfont=xslhz20
43 \font\musicfnt=musix20
44 \font\italicfont=cmti10
45 \font\dynfont=cmbxti10 scaled \magstep1
46 \balkhoog=20pt
47 \notewidth=6pt
48 \noteheight=5pt
49 \staffrulethickness=0.4pt
50 \musixcalc
54 \def\musixsixteendefs{
55 \font\textfont=cmr8
56 \font\meterfont=cmbx12
57 \font\italicfont=cmti8
58 \font\slurufont=xslu16
59 \font\slurdfont=xsld16
60 \font\slurhfont=xslz20 % sigh
61 \font\hslurufont=xslhu16
62 \font\hslurdfont=xslhd16
63 \font\hslurhfont=xslhz20
64 \font\musicfnt=musix16
65 \font\dynfont=cmbxti10
66 \balkhoog=16pt
67 \staffrulethickness=0.4pt
68 \notewidth=5pt
69 \noteheight=4pt
70 \musixcalc
73 \def\musixcalc{
74 \interlinedist=\fontdimen5\musicfnt
75 \smallspace=.3\interlinedist
76 \interstaffrule=\balkhoog
77 \advance\interstaffrule by-\staffrulethickness
78 \divide\interstaffrule by 4
79 \advance\interstaffrule by -\staffrulethickness
80 \notewidthhalf=\notewidth
81 \notewidthdouble=\notewidth
82 \rationalmultiply \notewidthhalf*1/2
83 \multiply \notewidthdouble by 2
84 \balkhalf=\balkhoog
85 \rationalmultiply\balkhalf*1/2
87 % \def\dyn{\italicfont}
88 \def\dyn{\dynfont}
89 \def\dynf{f\kern-.1ex}
90 \def\dynm{f\kern-.15ex}
91 \def\dynp{p\kern-.15ex}
92 \def\ppp{\dynfont\dynp\dynp p}
93 \def\pp{\dynfont\dynp p}
94 \def\p{\dynfont p}
95 \def\mp{\dynfont\dynm p}
96 \def\mf{\dynfont\dynm f}
97 \def\f{\dynfont f}
98 \def\ff{\dynfont\dynf f}
99 \def\fff{\dynfont\dynf\dynf f}
101 \def\slurcharh#1{{\slurhfont\char#1}}
102 \def\slurcharu#1{{\slurufont\char#1}}
103 \def\slurchard#1{{\slurdfont\char#1}}
104 \def\hslurcharh#1{{\hslurhfont\char#1}}
105 \def\hslurcharu#1{{\hslurufont\char#1}}
106 \def\hslurchard#1{{\hslurdfont\char#1}}
108 \mdef\quartball{'007}
109 \mdef\halfball{'010}
110 \mdef\wholeball{'011}
111 \mdef\halfrest{'074}
112 \mdef\wholerest{'075}
113 \mdef\quartrest{62}
114 \mdef\eighthrest{63}
115 \mdef\sixteenthrest{64}
116 \mdef\thirtysecondrest{65}
117 \mdef\sharp{52}
118 \mdef\flat{50}
119 \mdef\natural{54}
120 \mdef\sharpsharp{53}
121 \mdef\flatflat{51}
123 \mdef\singledot{'00}
124 \mdef\doubledot{'01}
125 \mdef\tripledot{'02}
126 \mdef\mussepline{155}
128 \mdef\violinclef{71}
129 \mdef\bassclef{73}
130 \mdef\altoclef{75}
131 \mdef\cviolinclef{72}
132 \mdef\cbassclef{74}
133 \mdef\caltoclef{76}
135 \mdef\deigthflag{45}
136 \mdef\dsixteenthflag{46}
137 \mdef\dthirtysecondflag{47}
139 % pointing up
140 \mdef\ueigthflag{40}
141 \mdef\usixteenthflag{41}
142 \mdef\uthirtysecondflag{42}
144 \maccentdef\repeatcolon{55}{2/1}
145 \def\emptybar{}
147 \def\thinbar{\vrule height\balkhoog}
148 %? what-s wrong with rightalign?
149 \def\thickbar{\vrule height\balkhoog width 2\smallspace}
150 \def\maatstreep{\thinbar}
151 % \def\finishbar{\rightalign{\thinbar\kern\smallspace\thickbar}}
152 \def\finishbar{\hss\rightalign{\thinbar\kern\smallspace\thickbar}}
153 % \def\repeatstopbar{\rightalign{\repeatcolon\hskip2\smallspace\thinbar\hskip\smallspace\thickbar}}
154 \def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\thinbar\hskip\smallspace\thickbar}}
155 % \def\repeatstopbar{\kern-3\smallspace\rightalign{\repeatcolon\kern2\smallspace\thinbar\kern\smallspace\thickbar}\kern3\smallspace}
156 \def\repeatstartbar{\hbox{\thickbar\kern\smallspace\thinbar\kern2\smallspace\repeatcolon}}
157 \def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\thinbar\kern\smallspace\thickbar\kern\smallspace\thickbar\kern\smallspace\thinbar\kern2\smallspace\repeatcolon}}
158 \def\doublebar{\hbox{\thinbar\hskip\smallspace\thinbar}}
160 %compatability
161 \def\repeatbar{\repeatstopbar}
162 \def\startrepeat{\repeatstartbar}
163 \def\repeatbarstartrepeat{\repeatstopstart}
165 \def\generalmeter#1#2{\botalign{\vbox to\balkhalf{\vss \meterfont#1}%
166 \nointerlineskip
167 \vbox to \balkhalf{\vss\meterfont #2}}}
168 \def\defaultlineseparator{\vbox{\mussepline\vskip -5pt\mussepline}}
169 \def\lineseparator{\defaultlineseparator}
170 \def\beauty{%
171 \par\vskip 10pt plus 30pt minus 10pt\par
172 \hskip -5pt\lineseparator
173 \par\vskip 10pt plus 30pt minus 10pt\par
176 \def\interstaffline{%
177 \vskip 10pt
179 \def\ugly{\nointerlineskip\par
180 \vskip 40pt\par\vbox{\leftalign{\vrule width30pt height1pt}}\par\vskip 40pt
182 \def\interscoreline{\beauty}
185 \def\lines#1#2{%
186 \vbox{\kern-\interstaffrule
187 \n=0\nointerlineskip%
188 \loop\ifnum\n<#1\advance\n by1%
189 \kern\interstaffrule
190 \hrule height \staffrulethickness width#2
191 \repeat
194 \def\toplines#1{ % why space needed here?
195 \topalign{\hbox{\kern-\notewidth\lines{#1}{\notewidthdouble}}}}
196 \def\botlines#1{ % idem ditto
197 \botalign{\hbox{\kern-\notewidth\lines{#1}{\notewidthdouble}}}}
200 % a staffsymbol with #1 lines, width #2
201 % bottom at baseline
202 \def\linestafsym#1#2{\leftalign{\botalign{\lines{#1}{#2}}}}
204 \def\eigthflag{\topalign{\ueigthflag}}
205 \def\sixteenthflag{\topalign{\usixteenthflag}}
206 \def\thirtysecondflag{\topalign{\uthirtysecondflag}}
208 \def\cquartrest{\vcenter\quartrest}
209 \def\ceighthrest{\vcenter\eighthrest}
210 \def\csixteenthrest{\vcenter\sixteenthrest}
211 \def\cthirtysecondrest{\vcenter\thirtysecondrest}
213 \def\lsingledot{\kern-\notewidth\singledot}
214 \def\ldoubledot{\kern-\notewidth\doubledot}
215 \def\ltripledot{\kern-\notewidth\tripledot}
217 \maccentdef\sforzato{30}{-3/2}
218 \maccentdef\marcato{20}{-1/1}
219 \maccentdef\imarcato{21}{1/1}
220 \maccentdef\staccato{24}{-1/1}
221 \maccentdef\istaccato{25}{1/1}
222 \maccentdef\staccatissimo{28}{-1/1}
223 \maccentdef\istaccatissimo{29}{1/1}
224 \maccentdef\portato{18}{-9/10}
225 \maccentdef\iportato{19}{9/10}
226 \maccentdef\tenuto{26}{0/1}
227 \maccentdef\itenuto{27}{0/1}
228 \maccentdef\fermata{80}{-1/1}
229 \maccentdef\ifermata{81}{1/1}
233 \mdef\spicato{28}
234 \mdef\ispicato{29}
235 \mdef\upbow{23}
236 \mdef\downbow{22}
237 \mdef\portato{26}
239 \def\stem#1#2{\vrule height#2 depth-#1}
241 \def\placebox#1#2#3{%
242 \botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}%
246 \def\beamslope#1#2{{\count0=#2\advance\count0 by#1\musicfnt\char\count0}}
247 \def\rulesym#1#2{\vrule height #1 width #2}
249 \def\settext#1{\textfont #1}
250 \def\setitalic#1{\italicfont #1}