blob: 93b55d64168f6022190edd4c32e6cfb9b128f21c (
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
|
\LeadsheetsLibrary{musicsymbols}{2015/07/13 musical symbols}
\RequirePackage{etoolbox}
% define a LaTeX font that uses the `musix' font from MusiXTeX:
\DeclareFontFamily{U}{musix}{}%
\DeclareFontShape{U}{musix}{m}{n}{%
<-12> s * [1.5] musix11
<12-15> s * [1.5] musix13
<15-18> s * [1.5] musix16
<18-23> s * [1.5] musix20
<23-> s * [1.5] musix29
}{}%
% a font switch command:
\newrobustcmd*\musix{\usefont{U}{musix}{m}{n}\selectfont}
% a text font command:
\DeclareTextFontCommand{\textmusix}{\musix}
% the `symbol' command: raises the symnol since most symbols are too low for
% use in normal text:
\newrobustcmd*\musicsymbol[2][0pt]{%
\raisebox{\dimexpr.45ex+(#1)\relax}{\textmusix{#2}}%
}
\newrobustcmd*\leadsheets@altostrut{%
\vphantom{\rule[-.5\normalbaselineskip]{1pt}{1.4\normalbaselineskip}}%
}
\newrobustcmd*\leadsheets@treblestrut{%
\vphantom{\rule[-.4\normalbaselineskip]{1pt}{1.5\normalbaselineskip}}%
}
% define the symbols
\renewrobustcmd*\sharp {\musicsymbol[.2ex]{4}\kern-.06em}
\renewrobustcmd*\flat {\kern-.05em\musicsymbol{2}\kern-.06em}
\renewrobustcmd*\natural {\musicsymbol{6}\kern-.06em}
\newrobustcmd*\doublesharp {\kern.05em\musicsymbol{5}\kern-.05em}
\newrobustcmd*\doubleflat {\kern-.05em\musicsymbol{3}\kern-.06em}
\newrobustcmd*\trebleclef {\leadsheets@treblestrut\smash{\musicsymbol{H}}}
\newrobustcmd*\bassclef {\strut\smash{\musicsymbol{J}}}
\newrobustcmd*\altoclef {\leadsheets@altostrut\smash{\musicsymbol{K}}}
\newrobustcmd*\allabreve {\strut\smash{\kern-.1em\musicsymbol[.25ex]{R}\kern.05em}}
\newrobustcmd*\meterC {\strut\smash{\kern-.1em\musicsymbol[.25ex]{S}\kern.05em}}
\newrobustcmd*\wholerest {\kern.05em\musicsymbol{<}\kern.05em}
\newrobustcmd*\halfrest {\kern.05em\musicsymbol{=}\kern.05em}
\newrobustcmd*\quarterrest {\strut\smash{\musicsymbol[-1.5ex]{>}\kern.4em}}
\newrobustcmd*\eighthrest {\musicsymbol[-1.5ex]{?}\kern.5em}
\newrobustcmd*\sixteenthrest {\kern.05em\musicsymbol[-1.5ex]{@}\kern.5em}
\newcommand*\leadsheets@size{\f@size pt}
\newlength\leadsheets@barheight
\newrobustcmd*\genericbar[1]{%
\setlength\leadsheets@barheight\leadsheets@size
\rule[-.2\leadsheets@barheight]{#1}{\leadsheets@barheight}%
}
\newcommand*\normalbarwidth{.02em}
\newcommand*\thickbarwidth{.15em}
\newcommand*\interbarwidth{.1em}
\newrobustcmd*\leadsheets@thickbar{%
\genericbar{\thickbarwidth}%
}
\newrobustcmd*\leadsheets@repeatcolon{%
\leavevmode
\setlength\leadsheets@barheight\leadsheets@size
\raise.1\leadsheets@barheight\hbox{:}%
}
\newrobustcmd*\leadsheets@interbar{\kern\interbarwidth\relax}
\newrobustcmd*\normalbar{%
\genericbar{\normalbarwidth}%
}
\newrobustcmd*\leftrepeat{%
\leadsheets@thickbar
\leadsheets@interbar
\normalbar
\leadsheets@repeatcolon
}
\newrobustcmd*\rightrepeat{%
\leadsheets@repeatcolon
\normalbar
\leadsheets@interbar
\leadsheets@thickbar
}
\newrobustcmd*\leftrightrepeat{%
\leadsheets@repeatcolon
\leadsheets@thickbar
\leadsheets@interbar
\leadsheets@thickbar
\leadsheets@repeatcolon
}
\newrobustcmd*\doublebar{%
\normalbar
\leadsheets@interbar
\normalbar
}
\newrobustcmd*\stopbar{%
\normalbar
\leadsheets@interbar
\leadsheets@thickbar
}
\endinput
2014/08/10 - initial release
2015/07/13 - scale musix font by 1.9 => else the symbols are rather small!
|