]> Git — Sourcephile - julm/violon-tex.git/blob - violon.sty
Ajout : sortie lilypond.
[julm/violon-tex.git] / violon.sty
1 % This file is part of Violon, a violin score engine.
2 % Copyright (C) 2009-2012 Julien Moutinho
3 %
4 % This program is free software: you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published
6 % by the Free Software Foundation, either version 3 of the License,
7 % or any later version.
8 %
9 % This program is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty
11 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 % See the GNU General Public License for more details.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 % Any comment or contribution is welcome
18 % at julm&autogeree.net.
19
20 % Déclaration
21 \def\fileversion{1.0}%
22 \def\filedate{2009/10/11}%
23 \NeedsTeXFormat{LaTeX2e}%
24 \ProvidesPackage{violon}[\filedate\space\fileversion\space%
25 Violin score library (Julien Moutinho)]%
26 % Bibliothèques
27 \usepackage{ifthen}%
28 \usepackage{color}%
29 \usepackage{verbatim}%
30 % Polices
31 \gdef\ssssmall{%
32 \@setfontsize\sssmall{5pt}{5pt}}%
33 \gdef\sssmall{%
34 \@setfontsize\sssmall{6pt}{6pt}}%
35 \gdef\ssmall{%
36 \@setfontsize\ssmall\@viiipt\@ixpt}%
37 \gdef\vlnfingerfont{%
38 \expandafter\color{colVlnBowFingerCord\vlncurrcord}%
39 \fontfamily{pnc}\bfseries\sssmall}%
40 \gdef\vlncordfont{%
41 \color{colVlnBowCord}%
42 \fontfamily{pnc}\bfseries\sssmall}%
43 \gdef\vlnnamefont{%
44 \expandafter\color{colVlnBowNameOctave\the\vlncurroctave}%
45 \fontfamily{pnc}\scshape\ssssmall}%
46 \gdef\vlnpartfont{%
47 \color{colVlnPart}%
48 \fontfamily{pnc}\bfseries\sssmall}%
49 \gdef\vlntimefont{%
50 \fontfamily{pnc}\bfseries\ssssmall}%
51 % Algèbre
52 \newcount\@calc@mod@cnt%
53 \def\modulo#1#2{%
54 \@calc@mod@cnt=#1\relax%
55 \divide\@calc@mod@cnt by#2\relax%
56 \multiply\@calc@mod@cnt by#2\relax%
57 \advance#1 by-\@calc@mod@cnt%
58 }%
59 % Convertisseurs
60 \def\romannumeralz#1{%
61 \ifnum#1>\z@\romannumeral#1\else\number#1\fi%
62 }%
63 % Moteur
64 % Constantes
65 % Couleurs
66 %\definecolor{colVlnBowU}{rgb}{0.24,0.92,0.24}%
67 %\definecolor{colVlnBowD}{rgb}{0.80,0,0}%
68 %\definecolor{colVlnBowU}{rgb}{0.30,0.75,0.75}%
69 \definecolor{colVlnBowU}{gray}{0.50}%
70 \definecolor{colVlnBowD}{gray}{0}%
71 \definecolor{colVlnBowN}{gray}{1}%
72 \definecolor{colVlnBowCord}{rgb}{0,1,0}%
73 \definecolor{colVlnBowFinger}{rgb}{0,0,0}%
74 \definecolor{colVlnBowFingerCord0}{rgb}{0,0,0}%
75 \definecolor{colVlnBowFingerCord1}{rgb}{0,0.66,0}%
76 \definecolor{colVlnBowFingerCord2}{rgb}{0,0,1}%
77 \definecolor{colVlnBowFingerCord3}{rgb}{1,0,0}%
78 \definecolor{colVlnBowName}{rgb}{1,0,0}%
79 \definecolor{colVlnBowNameOctave0}{rgb}{0,0,0}%
80 \definecolor{colVlnBowNameOctave1}{rgb}{0,0.66,0}%
81 \definecolor{colVlnBowNameOctave2}{rgb}{0,0,1}%
82 \definecolor{colVlnBowNameOctave3}{rgb}{1,0,0}%
83 \definecolor{colVlnBowNameOctave4}{rgb}{1,1,0}%
84 \definecolor{colVlnLineHalfToneEven}{gray}{0.98}%
85 \definecolor{colVlnLineHalfToneOdd}{gray}{1}%
86 \definecolor{colVlnLineHalfToneFifth}{gray}{0.92}%
87 \definecolor{colVlnPart}{gray}{0}%
88 \definecolor{colVlnBar}{gray}{.85}%
89 \definecolor{colVlnCrescD}{rgb}{0,0.66,0}%
90 \definecolor{colVlnCrescU}{rgb}{1,0,0}%
91 % Portée
92 % Déclarations
93 \newdimen\vlnstaffhalftonelinevdim%
94 \newskip\vlnstaffvdim%
95 \def\vlnstaffvdimpre{0pt}%
96 \newskip\vlnstaffintervskip%
97 \newskip\vlnstaffvskip%
98 % Initialisations
99 \def\vlnstaffhsize{\hsize}%
100 \def\vlnstaffmaxvsize{\textheight}%
101 \vlnstaffhalftonelinevdim=3pt%
102 \vlnstaffvdim=0pt\relax%
103 \vlnstaffvskip=0pt\relax%
104 \vlnstaffintervskip=\vlnstaffhalftonelinevdim\relax%
105 \multiply\vlnstaffintervskip by 2\relax%
106 \def\vlnstaffhalftoneline#1{%
107 {\color{colVlnLineHalfTone#1}\hrule depth 0pt height \vlnstaffhalftonelinevdim width \vlnstaffhsize }}%
108 \def\vlnstafftoneskip{%
109 \advance\vlnstaffvdim by\vlnstaffhalftonelinevdim%
110 \nobreak%
111 }%
112 \def\vlnstafffivehalftonelines{%
113 \vlnstaffhalftoneline{Odd}\vlnstafftoneskip%
114 \vlnstaffhalftoneline{Even}\vlnstafftoneskip%
115 \vlnstaffhalftoneline{Odd}\vlnstafftoneskip%
116 \vlnstaffhalftoneline{Even}\vlnstafftoneskip%
117 \vlnstaffhalftoneline{Fifth}\vlnstafftoneskip%
118 }%
119 \def\vlnstaffallhalftonelines{%
120 \vlnstaffhalftoneline{Fifth}\vlnstafftoneskip%
121 \vlnstafffivehalftonelines%
122 \vlnstafffivehalftonelines%
123 \vlnstafffivehalftonelines%
124 \vlnstafffivehalftonelines%
125 \vlnstafffivehalftonelines%
126 }%
127 \def\vlnstaff{%
128 \nobreak\vskip\vlnstaffvdimpre%
129 \nobreak\vskip\vlnstaffvdim%
130 \advance\vlnstaffvskip by\vlnstaffvdim\relax%
131 \count@\vlnstaffvskip\relax%
132 \advance\count@ by\vlnstaffvdim\relax%
133 \ifnum\count@>\vlnstaffmaxvsize%
134 \vlnstaffvskip=0pt\relax%
135 \break%
136 \else%
137 \advance\vlnstaffvskip by\vlnstaffintervskip\relax%
138 \nobreak\vskip\vlnstaffintervskip%
139 \fi%
140 \vlnnotehskip=0pt\relax%
141 \vlnstaffvdim=0pt\relax%
142 \vlnstaffallhalftonelines%
143 \advance\vlnstaffvdim by\vlnstaffhalftonelinevdim%
144 \nobreak\vskip-\vlnstaffvdim%
145 }%
146 % Notes
147 % Déclarations
148 % Variables
149 \newskip\vlnnotevskip%
150 \newskip\vlnnotehskip%
151 \newdimen\dimen@%
152 \newdimen\dimen@@%
153 \newdimen\vlnnotevdim%
154 \newdimen\vlnnotevdimmore%
155 \newdimen\vlnnotehdim%
156 \newdimen\vlnnotehdimbase%
157 \newcount\vlncurrfinger%
158 \newcount\vlncurrposbase%
159 \newcount\vlncurrposunit%
160 \newcount\vlncurroctave%
161 \def\vlncurrletter{}%
162 \def\vlncurrshift{}%
163 \newcount\vlnnotepos%
164 \newcount\vlncurrpos%
165 \newcount\vlncurrpitch%
166 \newcount\vlnlastpitch%
167 \newcount\vlnnote%
168 \newcount\vlnbow%
169 \gdef\vlncrescleft{}%
170 \gdef\vlncrescright{}%
171 % Initialisations
172 \vlnnotevskip=0pt\relax%
173 \vlnnotehskip=0pt\relax%
174 \vlnnotevdim=\vlnstaffhalftonelinevdim%
175 \vlnnotevdimmore=1pt\relax%
176 \vlnnotehdimbase=2cm\relax%
177 %\advance\vlnnotevdim by\vlnnotevdimmore%
178 %\advance\vlnnotevdim by\vlnnotevdimmore%
179 \def\vlncurrbow{}%
180 \def\vlncurrrealbow{}%
181 \def\vlncurrcord{}%
182 \def\vlncurrtimenum{}%
183 \def\vlncurrtimeden{}%
184 \def\vlncurrbowwithnext{no}%
185 \def\vlnnotehdimmodetim{yes}%
186 \def\vlnnotehdimmodetxt{}%
187 \parindent=0pt\relax%
188 \parskip=0pt\relax%
189 \parfillskip=0pt\relax%
190 \def\vlncurrposfinger{%
191 \csname vlncurrposfinger\romannumeralz\vlncurrfinger\endcsname%
192 }%
193 \def\vlncurrfingerpos{%
194 \csname vlncurrfingerpos\romannumeralz\vlncurrpos\endcsname%
195 }%
196 %\def\vlncurrposname{%
197 % \csname vlncurrposname\romannumeralz\vlncurrpos\endcsname%
198 % }%
199 \def\vlntimefrac#1/#2{%
200 \leavevmode%
201 \hbox{#1}%
202 \kern-.4ex\lower.3ex\hbox{\bfseries\tiny /}%
203 \kern-.3ex\lower.6ex\hbox{#2}%
204 }%
205 % Graveur
206 \def\vlndoatnote#1#2#3#4{%
207 \nointerlineskip%
208 \vlnnotevskip=0pt\relax%
209 \advance\vlnnotevskip by\vlnstaffhalftonelinevdim\relax%
210 \multiply\vlnnotevskip by#1\relax%
211 \advance\vlnnotevskip by\vlnstaffhalftonelinevdim\relax%
212 %\advance\vlnnotevskip by-\vlnnotevdimmore\relax%
213 \nobreak\vskip\vlnnotevskip\relax%
214 \vrule depth 0pt height 0pt width \vlnnotehskip\relax%
215 \setbox0=#3%
216 \advance\vlnnotevskip by \ht0\relax%
217 #2%
218 \box0%
219 #4%
220 \nobreak\vskip-\vlnnotevskip\relax%
221 \nointerlineskip%
222 }%
223 \def\vlnnotedraw{%
224 % Durée
225 \vlnnotehdim\vlnnotehdimbase%
226 \ifthenelse{\equal{\vlnnotehdimmodetim}{yes}}%
227 {\multiply\vlnnotehdim by\vlncurrtimenum\relax%
228 \divide\vlnnotehdim by\vlncurrtimeden\relax%
229 }%
230 {}%
231 % Automatic staff break
232 \count@\vlnnotehskip\relax%
233 \advance\count@ by\vlnnotehdim\relax%
234 \ifnum\count@>\vlnstaffhsize\vlnstaff\fi%
235 % Explicite
236 \def\vlnnotehdimmodetxtdo{%
237 \vbox to0pt{%
238 \setbox0=\hbox{%
239 \ifthenelse{\equal{\vlncurrtimeden}{1}}%
240 {{\vlntimefont{\vlncurrtimenum}}}%
241 {\vlntimefrac{\vlntimefont{\vlncurrtimenum}}/{\vlntimefont{\vlncurrtimeden}}}%
242 }%
243 \nobreak\vskip\vlnnotevdim\relax%
244 \nobreak\vskip0.2mm\relax%
245 \nobreak\hskip\vlnnotehdim\relax%
246 \nobreak\hskip-\wd0\relax%
247 \dp0=0pt\relax%
248 \box0%
249 }%
250 }%
251 \ifthenelse{\equal{}{\vlnnotehdimmodetxt}}%
252 {\null}%
253 {\vlndoatnote{\vlncurrpos}%
254 {}%
255 {\vlnnotehdimmodetxtdo}%
256 {}%
257 }%
258 % Archet
259 \vlndoatnote{\vlncurrpos}%
260 {\begingroup\expandafter\color{colVlnBow\vlncurrbow}}%
261 {%
262 \hbox{%
263 \ifthenelse{\equal{\vlncurrbow}{N}}
264 {}%
265 {%
266 \vrule depth 0pt height \vlnnotevdim width \vlnnotehdim\relax%
267 \nobreak\hskip-\vlnnotehdim\relax%
268 \dimen@\vlnnotevdim%
269 \divide\dimen@ by3\relax%
270 \dimen@@\vlnnotehdim%
271 \divide\dimen@@ by2\relax%
272 \ifthenelse{\equal{\vlncrescleft}{}}%
273 {%
274 \ifthenelse{\equal{\vlncrescright}{}}%
275 {%
276 }%
277 {%
278 \vrule depth 0pt height 0pt width \dimen@@\relax%
279 \color{colVlnCresc\vlncrescright}%
280 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
281 }%
282 }%
283 {%
284 \ifthenelse{\equal{\vlncrescright}{}}%
285 {%
286 \color{colVlnCresc\vlncrescleft}%
287 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
288 }%
289 {%
290 \color{colVlnCresc\vlncrescleft}%
291 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
292 \color{colVlnCresc\vlncrescright}%
293 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
294 }%
295 }%
296 \global\let\vlncrescleft\vlncrescright%
297 }%
298 }%
299 }%
300 {\endgroup}%
301 % Cordes
302 % Doigts
303 \ifthenelse{\equal{\vlncurrbow}{N}%
304 % \OR\equal{\the\vlncurrfinger}{\vlncurrfingerpos}%
305 % \AND\equal{\the\vlncurrpos}{\vlncurrposfinger}%
306 % \AND\equal{\the\vlncurrcord}{\thevlncurrlastcord}%
307 }%
308 {}%
309 {%
310 \expandafter\edef\csname vlncurrfingerpos\romannumeralz\vlncurrpos\endcsname{\the\vlncurrfinger}%
311 \expandafter\edef\csname vlncurrposfinger\romannumeralz\vlncurrfinger\endcsname{\the\vlncurrpos}%
312 \vlndoatnote{\vlncurrpos}%
313 {}%
314 {\vbox to0pt{%
315 \setbox0=\hbox{{\vlnfingerfont{\the\vlncurrfinger}}}%
316 \nobreak\vskip\vlnnotevdim\relax%
317 \nobreak\vskip0.2mm\relax%
318 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
319 \box0}}%
320 {}%
321 }%
322 % Nom
323 %\expandafter\edef\csname vlncurrposname\romannumeralz\vlncurrpos\endcsname{#5}%
324 \ifthenelse{\equal{\vlncurrbow}{N}}%
325 {}%
326 {%
327 \vlndoatnote{\vlncurrpos}%
328 {}%
329 {\vbox to0pt{%
330 \setbox0=\hbox{{\vlnnamefont{\vlncurrname}}}%
331 \nobreak\vskip-0.275mm\relax%
332 \nobreak\vskip-\ht0\relax%
333 %\vskip-\dp0\relax%
334 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
335 \box0}}%
336 {}%
337 }%
338 % Accord
339 \ifthenelse{\equal{\vlncurrbowwithnext}{yes}}%
340 {%
341 }%
342 {
343 \advance\vlnnotehskip by\vlnnotehdim\relax%
344 }%
345 \nointerlineskip%
346 }%
347 % Cordes
348 \def\vlncordposi{0}% G
349 \def\vlncordposii{7}% D
350 \def\vlncordposiii{14}% A
351 \def\vlncordposiv{21}% E
352 % Demi-tons alphabétiques sans modification
353 \expandafter\def\csname vlnnotetoneofnameG=\endcsname{0}%
354 \expandafter\def\csname vlnnotetoneofnameG+\endcsname{1}%
355 \expandafter\def\csname vlnnotetoneofnameA-\endcsname{1}%
356 \expandafter\def\csname vlnnotetoneofnameA=\endcsname{2}%
357 \expandafter\def\csname vlnnotetoneofnameA+\endcsname{3}%
358 \expandafter\def\csname vlnnotetoneofnameB-\endcsname{3}%
359 \expandafter\def\csname vlnnotetoneofnameB=\endcsname{4}%
360 \expandafter\def\csname vlnnotetoneofnameB+\endcsname{5}%
361 \expandafter\def\csname vlnnotetoneofnameC-\endcsname{4}%
362 \expandafter\def\csname vlnnotetoneofnameC=\endcsname{5}%
363 \expandafter\def\csname vlnnotetoneofnameC+\endcsname{6}%
364 \expandafter\def\csname vlnnotetoneofnameD-\endcsname{6}%
365 \expandafter\def\csname vlnnotetoneofnameD=\endcsname{7}%
366 \expandafter\def\csname vlnnotetoneofnameD+\endcsname{8}%
367 \expandafter\def\csname vlnnotetoneofnameE-\endcsname{8}%
368 \expandafter\def\csname vlnnotetoneofnameE=\endcsname{9}%
369 \expandafter\def\csname vlnnotetoneofnameE+\endcsname{10}%
370 \expandafter\def\csname vlnnotetoneofnameF-\endcsname{9}%
371 \expandafter\def\csname vlnnotetoneofnameF=\endcsname{10}%
372 \expandafter\def\csname vlnnotetoneofnameF+\endcsname{11}%
373 \expandafter\def\csname vlnnotetoneofnameG-\endcsname{11}%
374 % Modifications
375 \expandafter\def\csname vlnshiftsymbol-\endcsname{\kern-0.7pt$\flat$}%
376 \expandafter\def\csname vlnshiftsymbol=\endcsname{}%
377 \expandafter\def\csname vlnshiftsymbol+\endcsname{\kern-0.7pt$\sharp$}%
378 \def\vlnnotedrawtonebyname#1#2#3#4#5#6#7#8{%
379 % Octave
380 \ifthenelse{\equal{#1}{.}}%
381 {}%
382 {\vlncurroctave#1\relax}%
383 % Ton dans l'octave
384 \ifthenelse{\equal{#2}{.}}%
385 {}%
386 {\def\vlncurrletter{#2}}%
387 \ifthenelse{\equal{#3}{.}}%
388 {}%
389 {\def\vlncurrshift{#3}}%
390 \edef\vlncurrname{%
391 \vlncurrletter\csname vlnshiftsymbol\vlncurrshift\endcsname%
392 }%
393 % Position
394 \edef\vlncurroctavepitch{\csname vlnnotetoneofname\vlncurrletter\vlncurrshift\endcsname}%
395 \vlnlastpitch\vlncurrpitch%
396 \vlncurrpitch\vlncurroctavepitch%
397 \count@\vlncurroctave\relax%
398 \multiply\count@ by12\relax%
399 \advance\vlncurrpitch by\count@%
400 % Corde
401 \ifthenelse{\equal{#4}{.}}%
402 {}%
403 {\def\vlncurrcord{#4}%
404 }%
405 \count@\vlncurrcord%
406 \advance\count@ by1\relax%
407 \vlncurrpos\vlncurrpitch%
408 \advance\vlncurrpos by-\csname vlncordpos\romannumeralz\count@\endcsname%
409 % Doigt
410 \ifthenelse{\equal{#5}{.}}%
411 {}%
412 {\vlncurrfinger#5\relax}%
413 % Archet
414 \let\vlnlastlastrealbow\vlnlastrealbow%
415 \let\vlnlastrealbow\vlncurrrealbow%
416 \ifthenelse{\equal{#6}{C}}%
417 {\ifthenelse{\equal{U}{\vlncurrrealbow}}%
418 {\def\vlncurrbow{D}}%
419 {\def\vlncurrbow{U}}}%
420 {\ifthenelse{\equal{#6}{.}}%
421 {\def\vlncurrbow{\vlncurrrealbow}}%
422 {\def\vlncurrbow{#6}}}%
423 \ifthenelse{\equal{\vlncurrbow}{N}}%
424 {}%
425 {\edef\vlncurrrealbow{\vlncurrbow}}%
426 % Durée
427 \ifthenelse{\equal{#7}{.}}%
428 {}%
429 {\def\vlncurrtimenum{#7}}%
430 \ifthenelse{\equal{#8}{.}}%
431 {}%
432 {\def\vlncurrtimeden{#8}}%
433 \let\vlncurrbowwithlast\vlncurrbowwithnext%
434 \@ifnextchar&{%
435 \def\next&{%
436 \def\vlncurrbowwithnext{yes}%
437 \vlnnotelily%
438 \vlnnotedraw%
439 \advance\vlnnote by1\relax%
440 }%
441 \next%
442 }{%
443 \def\vlncurrbowwithnext{no}%
444 \advance\vlnbow by1\relax%
445 \vlnnotelily%
446 \vlnnotedraw%
447 \advance\vlnnote by1\relax%
448 }%
449 }%
450 \def\vlnpart#1{%
451 \vlndoatnote{0}%
452 {}%
453 {\vbox to0pt{%
454 \setbox0=\hbox{{\vlnpartfont{#1}}}%
455 \nobreak\vskip-0.3mm\relax%
456 \nobreak\vskip-\ht0\relax%
457 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
458 \box0}}%
459 {}%
460 }%
461 \def\vlnpartup#1{%
462 \vlndoatnote{0}%
463 {}%
464 {\vbox to0pt{%
465 \setbox0=\hbox{{\vlnpartfont{#1}}}%
466 \nobreak\vskip-0.3mm\relax%
467 \nobreak\vskip-\ht0\relax%
468 \nobreak\vskip-\ht0\relax%
469 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
470 \box0}}%
471 {}%
472 }%
473 \def\vlnbar{%
474 \vlndoatnote{0}%
475 {}%
476 {\vbox to0pt{%
477 \dimen@\vlnstaffvdim%
478 \advance\dimen@ by -\vlnnotevdim\relax%
479 \advance\dimen@ by -\vlnnotevdim\relax%
480 \setbox0=\hbox{{\color{colVlnBar}\vrule depth 0pt height \dimen@ width 0.1pt\relax}}%
481 \nobreak\vskip\vlnnotevdim\relax%
482 \dp0=0pt\relax%
483 \box0}}%
484 {}%
485 }%
486 \def\vlncresc#1{%
487 \global\let\vlncrescleft\vlncrescright%
488 \xdef\vlncrescright{#1}%
489 }%
490 % Lylipond
491 \def\lily{}%
492 % input octave -> Lilypond octave
493 \expandafter\def\csname vlnnotelilyofoctave0\endcsname{}%
494 \expandafter\def\csname vlnnotelilyofoctave1\endcsname{'}%
495 \expandafter\def\csname vlnnotelilyofoctave2\endcsname{''}%
496 \expandafter\def\csname vlnnotelilyofoctave3\endcsname{'''}%
497 % input name -> Lilypond name
498 \expandafter\def\csname vlnnotelilyofnameG=\endcsname{g}%
499 \expandafter\def\csname vlnnotelilyofnameG+\endcsname{gis}%
500 \expandafter\def\csname vlnnotelilyofnameA-\endcsname{aes}%
501 \expandafter\def\csname vlnnotelilyofnameA=\endcsname{a}%
502 \expandafter\def\csname vlnnotelilyofnameA+\endcsname{ais}%
503 \expandafter\def\csname vlnnotelilyofnameB-\endcsname{bes}%
504 \expandafter\def\csname vlnnotelilyofnameB=\endcsname{b}%
505 \expandafter\def\csname vlnnotelilyofnameB+\endcsname{bis}%
506 \expandafter\def\csname vlnnotelilyofnameC-\endcsname{ces}%
507 \expandafter\def\csname vlnnotelilyofnameC=\endcsname{c}%
508 \expandafter\def\csname vlnnotelilyofnameC+\endcsname{cis}%
509 \expandafter\def\csname vlnnotelilyofnameD-\endcsname{des}%
510 \expandafter\def\csname vlnnotelilyofnameD=\endcsname{d}%
511 \expandafter\def\csname vlnnotelilyofnameD+\endcsname{dis}%
512 \expandafter\def\csname vlnnotelilyofnameE-\endcsname{ees}%
513 \expandafter\def\csname vlnnotelilyofnameE=\endcsname{e}%
514 \expandafter\def\csname vlnnotelilyofnameE+\endcsname{eis}%
515 \expandafter\def\csname vlnnotelilyofnameF-\endcsname{fes}%
516 \expandafter\def\csname vlnnotelilyofnameF=\endcsname{f}%
517 \expandafter\def\csname vlnnotelilyofnameF+\endcsname{fis}%
518 \expandafter\def\csname vlnnotelilyofnameG-\endcsname{ges}%
519 \def\lilywrite{%
520 \newwrite\lilyfile%
521 \immediate\openout\lilyfile=out.ly%
522 \immediate\write\lilyfile{\lily}%
523 \immediate\closeout\lilyfile%
524 }%
525 \def\vlnlilyaddnote#1{%
526 \expandafter\xdef\csname lilynote\the\vlnnote\endcsname{#1}%
527 }
528 \def\vlnlilyflush{%
529 \count@0%
530 \ifthenelse{\equal{\the\vlnlilyslurbegin}{0}}%
531 {%
532 }%
533 {%
534 \advance\vlnlilyslurbegin by-1\relax%
535 \expandafter\xdef\csname lilynote\the\vlnlilyslurbegin\endcsname{\csname lilynote\the\vlnlilyslurbegin\endcsname(}%
536 \advance\vlnnote by-1\relax%
537 \expandafter\xdef\csname lilynote\the\vlnnote\endcsname{)\csname lilynote\the\vlnnote\endcsname}%
538 \advance\vlnnote by1\relax%
539 \vlnlilyslurbegin=0%
540 }%
541 \whiledo{\count@<\vlnnote}{%
542 \edef\lily{\lily\csname lilynote\the\count@\endcsname^^J}%
543 \advance\count@ by1\relax%
544 }%
545 }%
546 \def\vlnlilywriteverbatim{%
547 \@bsphack%
548 \let\do\@makeother\dospecials%
549 \catcode`\^^M\active \catcode`\^^I=12%
550 \def\verbatim@processline{%
551 \xdef\lily{\lily\the\verbatim@line^^J}%
552 }%
553 \verbatim@start%
554 }%
555 \def\endvlnlilywriteverbatim{%
556 \@esphack%
557 }%
558 \newcount\vlnlilyslurbegin%
559 \vlnlilyslurbegin=0%
560 \def\vlnlilyslurend{}%
561 \def\vlnnotelily{%
562 \count@=\vlncurrpitch\relax%
563 \advance\count@ by8%
564 \divide\count@ by12%
565 \edef\vlnlilyoctave{\csname vlnnotelilyofoctave\the\count@\endcsname}%
566 \ifthenelse{\equal{\vlncurrbow}{N}}%
567 {%
568 \edef\vlnlilyname{r}%
569 }%
570 {%
571 \edef\vlnlilyname{\csname vlnnotelilyofname\vlncurrletter\vlncurrshift\endcsname}%
572 }%
573 % Phrasé
574 \def\vlnlilytie{}%yes
575 \def\vlnlilyslurend{}%
576 \ifthenelse{\equal{\vlncurrrealbow}{\vlnlastrealbow}}%
577 {%
578 \ifthenelse{\equal{\vlncurrbowwithlast}{yes}}%
579 {%
580 }%
581 {%
582 \ifthenelse{\equal{\the\vlnlilyslurbegin}{0}}%
583 {%
584 \vlnlilyslurbegin\vlnnote%
585 }%
586 {%
587 }%
588 }%
589 }%
590 {%
591 \ifthenelse{\equal{\the\vlnlilyslurbegin}{0}}%
592 {%
593 }%
594 {%
595 \advance\vlnlilyslurbegin by-1\relax%
596 \expandafter\xdef\csname lilynote\the\vlnlilyslurbegin\endcsname{\csname lilynote\the\vlnlilyslurbegin\endcsname(}%
597 \vlnlilyslurbegin=0%
598 \def\vlnlilyslurend{)}%
599 }%
600 }%
601 %\ifthenelse{\equal{\the\vlncurrpitch}{\the\vlnlastpitch}}%
602 %\edef\vlnlilytie{\string~ }%
603 %\edef\vlnlilytie{}
604 %\csname lilynote\the\vlnlilyslurbegin\endcsname%
605 %\expandafter\def\csname lilynote\the\vlnlilyslurbegin\endcsname{#1}%
606 %\ifthenelse{\equal{\vlnlilyslurbegin}{}}%
607 % {\edef\vlnlilyslurend{}}%
608 % {\edef\vlnlilyslurend{)}}%
609 %\edef\vlnlilyslurbegin{}
610 % Accord
611 \ifthenelse{\equal{\vlncurrbowwithnext}{yes}}%
612 {%
613 \ifthenelse{\equal{\vlncurrbowwithlast}{yes}}%
614 {%
615 \vlnlilyaddnote{%
616 \space%
617 \vlnlilyname%
618 \vlnlilyoctave%
619 }%
620 }%
621 {%
622 \vlnlilyaddnote{%
623 \vlnlilytie%
624 \vlnlilyslurend%
625 <\vlnlilyname%
626 \vlnlilyoctave%
627 }%
628 }%
629 }%
630 {%
631 \ifthenelse{\equal{\vlncurrbowwithlast}{yes}}%
632 {%
633 \vlnlilyaddnote{%
634 \space%
635 \vlnlilyname%
636 \vlnlilyoctave%
637 >%
638 }%
639 %\vlncurrtimeden*\vlncurrtimenum%
640 }%
641 {%
642 \vlnlilyaddnote{%
643 \vlnlilyslurend%
644 \vlnlilyname%
645 \vlnlilyoctave%
646 }%
647 %\vlncurrtimeden*\vlncurrtimenum%
648 }%
649 }%
650 }%