Debian Codegraph @

texmf-dist/doc/latex/latex4musicians/Figures/sample-abc-all.tex

raw
1 % typeset with:
2 % pdflatex -shell-escape sample-abc-all.tex
3
4 \documentclass{article}
5 \thispagestyle{empty}
6 \usepackage[generate,ps2eps]{abc}
7
8 % --- M-Tx support
9 \newenvironment{mtx}[1][]
10 {\renewcommand{\normalabcoutputfile}{out-mtx}%
11 \abc[program=musixtex,options={-g},extension=mtx,#1]}
12 {\endabc}
13 \newcommand{\mtxinput}[2][]{%
14 \abcinput[program=musixtex,options={-g},extension=mtx,#1]{#2}}
15
16 % --- PMW support
17 \newenvironment{pmw}[1][]
18 {\renewcommand{\normalabcoutputfile}{out-pmw}%
19 \abc[program=pmw,options={-includefont},extension=pmw,#1]}
20 {\endabc}
21 \newcommand{\pmwinput}[2][]{%
22 \abcinput[program=pmw,options={-includefont},extension=pmw,#1]{#2}}
23
24 % --- LilyPond support
25 % !!! BUG: the LilyPond source must begin with a \null command
26 \newenvironment{lily}[1][]
27 {\renewcommand{\normalabcoutputfile}{out-lily}%
28 \abc[program=lilypond,options={-d backend=eps},extension=ly,#1]}
29 {\endabc}
30 \newcommand{\lilyinput}[2][]{%
31 \abcinput[program=lilypond,options={--ps},extension=ly,#1]{#2}}
32
33 % --- MUP support
34 \newenvironment{mup}[1][]
35 {\renewcommand{\normalabcoutputfile}{out-mup}%
36 \abc[program=mup,options={-F},extension=mup,#1]}
37 {\endabc}
38 \newcommand{\mupinput}[2][]{%
39 \abcinput[program=mup,options={-F},extension=mup,#1]{#2}}
40
41 % --- ABC must be redefined
42 \newenvironment{ABC}[1][]
43 {\renewcommand{\normalabcoutputfile}{out-ABC}%
44 \abc[program=abcm2ps,options={-O=},extension=abc,#1]}
45 {\endabc}
46 \newcommand{\ABCinput}[2][]{%
47 \abcinput[program=abcm2ps,options={-O=},extension=abc,#1]{#2}}
48
49 \begin{document}
50
51 This document includes music excerpts written in several formats. It
52 uses \texttt{abc.sty} and defines new environments.
53
54 This is a short piece, typeset by M-Tx:
55
56 \begin{mtx}
57 Title: \bigtype Music sample in M-Tx
58 Style: Solo
59 Meter: C
60 Width: 160mm
61
62 c4 d8 e f g a b | c4 b8 a g f e d | c8 g+ e g c- g+ e g | c4- e c r |
63 \end{mtx}
64
65 The same piece, typeset by LilyPond:
66
67 \begin{lily}
68 % twice - it's required to avoid a bug
69 \version "2.18.2"
70 \version "2.18.2"
71
72 \header {
73 title = "Music sample in LilyPond"
74 tagline = "" % no footer
75 }
76
77 \relative c' {
78 \time 4/4
79 \clef treble
80 c4 d8 e f8 g a b | c4 b8 a g8 f e d |
81 c8 g' e g c,8 g' e g | c,4 e c r \bar "|."
82 }
83 \end{lily}
84
85 The same piece, typeset by PMW:
86
87 \begin{pmw}
88 Heading "|Music sample in PMW"
89 Key C
90 Time 4/4
91
92 [stave 1 treble 1]
93 c d- e-; f-g-a-b-; | c' b- a-; g-f-e-d-; |
94 c-g-e-g-; c-g-e-g-; |c e c r |
95 [endstave]
96 \end{pmw}
97
98 The same piece, typeset by MUP:
99
100 \begin{mup}
101 // music sample in MUP notation
102
103 header
104 title "Music sample in MUP"
105
106 score
107 time=4/4
108
109 music
110 1: 4c; 8d bm; e ebm; f bm; g; a; b ebm;
111 bar
112 1: 4c+; 8b bm; a ebm; g bm; f; e; d ebm;
113 bar
114 1: 8c bm; g; e; g ebm; c bm; g; e; g ebm;
115 bar
116 1: 4c; e; c; r;
117 endbar
118 \end{mup}
119
120 The same piece, typeset by abcm2ps:
121
122 \begin{ABC}
123 X: 1
124 T: Music sample in ABC
125 M: 4/4
126 L: 1/4
127 K: C
128 %
129 C D/E/ F/G/A/B/|c B/A/ G/F/E/D/|C/G/E/G/ C/G/E/G/|CECz|]
130 \end{ABC}
131
132 \end{document}