1 % This file is part of Violon, a violin score engine.
2 % Copyright (C) 2009-2012 Julien Moutinho
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.
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.
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/>.
17 % Any comment or contribution is welcome
18 % at julm&autogeree.net.
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)]%
29 \usepackage{verbatim}%
32 \@setfontsize\sssmall{5pt}{5pt}}%
34 \@setfontsize\sssmall{6pt}{6pt}}%
36 \@setfontsize\ssmall\@viiipt\@ixpt}%
38 \expandafter\color{colVlnBowFingerCord\vlncurrcord}%
39 \fontfamily{pnc}\bfseries\sssmall}%
41 \color{colVlnBowCord}%
42 \fontfamily{pnc}\bfseries\sssmall}%
44 \expandafter\color{colVlnBowNameOctave\the\vlncurroctave}%
45 \fontfamily{pnc}\scshape\ssssmall}%
48 \fontfamily{pnc}\bfseries\sssmall}%
50 \fontfamily{pnc}\bfseries\ssssmall}%
52 \newcount\@calc@mod@cnt%
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%
60 \def\romannumeralz#1{%
61 \ifnum#1>\z@\romannumeral#1\else\number#1\fi%
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}%
93 \newdimen\vlnstaffhalftonelinevdim%
94 \newskip\vlnstaffvdim%
95 \def\vlnstaffvdimpre{0pt}%
96 \newskip\vlnstaffintervskip%
97 \newskip\vlnstaffvskip%
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%
112 \def\vlnstafffivehalftonelines{%
113 \vlnstaffhalftoneline{Odd}\vlnstafftoneskip%
114 \vlnstaffhalftoneline{Even}\vlnstafftoneskip%
115 \vlnstaffhalftoneline{Odd}\vlnstafftoneskip%
116 \vlnstaffhalftoneline{Even}\vlnstafftoneskip%
117 \vlnstaffhalftoneline{Fifth}\vlnstafftoneskip%
119 \def\vlnstaffallhalftonelines{%
120 \vlnstaffhalftoneline{Fifth}\vlnstafftoneskip%
121 \vlnstafffivehalftonelines%
122 \vlnstafffivehalftonelines%
123 \vlnstafffivehalftonelines%
124 \vlnstafffivehalftonelines%
125 \vlnstafffivehalftonelines%
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%
137 \advance\vlnstaffvskip by\vlnstaffintervskip\relax%
138 \nobreak\vskip\vlnstaffintervskip%
140 \vlnnotehskip=0pt\relax%
141 \vlnstaffvdim=0pt\relax%
142 \vlnstaffallhalftonelines%
143 \advance\vlnstaffvdim by\vlnstaffhalftonelinevdim%
144 \nobreak\vskip-\vlnstaffvdim%
149 \newskip\vlnnotevskip%
150 \newskip\vlnnotehskip%
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{}%
163 \newcount\vlnnotepos%
164 \newcount\vlncurrpos%
165 \newcount\vlncurrpitch%
166 \newcount\vlnlastpitch%
168 \newcount\vlncurrtimes%
170 \gdef\vlncrescleft{}%
171 \gdef\vlncrescright{}%
173 \vlnnotevskip=0pt\relax%
174 \vlnnotehskip=0pt\relax%
175 \vlnnotevdim=\vlnstaffhalftonelinevdim%
176 \vlnnotevdimmore=1pt\relax%
177 \vlnnotehdimbase=2cm\relax%
178 %\advance\vlnnotevdim by\vlnnotevdimmore%
179 %\advance\vlnnotevdim by\vlnnotevdimmore%
181 \def\vlncurrrealbow{}%
183 \def\vlncurrtimenum{}%
184 \def\vlncurrtimeden{}%
185 \def\vlncurrbowwithnext{no}%
186 \def\vlnnotehdimmodetim{yes}%
187 \def\vlnnotehdimmodetxt{}%
188 \parindent=0pt\relax%
190 \parfillskip=0pt\relax%
191 \def\vlncurrposfinger{%
192 \csname vlncurrposfinger\romannumeralz\vlncurrfinger\endcsname%
194 \def\vlncurrfingerpos{%
195 \csname vlncurrfingerpos\romannumeralz\vlncurrpos\endcsname%
197 %\def\vlncurrposname{%
198 % \csname vlncurrposname\romannumeralz\vlncurrpos\endcsname%
200 \def\vlntimefrac#1/#2{%
203 \kern-.4ex\lower.3ex\hbox{\bfseries\tiny /}%
204 \kern-.3ex\lower.6ex\hbox{#2}%
207 \def\vlndoatnote#1#2#3#4{%
209 \vlnnotevskip=0pt\relax%
210 \advance\vlnnotevskip by\vlnstaffhalftonelinevdim\relax%
211 \multiply\vlnnotevskip by#1\relax%
212 \advance\vlnnotevskip by\vlnstaffhalftonelinevdim\relax%
213 %\advance\vlnnotevskip by-\vlnnotevdimmore\relax%
214 \nobreak\vskip\vlnnotevskip\relax%
215 \vrule depth 0pt height 0pt width \vlnnotehskip\relax%
217 \advance\vlnnotevskip by \ht0\relax%
221 \nobreak\vskip-\vlnnotevskip\relax%
227 \ifthenelse{\equal{\vlnnotehdimmodetim}{yes}}{%
229 \whiledo{\count@<\vlncurrtimes}{%
230 \dimen@\vlnnotehdimbase%
231 \multiply\dimen@ by\csname vlncurrtimenum\the\count@\endcsname\relax%
232 \divide\dimen@ by\csname vlncurrtimeden\the\count@\endcsname\relax%
233 \advance\vlnnotehdim by\dimen@\relax%
234 \advance\count@ by 1\relax%
238 % Automatic staff break
239 \count@\vlnnotehskip\relax%
240 \advance\count@ by\vlnnotehdim\relax%
241 \ifnum\count@>\vlnstaffhsize\vlnstaff\fi%
243 \def\vlnnotehdimmodetxtdo{%
244 % FIXME: handle \vlncurrtimes
247 \ifthenelse{\equal{\vlncurrtimeden}{1}}%
248 {{\vlntimefont{\vlncurrtimenum}}}%
249 {\vlntimefrac{\vlntimefont{\vlncurrtimenum}}/{\vlntimefont{\vlncurrtimeden}}}%
251 \nobreak\vskip\vlnnotevdim\relax%
252 \nobreak\vskip0.2mm\relax%
253 \nobreak\hskip\vlnnotehdim\relax%
254 \nobreak\hskip-\wd0\relax%
259 \ifthenelse{\equal{}{\vlnnotehdimmodetxt}}%
261 {\vlndoatnote{\vlncurrpos}%
263 {\vlnnotehdimmodetxtdo}%
267 \vlndoatnote{\vlncurrpos}%
268 {\begingroup\expandafter\color{colVlnBow\vlncurrbow}}%
271 \ifthenelse{\equal{\vlncurrbow}{N}}
274 \vrule depth 0pt height \vlnnotevdim width \vlnnotehdim\relax%
275 \nobreak\hskip-\vlnnotehdim\relax%
277 \divide\dimen@ by3\relax%
278 \dimen@@\vlnnotehdim%
279 \divide\dimen@@ by2\relax%
280 \ifthenelse{\equal{\vlncrescleft}{}}%
282 \ifthenelse{\equal{\vlncrescright}{}}%
286 \vrule depth 0pt height 0pt width \dimen@@\relax%
287 \color{colVlnCresc\vlncrescright}%
288 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
292 \ifthenelse{\equal{\vlncrescright}{}}%
294 \color{colVlnCresc\vlncrescleft}%
295 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
298 \color{colVlnCresc\vlncrescleft}%
299 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
300 \color{colVlnCresc\vlncrescright}%
301 \vrule depth 0pt height \dimen@ width \dimen@@\relax%
304 \global\let\vlncrescleft\vlncrescright%
311 \ifthenelse{\equal{\vlncurrbow}{N}%
312 % \OR\equal{\the\vlncurrfinger}{\vlncurrfingerpos}%
313 % \AND\equal{\the\vlncurrpos}{\vlncurrposfinger}%
314 % \AND\equal{\the\vlncurrcord}{\thevlncurrlastcord}%
318 \expandafter\edef\csname vlncurrfingerpos\romannumeralz\vlncurrpos\endcsname{\the\vlncurrfinger}%
319 \expandafter\edef\csname vlncurrposfinger\romannumeralz\vlncurrfinger\endcsname{\the\vlncurrpos}%
320 \vlndoatnote{\vlncurrpos}%
323 \setbox0=\hbox{{\vlnfingerfont{\the\vlncurrfinger}}}%
324 \nobreak\vskip\vlnnotevdim\relax%
325 \nobreak\vskip0.2mm\relax%
326 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
331 %\expandafter\edef\csname vlncurrposname\romannumeralz\vlncurrpos\endcsname{#5}%
332 \ifthenelse{\equal{\vlncurrbow}{N}}%
335 \vlndoatnote{\vlncurrpos}%
338 \setbox0=\hbox{{\vlnnamefont{\vlncurrname}}}%
339 \nobreak\vskip-0.275mm\relax%
340 \nobreak\vskip-\ht0\relax%
342 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
347 \ifthenelse{\equal{\vlncurrbowwithnext}{yes}}%
351 \advance\vlnnotehskip by\vlnnotehdim\relax%
356 \def\vlncordposi{0}% G
357 \def\vlncordposii{7}% D
358 \def\vlncordposiii{14}% A
359 \def\vlncordposiv{21}% E
360 % Demi-tons alphabétiques sans modification
361 \expandafter\def\csname vlnnotetoneofnameG=\endcsname{0}%
362 \expandafter\def\csname vlnnotetoneofnameG+\endcsname{1}%
363 \expandafter\def\csname vlnnotetoneofnameA-\endcsname{1}%
364 \expandafter\def\csname vlnnotetoneofnameA=\endcsname{2}%
365 \expandafter\def\csname vlnnotetoneofnameA+\endcsname{3}%
366 \expandafter\def\csname vlnnotetoneofnameB-\endcsname{3}%
367 \expandafter\def\csname vlnnotetoneofnameB=\endcsname{4}%
368 \expandafter\def\csname vlnnotetoneofnameB+\endcsname{5}%
369 \expandafter\def\csname vlnnotetoneofnameC-\endcsname{4}%
370 \expandafter\def\csname vlnnotetoneofnameC=\endcsname{5}%
371 \expandafter\def\csname vlnnotetoneofnameC+\endcsname{6}%
372 \expandafter\def\csname vlnnotetoneofnameD-\endcsname{6}%
373 \expandafter\def\csname vlnnotetoneofnameD=\endcsname{7}%
374 \expandafter\def\csname vlnnotetoneofnameD+\endcsname{8}%
375 \expandafter\def\csname vlnnotetoneofnameE-\endcsname{8}%
376 \expandafter\def\csname vlnnotetoneofnameE=\endcsname{9}%
377 \expandafter\def\csname vlnnotetoneofnameE+\endcsname{10}%
378 \expandafter\def\csname vlnnotetoneofnameF-\endcsname{9}%
379 \expandafter\def\csname vlnnotetoneofnameF=\endcsname{10}%
380 \expandafter\def\csname vlnnotetoneofnameF+\endcsname{11}%
381 \expandafter\def\csname vlnnotetoneofnameG-\endcsname{11}%
383 \expandafter\def\csname vlnshiftsymbol-\endcsname{\kern-0.7pt$\flat$}%
384 \expandafter\def\csname vlnshiftsymbol=\endcsname{}%
385 \expandafter\def\csname vlnshiftsymbol+\endcsname{\kern-0.7pt$\sharp$}%
386 \def\vlnnotedrawtonebyname#1#2#3#4#5#6#7#8{%
388 \ifthenelse{\equal{#1}{.}}%
390 {\vlncurroctave#1\relax}%
392 \ifthenelse{\equal{#2}{.}}%
394 {\def\vlncurrletter{#2}}%
395 \ifthenelse{\equal{#3}{.}}%
397 {\def\vlncurrshift{#3}}%
399 \vlncurrletter\csname vlnshiftsymbol\vlncurrshift\endcsname%
402 \edef\vlncurroctavepitch{\csname vlnnotetoneofname\vlncurrletter\vlncurrshift\endcsname}%
403 \vlnlastpitch\vlncurrpitch%
404 \vlncurrpitch\vlncurroctavepitch%
405 \count@\vlncurroctave\relax%
406 \multiply\count@ by12\relax%
407 \advance\vlncurrpitch by\count@%
409 \ifthenelse{\equal{#4}{.}}%
411 {\def\vlncurrcord{#4}%
414 \advance\count@ by1\relax%
415 \vlncurrpos\vlncurrpitch%
416 \advance\vlncurrpos by-\csname vlncordpos\romannumeralz\count@\endcsname%
418 \ifthenelse{\equal{#5}{.}}%
420 {\vlncurrfinger#5\relax}%
422 \let\vlnlastlastrealbow\vlnlastrealbow%
423 \let\vlnlastrealbow\vlncurrrealbow%
424 \ifthenelse{\equal{#6}{C}}%
425 {\ifthenelse{\equal{U}{\vlncurrrealbow}}%
426 {\def\vlncurrbow{D}}%
427 {\def\vlncurrbow{U}}}%
428 {\ifthenelse{\equal{#6}{.}}%
429 {\def\vlncurrbow{\vlncurrrealbow}}%
430 {\def\vlncurrbow{#6}}}%
431 \ifthenelse{\equal{\vlncurrbow}{N}}%
433 {\edef\vlncurrrealbow{\vlncurrbow}}%
435 \vlncurrtimes0\relax%
436 \def\@nexttime##1+##2##3{%
437 \ifthenelse{\equal{##2}{.}}%
439 {\def\vlncurrtimenum{##2}}%
440 \ifthenelse{\equal{##3}{.}}%
442 {\def\vlncurrtimeden{##3}}%
443 \expandafter\edef\csname vlncurrtimenum\the\vlncurrtimes\endcsname{\vlncurrtimenum}%
444 \expandafter\edef\csname vlncurrtimeden\the\vlncurrtimes\endcsname{\vlncurrtimeden}%
445 \advance\vlncurrtimes by 1\relax%
446 \@ifnextchar+{\@nexttime{##1}}{##1}%
449 \let\vlncurrbowwithlast\vlncurrbowwithnext%
452 \def\vlncurrbowwithnext{yes}%
455 \advance\vlnnote by1\relax%
459 \def\vlncurrbowwithnext{no}%
460 \advance\vlnbow by1\relax%
463 \advance\vlnnote by1\relax%
466 \@nexttime\@nextbow+{#7}{#8}%
472 \setbox0=\hbox{{\vlnpartfont{#1}}}%
473 \nobreak\vskip-0.3mm\relax%
474 \nobreak\vskip-\ht0\relax%
475 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
483 \setbox0=\hbox{{\vlnpartfont{#1}}}%
484 \nobreak\vskip-0.3mm\relax%
485 \nobreak\vskip-\ht0\relax%
486 \nobreak\vskip-\ht0\relax%
487 \dp0=0pt\relax% NOTE: to prevent fonts like pnc to mess up the vertical alignment
495 \dimen@\vlnstaffvdim%
496 \advance\dimen@ by -\vlnnotevdim\relax%
497 \advance\dimen@ by -\vlnnotevdim\relax%
498 \setbox0=\hbox{{\color{colVlnBar}\vrule depth 0pt height \dimen@ width 0.1pt\relax}}%
499 \nobreak\vskip\vlnnotevdim\relax%
505 \global\let\vlncrescleft\vlncrescright%
506 \xdef\vlncrescright{#1}%
510 % input time fraction -> Lilypond dotted duration
511 \expandafter\def\csname vlnnotelilyofduration1/2\endcsname{2}%
512 \expandafter\def\csname vlnnotelilyofduration2/2\endcsname{1}%
513 \expandafter\def\csname vlnnotelilyofduration3/2\endcsname{2.}%
514 \expandafter\def\csname vlnnotelilyofduration1/4\endcsname{4}%
515 \expandafter\def\csname vlnnotelilyofduration2/4\endcsname{2}%
516 \expandafter\def\csname vlnnotelilyofduration3/4\endcsname{???}%
517 \expandafter\def\csname vlnnotelilyofduration4/4\endcsname{1}%
518 \expandafter\def\csname vlnnotelilyofduration1/8\endcsname{8}%
519 \expandafter\def\csname vlnnotelilyofduration2/8\endcsname{4}%
520 \expandafter\def\csname vlnnotelilyofduration3/8\endcsname{4.}%
521 \expandafter\def\csname vlnnotelilyofduration4/8\endcsname{2}%
522 \expandafter\def\csname vlnnotelilyofduration5/8\endcsname{???}%
523 \expandafter\def\csname vlnnotelilyofduration6/8\endcsname{???}%
524 \expandafter\def\csname vlnnotelilyofduration7/8\endcsname{???}%
525 \expandafter\def\csname vlnnotelilyofduration8/8\endcsname{1}%
526 \expandafter\def\csname vlnnotelilyofduration1/12\endcsname{12}%
527 \expandafter\def\csname vlnnotelilyofduration2/12\endcsname{???}%
528 \expandafter\def\csname vlnnotelilyofduration3/12\endcsname{???}%
529 \expandafter\def\csname vlnnotelilyofduration4/12\endcsname{3}%
530 \expandafter\def\csname vlnnotelilyofduration5/12\endcsname{???}%
531 \expandafter\def\csname vlnnotelilyofduration6/12\endcsname{2}%
532 \expandafter\def\csname vlnnotelilyofduration7/12\endcsname{???}%
533 \expandafter\def\csname vlnnotelilyofduration8/12\endcsname{???}%
534 \expandafter\def\csname vlnnotelilyofduration9/12\endcsname{???}%
535 \expandafter\def\csname vlnnotelilyofduration10/12\endcsname{???}%
536 \expandafter\def\csname vlnnotelilyofduration11/12\endcsname{???}%
537 \expandafter\def\csname vlnnotelilyofduration12/12\endcsname{1}%
538 \expandafter\def\csname vlnnotelilyofduration1/16\endcsname{16}%
539 \expandafter\def\csname vlnnotelilyofduration2/16\endcsname{8}%
540 \expandafter\def\csname vlnnotelilyofduration3/16\endcsname{8.}%
541 \expandafter\def\csname vlnnotelilyofduration4/16\endcsname{4}%
542 \expandafter\def\csname vlnnotelilyofduration5/16\endcsname{???}%
543 \expandafter\def\csname vlnnotelilyofduration6/16\endcsname{???}%
544 \expandafter\def\csname vlnnotelilyofduration7/16\endcsname{???}%
545 \expandafter\def\csname vlnnotelilyofduration8/16\endcsname{2}%
546 \expandafter\def\csname vlnnotelilyofduration9/16\endcsname{???}%
547 \expandafter\def\csname vlnnotelilyofduration10/16\endcsname{???}%
548 \expandafter\def\csname vlnnotelilyofduration11/16\endcsname{???}%
549 \expandafter\def\csname vlnnotelilyofduration12/16\endcsname{???}%
550 \expandafter\def\csname vlnnotelilyofduration13/16\endcsname{???}%
551 \expandafter\def\csname vlnnotelilyofduration14/16\endcsname{???}%
552 \expandafter\def\csname vlnnotelilyofduration15/16\endcsname{???}%
553 \expandafter\def\csname vlnnotelilyofduration16/16\endcsname{1}%
554 \expandafter\def\csname vlnnotelilyofduration1/32\endcsname{32}%
555 \expandafter\def\csname vlnnotelilyofduration2/32\endcsname{16}%
556 \expandafter\def\csname vlnnotelilyofduration3/32\endcsname{???}%
557 \expandafter\def\csname vlnnotelilyofduration4/32\endcsname{8}%
558 \expandafter\def\csname vlnnotelilyofduration5/32\endcsname{???}%
559 \expandafter\def\csname vlnnotelilyofduration6/32\endcsname{???}%
560 \expandafter\def\csname vlnnotelilyofduration7/32\endcsname{???}%
561 \expandafter\def\csname vlnnotelilyofduration8/32\endcsname{4}%
562 \expandafter\def\csname vlnnotelilyofduration9/32\endcsname{???}%
563 \expandafter\def\csname vlnnotelilyofduration10/32\endcsname{???}%
564 \expandafter\def\csname vlnnotelilyofduration11/32\endcsname{???}%
565 \expandafter\def\csname vlnnotelilyofduration12/32\endcsname{???}%
566 \expandafter\def\csname vlnnotelilyofduration13/32\endcsname{???}%
567 \expandafter\def\csname vlnnotelilyofduration14/32\endcsname{???}%
568 \expandafter\def\csname vlnnotelilyofduration15/32\endcsname{???}%
569 \expandafter\def\csname vlnnotelilyofduration16/32\endcsname{2}%
570 \expandafter\def\csname vlnnotelilyofduration17/32\endcsname{???}%
571 \expandafter\def\csname vlnnotelilyofduration18/32\endcsname{???}%
572 \expandafter\def\csname vlnnotelilyofduration19/32\endcsname{???}%
573 \expandafter\def\csname vlnnotelilyofduration20/32\endcsname{???}%
574 \expandafter\def\csname vlnnotelilyofduration21/32\endcsname{???}%
575 \expandafter\def\csname vlnnotelilyofduration22/32\endcsname{???}%
576 \expandafter\def\csname vlnnotelilyofduration23/32\endcsname{???}%
577 \expandafter\def\csname vlnnotelilyofduration24/32\endcsname{???}%
578 \expandafter\def\csname vlnnotelilyofduration25/32\endcsname{???}%
579 \expandafter\def\csname vlnnotelilyofduration26/32\endcsname{???}%
580 \expandafter\def\csname vlnnotelilyofduration27/32\endcsname{???}%
581 \expandafter\def\csname vlnnotelilyofduration28/32\endcsname{???}%
582 \expandafter\def\csname vlnnotelilyofduration29/32\endcsname{???}%
583 \expandafter\def\csname vlnnotelilyofduration30/32\endcsname{???}%
584 \expandafter\def\csname vlnnotelilyofduration31/32\endcsname{???}%
585 \expandafter\def\csname vlnnotelilyofduration32/32\endcsname{1}%
586 % input octave -> Lilypond octave
587 \expandafter\def\csname vlnnotelilyofoctave0\endcsname{}%
588 \expandafter\def\csname vlnnotelilyofoctave1\endcsname{'}%
589 \expandafter\def\csname vlnnotelilyofoctave2\endcsname{''}%
590 \expandafter\def\csname vlnnotelilyofoctave3\endcsname{'''}%
591 % input name -> Lilypond name
592 \expandafter\def\csname vlnnotelilyofnameG=\endcsname{g}%
593 \expandafter\def\csname vlnnotelilyofnameG+\endcsname{gis}%
594 \expandafter\def\csname vlnnotelilyofnameA-\endcsname{aes}%
595 \expandafter\def\csname vlnnotelilyofnameA=\endcsname{a}%
596 \expandafter\def\csname vlnnotelilyofnameA+\endcsname{ais}%
597 \expandafter\def\csname vlnnotelilyofnameB-\endcsname{bes}%
598 \expandafter\def\csname vlnnotelilyofnameB=\endcsname{b}%
599 \expandafter\def\csname vlnnotelilyofnameB+\endcsname{bis}%
600 \expandafter\def\csname vlnnotelilyofnameC-\endcsname{ces}%
601 \expandafter\def\csname vlnnotelilyofnameC=\endcsname{c}%
602 \expandafter\def\csname vlnnotelilyofnameC+\endcsname{cis}%
603 \expandafter\def\csname vlnnotelilyofnameD-\endcsname{des}%
604 \expandafter\def\csname vlnnotelilyofnameD=\endcsname{d}%
605 \expandafter\def\csname vlnnotelilyofnameD+\endcsname{dis}%
606 \expandafter\def\csname vlnnotelilyofnameE-\endcsname{ees}%
607 \expandafter\def\csname vlnnotelilyofnameE=\endcsname{e}%
608 \expandafter\def\csname vlnnotelilyofnameE+\endcsname{eis}%
609 \expandafter\def\csname vlnnotelilyofnameF-\endcsname{fes}%
610 \expandafter\def\csname vlnnotelilyofnameF=\endcsname{f}%
611 \expandafter\def\csname vlnnotelilyofnameF+\endcsname{fis}%
612 \expandafter\def\csname vlnnotelilyofnameG-\endcsname{ges}%
615 \immediate\openout\lilyfile=out.ly%
616 \immediate\write\lilyfile{\lily}%
617 \immediate\closeout\lilyfile%
619 \def\vlnlilyaddnote#1{%
620 \expandafter\xdef\csname lilynote\the\vlnnote\endcsname{#1}%
624 \ifthenelse{\equal{\the\vlnlilyslurbegin}{0}}%
628 \advance\vlnlilyslurbegin by-1\relax%
629 \expandafter\xdef\csname lilynote\the\vlnlilyslurbegin\endcsname{\csname lilynote\the\vlnlilyslurbegin\endcsname(}%
630 \advance\vlnnote by-1\relax%
631 \expandafter\xdef\csname lilynote\the\vlnnote\endcsname{)\csname lilynote\the\vlnnote\endcsname}%
632 \advance\vlnnote by1\relax%
635 \whiledo{\count@<\vlnnote}{%
636 \edef\lily{\lily\csname lilynote\the\count@\endcsname^^J}%
637 \advance\count@ by1\relax%
640 \def\vlnlilywriteverbatim{%
642 \let\do\@makeother\dospecials%
643 \catcode`\^^M\active \catcode`\^^I=12%
644 \def\verbatim@processline{%
645 \xdef\lily{\lily\the\verbatim@line^^J}%
649 \def\endvlnlilywriteverbatim{%
652 \newcount\vlnlilyslurbegin%
654 \def\vlnlilyslurend{}%
656 \count@=\vlncurrpitch\relax%
659 \edef\vlnlilyoctave{\csname vlnnotelilyofoctave\the\count@\endcsname}%
660 \ifthenelse{\equal{\vlncurrbow}{N}}%
662 \edef\vlnlilyname{r}%
663 \edef\vlnlilyoctave{}%
666 \edef\vlnlilyname{\csname vlnnotelilyofname\vlncurrletter\vlncurrshift\endcsname}%
668 \edef\text@{\csname vlncurrtimenum0\endcsname/\csname vlncurrtimeden0\endcsname}%
669 \edef\vlnlilyduration{\csname vlnnotelilyofduration\text@\endcsname}%
671 \whiledo{\count@<\vlncurrtimes}{%
672 \edef\text@{\csname vlncurrtimenum\the\count@\endcsname/\csname vlncurrtimeden\the\count@\endcsname}%
673 \edef\vlnlilyduration{%
674 \vlnlilyduration\string~\vlnlilyname\vlnlilyoctave\csname vlnnotelilyofduration\text@\endcsname%
676 \advance\count@ by 1\relax%
679 \def\vlnlilytie{}%yes
680 \def\vlnlilyslurend{}%
681 \ifthenelse{\equal{\vlncurrrealbow}{\vlnlastrealbow}}%
683 \ifthenelse{\equal{\vlncurrbowwithlast}{yes}}%
687 \ifthenelse{\equal{\the\vlnlilyslurbegin}{0}}%
689 \vlnlilyslurbegin\vlnnote%
696 \ifthenelse{\equal{\the\vlnlilyslurbegin}{0}}%
700 \advance\vlnlilyslurbegin by-1\relax%
701 \expandafter\xdef\csname lilynote\the\vlnlilyslurbegin\endcsname{\csname lilynote\the\vlnlilyslurbegin\endcsname(}%
703 \def\vlnlilyslurend{)}%
706 %\ifthenelse{\equal{\the\vlncurrpitch}{\the\vlnlastpitch}}%
707 %\edef\vlnlilytie{\string~ }%
709 %\csname lilynote\the\vlnlilyslurbegin\endcsname%
710 %\expandafter\def\csname lilynote\the\vlnlilyslurbegin\endcsname{#1}%
711 %\ifthenelse{\equal{\vlnlilyslurbegin}{}}%
712 % {\edef\vlnlilyslurend{}}%
713 % {\edef\vlnlilyslurend{)}}%
714 %\edef\vlnlilyslurbegin{}
716 \ifthenelse{\equal{\vlncurrbowwithnext}{yes}}%
718 \ifthenelse{\equal{\vlncurrbowwithlast}{yes}}%
736 \ifthenelse{\equal{\vlncurrbowwithlast}{yes}}%
745 %\vlncurrtimeden*\vlncurrtimenum%
754 %\vlncurrtimeden*\vlncurrtimenum%