summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/latex4musicians/Figures/sample-abc-all.tex
blob: 525fda65be909ec4a9a858a31f98ffdfae02ed34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
% typeset with:
% pdflatex -shell-escape sample-abc-all.tex

\documentclass{article}
\thispagestyle{empty}
\usepackage[generate,ps2eps]{abc}

% --- M-Tx support
\newenvironment{mtx}[1][]
{\renewcommand{\normalabcoutputfile}{out-mtx}%
\abc[program=musixtex,options={-g},extension=mtx,#1]}
{\endabc}
\newcommand{\mtxinput}[2][]{%
\abcinput[program=musixtex,options={-g},extension=mtx,#1]{#2}}

% --- PMW support
\newenvironment{pmw}[1][]
{\renewcommand{\normalabcoutputfile}{out-pmw}%
\abc[program=pmw,options={-includefont},extension=pmw,#1]}
{\endabc}
\newcommand{\pmwinput}[2][]{%
\abcinput[program=pmw,options={-includefont},extension=pmw,#1]{#2}}

% --- LilyPond support
% !!! BUG: the LilyPond source must begin with a \null command
\newenvironment{lily}[1][]
{\renewcommand{\normalabcoutputfile}{out-lily}%
\abc[program=lilypond,options={-d backend=eps},extension=ly,#1]}
{\endabc}
\newcommand{\lilyinput}[2][]{%
\abcinput[program=lilypond,options={--ps},extension=ly,#1]{#2}}

% --- MUP support
\newenvironment{mup}[1][]
{\renewcommand{\normalabcoutputfile}{out-mup}%
\abc[program=mup,options={-F},extension=mup,#1]}
{\endabc}
\newcommand{\mupinput}[2][]{%
\abcinput[program=mup,options={-F},extension=mup,#1]{#2}}

% --- ABC must be redefined
\newenvironment{ABC}[1][]
{\renewcommand{\normalabcoutputfile}{out-ABC}%
\abc[program=abcm2ps,options={-O=},extension=abc,#1]}
{\endabc}
\newcommand{\ABCinput}[2][]{%
\abcinput[program=abcm2ps,options={-O=},extension=abc,#1]{#2}}

\begin{document}

This document includes music excerpts written in several formats. It
uses \texttt{abc.sty} and defines new environments.

This is a short piece, typeset by M-Tx:

\begin{mtx}
Title: Music sample in M-Tx
Style: Solo
Meter: C
Width: 160mm

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 |
\end{mtx}

The same piece, typeset by LilyPond:

\begin{lily}
 % twice - it's required to avoid a bug
\version "2.18.2"
\version "2.18.2"

\header {
  title = "Music sample in LilyPond" 
  tagline = "" % no footer
}

\relative c' {
  \time 4/4
  \clef treble
  c4 d8 e f8 g a b | c4 b8 a g8 f e d |
  c8 g' e g c,8 g' e g | c,4 e c r \bar "|."
}
\end{lily}

The same piece, typeset by PMW:

\begin{pmw}
Heading "|Music sample in PMW"
Key C
Time 4/4

[stave 1 treble 1]
c d- e-; f-g-a-b-; | c' b- a-; g-f-e-d-; |
c-g-e-g-; c-g-e-g-; |c e c r |
[endstave]
\end{pmw}

The same piece, typeset by MUP:

\begin{mup}
// music sample in MUP notation

header
  title "Music sample in MUP"

score
  time=4/4

music
  1: 4c; 8d bm; e ebm; f bm; g; a; b ebm;
  bar
  1: 4c+; 8b bm; a ebm; g bm; f; e; d ebm;
  bar
  1: 8c bm; g; e; g ebm; c bm; g; e; g ebm;
  bar
  1: 4c; e; c; r;
  endbar
\end{mup}

The same piece, typeset by abcm2ps:

\begin{ABC}
X: 1
T: Music sample in ABC
M: 4/4
L: 1/4
K: C
%
C D/E/ F/G/A/B/|c B/A/ G/F/E/D/|C/G/E/G/ C/G/E/G/|CECz|]
\end{ABC}

\end{document}