使用 Tikz 和 Beamer 在 Musixtex 中记竖笛指法的图表

使用 Tikz 和 Beamer 在 Musixtex 中记竖笛指法的图表

需要用 Tikz 和 Beamer 在 Musixtex 中实现竖笛指法图表,基本代码如下:

% !TeX program = txs:///arara
% arara: xelatex: {synctex: on, interaction: nonstopmode, shell: yes}
\documentclass[aspectratio=169]{beamer}
\usepackage[T1]{fontenc}
\usepackage{emerald}
\usepackage[spanish]{babel}
\usepackage{musicography}
\usepackage{musixtex}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{hyperref} %Referencias a las tablas
\usepackage{tabularx} %Tabla con ajuste de ancho
\usepackage{colortbl} %Color a tablas
\usepackage{xcolor}
\xdefinecolor{gray-undar}{RGB}{52,52,52}
\xdefinecolor{red-undar}{RGB}{179,35,79}

\begin{document}

\begin{frame}[fragile,t]
    \frametitle{\LARGE Chart Flute in Musixtex}
    
    \begin{tikzpicture}
    \node[anchor=south west,inner sep=0,rotate=0,transform shape,scale=0.9, ,fill=green!20] (partitura) at (0,0) {
        \hspace*{-0.01cm}\begin{music}
        \parindent0mm
        \afterruleskip-7pt
        \setclefsymbol1\empty
        \nobarnumbers % Omite la numeración en los compases
        \nostartrule % Inicia sin barra vertical
        \startpiece 
        %\scale{0.8}
        \NOTEs\wh c \zcharnote{-10}{\footnotesize \hspace*{-1.5cm} DO}\en 
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh d \zcharnote{-10}{\footnotesize \hspace*{-1.55cm} RE}\en
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh e \zcharnote{-10}{\footnotesize \hspace*{-1.5cm} MI}\en 
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh f \zcharnote{-10}{\footnotesize \hspace*{-1.55cm} FA}\en
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh g \zcharnote{-10}{\footnotesize \hspace*{-1.5cm} SOL}\en 
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh h \zcharnote{-10}{\footnotesize \hspace*{-1.55cm} LA}\en
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh i \zcharnote{-10}{\footnotesize \hspace*{-1.5cm} SI}\en 
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh j \zcharnote{-10}{\footnotesize \hspace*{-1.55cm} DO\scalebox{1.6}{`}}\en
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \NOTEs\wh k \zcharnote{-10}{\footnotesize \hspace*{-1.5cm} RE\scalebox{1.6}{`}}\en 
        \zcharnote{15}{\hspace*{-0.04cm}
        \begin{tikzpicture}
        %Código para dibujar la Flauta
        \begin{scope}[xshift=-1.5cm]
        \draw [red] (0.65,0.9) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.8) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.7) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.6) circle[radius=0.04cm];
        \draw [red,fill=red] (0.69,0.55) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.5) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.4) circle[radius=0.04cm];
        \draw [red,fill=red] (0.67,0.3) circle[radius=0.04cm];
        \draw [red,fill=red] (0.65,0.2) circle[radius=0.04cm];
        \end{scope}
        \end{tikzpicture}}
        \zendpiece
        \end{music}
        };
\end{tikzpicture}


\end{frame}


\end{document}

当前输出如下: 当前的

期望的输出如下: 期望

答案1

我不用musixtex但会吹笛子,也懂一点 TikZ,所以我创建了一个小包来制作 C 和 F 笛子的指法图,叫做recorder-fingering。它可在加拿大运输安全局并包含在任何最新的 TeX 发行版中。

该软件包提供了五个命令(\Sopranino\Soprano\Alto和) \Tenor\Bass这些命令将为该竖笛可演奏范围内的任何音符生成指法图。音符范围从 C 竖笛的 C–Eb 到 F 竖笛的 F–Ab。该软件包允许您以多种方式自定义显示,以及添加颤音指法注释。

音符记为 CB(第一个八度)、cb(第二个八度)和 c'–eb'(第三个八度),对于 F 音调的竖笛,其等效方案从 F 开始。

这些图采用大多数竖笛方法用来显示指法的标准格式,并显示巴洛克/英国指法。拇指孔位于图的最上方,半拇指指法用半实心圆圈标记。接下来的三个是左手,最后四个是右手。db' 音符在底部有一个额外的位置,表示覆盖竖笛的喇叭口。

如果您确实想将图表放到竖笛图像上,恐怕我无法帮助您,尽管可以使用此包来制作指法本身。

这是使用该包生成的图表:

\documentclass[11pt]{article} 
\usepackage{recorder-fingering}
\usepackage{booktabs}
\usepackage[hmargin=.5in]{geometry}
\begin{document}
\section*{Recorder in C fingering chart}
\parindent=0pt
\begin{tabular}{cccccccccccc}
\toprule
C & C\# & D & Eb & E & F & F\# & G & Ab & A & Bb & B\\ 
\midrule
\Soprano{C} & 
\Soprano{C#} & 
\Soprano{D} & 
\Soprano{Eb} & 
\Soprano{E} &
\Soprano{F} &
\Soprano{F#} &
\Soprano{G} &
\Soprano{Ab} &
\Soprano{A} &
\Soprano{Bb} &
\Soprano{B}\\
\bottomrule
\end{tabular}

\bigskip
\begin{tabular}{cccccccccccc}
\toprule
c & c\# & d & eb & e & f & f\# & g & ab & a & bb & b\\ 
\midrule
\Soprano{c} &
\Soprano{c#} &
\Soprano{d} &
\Soprano{eb} &
\Soprano{e} &
\Soprano{f} &
\Soprano{f#} &
\Soprano{g} &
\Soprano{ab} &
\Soprano{a} &
\Soprano{bb} &
\Soprano{b}\\
\bottomrule
\end{tabular}
\hfill
\begin{tabular}{cccc}
\toprule
c' & c\#' & d' & eb'\\
\midrule
\Soprano{c'} &
\Soprano{c#'} &
\Soprano{d'} &
\Soprano{eb'}\\
\bottomrule
\end{tabular}
\end{document} 

代码输出

使用包musixtex

在音乐上使用指法图的最简单方法musixtex是使用 TikZtikzmark库,它允许您在页面上放置任意坐标,然后使用后续\tikz命令引用它们。在下面的示例中,我做了两件事:首先,对于视唱法音符名称,我使用了附加功能musixtexmusixlyr它允许将音符名称输入为单个空格分隔的字符串。

我还创建了一个辅助宏\addf来放置指法。然后在每个音符之前,我们只需使用命令tikzmark在页面上为该音符创建位置,辅助宏将使用该位置来放置指法。

请注意,因为这使用了[remember picture]TikZ 的功能,所以需要两次编译才能使指法显示在正确的位置。

\documentclass{beamer}
\usepackage{musixtex}
\input musixlyr
\usepackage{recorder-fingering}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\NewDocumentCommand{\addf}{m}{\tikz[remember picture]{\node[overlay,above=of pic cs:#1]{\Soprano[width=10pt]{#1}};}}
\begin{document}

\begin{frame}{C Maj scale Soprano/Tenor recorder fingerings}
\begin{music}
\setlyrics{scale}{DO RE ME FA SOL LA SI DO}
\lyrraise{1}{b-2ex}
\assignlyrics{1}{scale}
\startextract
\NOTEs
\tikzmark{C}\wh{c}\tikzmark{D}\wh{d}\tikzmark{E}\wh{e}\tikzmark{F}\wh{f}
\tikzmark{G}\wh{g}\tikzmark{A}\wh{h}\tikzmark{B}\wh{i}\tikzmark{c}\wh{j}
\en
\zendextract
\end{music}
\addf{C}\addf{D}\addf{E}\addf{E}\addf{F}\addf{G}\addf{A}\addf{B}\addf{c}
\end{frame}

\end{document}

投影仪代码的输出

相关内容