The quarter note symbol from package wasysym
can be used without loading the package:
\documentclass{article}
\providecommand*{\quarternote}{%
\begingroup
\fontencoding{U}%
\fontfamily{wasy}%
\selectfont
\symbol{12}%
\endgroup
}
\begin{document}
\tiny \quarternote
\scriptsize \quarternote
\small \quarternote
\normalsize \quarternote
\large \quarternote
\Large \quarternote
\LARGE \quarternote
\huge \quarternote
\Huge \quarternote
\end{document}
I would not recommend \Vier
of package harmony
, because it is a constructed symbol at a fixed font size.
The following file compares the the quarter note symbols from wasy
and arev
and removes a substitution warning from the wasy
symbol if \bfseries
is used
(Only sizes smaller 10pt are not available as bold).
\documentclass{article}
% wasy
\newcommand*{\quarternotewasy}{%
\begingroup
\fontencoding{U}%
\fontfamily{wasy}%
\fontshape{n}%
\ssubSeriesBXtoB
\selectfont
\symbol{12}%
\endgroup
}
\makeatletter
\newcommand*{\ssubSeriesBXtoB}{%
\if b\expandafter\@car\f@series{}\@nil
\fontseries{b}%
\fi
}
\makeatother
% arev
\newcommand*{\quarternotearev}{%
\begingroup
\usefont{U}{zavm}{m}{n}%
\symbol{90}%
\endgroup
}
\newcommand*{\test}[2]{%
#2%
\tiny #1%
\scriptsize #1%
\small #1%
\normalsize #1%
\large #1%
\Large #1%
\LARGE #1%
\huge #1%
\Huge #1%
}
\begin{document}
\begin{tabular}{ll}
wasy: & \test{\quarternotewasy}{} \\
wasy-bold: & \test{\quarternotewasy}{\bfseries} \\
arev: & \test{\quarternotearev}{} \\
\end{tabular}
\end{document}
Not properly worked through, but hopefully shows how to "integrate" (in a very loose sense) musixtex
and tikz
.
EDIT: added keyboard and tonic sol-fa labels. Still a bit of mess though.
\documentclass[border=0.25cm]{standalone}
\usepackage{etex}
\usepackage{tikz}
\usepackage{musixtex}
\usetikzlibrary{fit}
\begin{document}
\begin{tikzpicture}
\def\lastnotename{origin}
\newbox\notebox
\coordinate (origin) at (0,0);
\coordinate (stave) at (origin);
\foreach \octave [evaluate={\t=int(\octave*7-7);}] in {0, ..., 5}{
\foreach \pitch [count=\c from 0, evaluate={\x=int(\octave*7+\c+1);}] in {A,...,G}{
\ifnum\t>6
\tikzset{extract anchor/.style={anchor=south west, at=(\lastnotename.south east)}}
\else
\tikzset{extract anchor/.style={anchor=north west, at=(\lastnotename.north east)}}
\fi
\edef\notename{\pitch-\octave}
\node (\notename) [inner sep=0pt, outer sep=0pt,text width=1cm, extract anchor/.try] {%
\begin{music}
\instrumentnumber{1}
\instrumentnumber{2}
\nostartrule
\setstaffs1{1}
\setstaffs2{1}
\ifnum\x>1
\setclefsymbol1{\empty}
\setclefsymbol2{\empty}
\fi
\setclef1{\bass}
\setclef2{\treble}
\startextract
\transpose\t
\ifnum\t>7
\ifnum\t>14
\Notes \nextinstrument \ql{\pitch} \en
\else
\Notes \nextinstrument \qu{\pitch} \en
\fi
\else
\Notes \qu{\pitch} \en
\fi
\zendextract
\end{music}};
\xdef\lastnotename{\pitch-\octave}
}}
\node (stave) [fit={(A-0) (G-5)}] {};
\newif\ifblacknote
\foreach \octave in {0,...,5}
\foreach \pitch [count=\p, evaluate={\t={"la", "si", "so", "r\`e","mi", "fa", "sol"}[\p-1];}] in {A,...,G}{
\node [anchor=base] at ([xshift=0.25cm, yshift=-0.25cm]stave.south -| \pitch-\octave.south) {\t};
\draw ([xshift=0.25cm, yshift=-1cm]stave.south -| \pitch-\octave.south west) rectangle ++(1cm,-4cm);
\blacknotefalse
\ifcase\p
\or
\blacknotetrue
\or
\or
\blacknotetrue
\or
\blacknotetrue
\or
\or
\blacknotetrue
\or
\ifnum\octave<5
\blacknotetrue
\fi
\else
\fi
\ifblacknote
\fill ([xshift=0.25cm, yshift=-1cm]stave.south -| \pitch-\octave.south east) ++(-0.25cm,0) rectangle ++(0.5cm,-2.5cm);
\fi
}
\end{tikzpicture}
\end{document}
OK, here's a much better version...
\documentclass[border=0.25cm]{standalone}
\usepackage{etex}
\usepackage{tikz}
\usepackage{musixtex}
\def\threedp#1{\pgfmathparse{#1}\expandafter\Threedp\pgfmathresult0000@}
\def\Threedp#1.#2#3#4#5@{#1.#2#3#4}
\begin{document}
\pgfdeclarelayer{blacknotes}
\pgfsetlayers{main,blacknotes}
\tikzset{tight fit/.style={inner sep=0pt, outer sep=0pt}}
\begin{tikzpicture}
\def\lastnotenodename{clefs}
\node [text width=1cm, tight fit] (clefs) at (0,0) {
\begin{music}
\instrumentnumber{1}
\instrumentnumber{2}
\nostartrule
\setstaffs1{1}
\setstaffs2{1}
\setclef1{\bass}
\setclef2{\treble}
\startextract
\hskip2.0\elemskip
\zendextract
\end{music}
};
\foreach \note [
evaluate={
\n=int(mod(\note-1, 12));
\octave=int((\note+8)/12);
\t=int(floor((\note-1)/12)*7-7);
\notename={"A","","B","C","","D","","E","F","","G",""}[\n];
\tonicsolfa={"la","","si","so","","r\`e","","mi","fa","","sol",""}[\n];
\blacknote={0,1,0,0,1,0,1,0,0,1,0,1}[\n];
\frequency=(2^((\note-49)/12))*440;}
] in {1,...,88}{
\ifnum\octave>3
\tikzset{extract anchor/.style={anchor=south west, at=(\lastnotenodename.south east)}}
\else
\tikzset{extract anchor/.style={anchor=north west, at=(\lastnotenodename.north east)}}
\fi
\ifnum\blacknote=0
\edef\notenodename{\notename_\octave}
\node (\notenodename) [tight fit,text width=1cm, extract anchor/.try] {%
\begin{music}
\instrumentnumber{1}
\instrumentnumber{2}
\nostartrule
\setstaffs1{1}
\setstaffs2{1}
\setclefsymbol1{\empty}
\setclefsymbol2{\empty}
\setclef1{\bass}
\setclef2{\treble}
\startextract
\transpose\t
\hskip-1.5\elemskip
\ifnum\octave>3
\ifnum\octave>4
\Notes \nextinstrument \ql{\notename} \en
\else
\Notes \nextinstrument \qu{\notename} \en
\fi
\else
\ifnum\octave>2
\Notes \ql{\notename} \en
\else
\Notes \qu{\notename} \en
\fi
\fi
\zendextract
\end{music}
};
\xdef\lastnotenodename{\notenodename}
\node [anchor=base] (sol-fa) at (\notenodename |- 0,-3) {\tonicsolfa$_\octave$};
\draw (\notenodename.south west |- 0,-4) rectangle ++(1, -4);
\node [rotate=90, font=\footnotesize, anchor=east]
at (\notenodename.north |- 0,-4) {\threedp\frequency};
\node [font=\footnotesize, anchor=south]
at (\notenodename.south |- 0,-8) {\note};
\node [font=\footnotesize, anchor=south]
at (\notenodename.south |- 0,-8.5) {\notename$_\octave$};
\draw (\notenodename.south west |- sol-fa.south)
rectangle (\notenodename.south east |- 0,1.125); %0.125 by trial and error
\else
\begin{pgfonlayer}{blacknotes}
\fill ([xshift=-0.25cm]\lastnotenodename.north east |- 0,-4) rectangle ++(0.5, -2.5);
\node [rotate=90, text=white, font=\footnotesize, anchor=east]
at (\lastnotenodename.north east |- 0,-4) {\threedp\frequency};
\end{pgfonlayer}
\fi
}
\node [rotate=90] at (0,-6) {Fr\`equency (Hz)};
\end{tikzpicture}
\end{document}
Best Answer
I'm not sure if I understood the question right and this is what you want but here we go: the code uses the fact that a pitch cannot only be specified with a letter but also with a number. The frequencies are calculated with the formula on the linked Wikipedia site. (I don't know why the margins for
standalone
have to be enlarged manually to see the whole extract...).Here is the same with the
article
class: