需要实现一个安第斯 Quena Pinkullo 手指谱的 Musixtex/Tikz 图表,基本代码如下:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{xcolor}
\xdefinecolor{gray-undar}{RGB}{52,52,52}%0-0-100
\xdefinecolor{red-undar}{RGB}{179,35,79}%341-80-70
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usetikzlibrary{calc}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\NewDocumentCommand{\addBbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
%Código para grillas
%\draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
%\foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
%\foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=blue] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addCbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addDbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=white] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addEbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=white] (0.1,0.41) circle[radius=0.05];
\draw[fill=white] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addFG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=blue] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addGbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\usepackage{amsmath}%Para signo igual
\usepackage{musixtex}
\input {musixfll}
\input {musixper}%percusión
\begin{document}
\begin{music}
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\nobarnumbers
%\nostartrule
\generalmeter{\meterC}
\startextract
\NOTEs\tikzmark{BbG}\wh{_b}\en\bar
\NOTEs\tikzmark{CbG}\wh{_c}\en\bar
\NOTEs\tikzmark{DbG}\wh{_d}\en\bar
\NOTEs\tikzmark{EbG}\wh{_e}\en\bar
\NOTEs\tikzmark{FG}\wh{f}\en\bar
\NOTEs\tikzmark{GbG}\wh{_g}\en
\endextract
\end{music}
\addBbG{BbG}{3}
\addCbG{CbG}{2}
\addDbG{DbG}{1}
\addEbG{EbG}{0}
\addFG{FG}{3}
\addGbG{GbG}{2}
\end{document}
由于某种原因,Tikz Quena 图片的坐标错误......
答案1
我尝试将图像插入为 zcharnotes,并且成功了:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{xcolor}
\xdefinecolor{gray-undar}{RGB}{52,52,52}%0-0-100
\xdefinecolor{red-undar}{RGB}{179,35,79}%341-80-70
\usepackage{etoolbox}
\usepackage{float} %Paquete para posicionar Tablas
\usepackage{tikz}
\usetikzlibrary{arrows.meta, math}
\usetikzlibrary{calc}
\usetikzlibrary{tikzmark}
\usetikzlibrary{positioning}
\usepackage{musicography}% added for \musFlat{}
\NewDocumentCommand{\addBbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
%Código para grillas
%\draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
%\foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
%\foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=blue] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addCbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addDbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=white] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addEbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=white] (0.1,0.41) circle[radius=0.05];
\draw[fill=white] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addFG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=blue] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\NewDocumentCommand{\addGbG}{mm}{\tikz[remember picture]{%
\node[overlay] (A) at ($(pic cs:#1)+(0.1cm,2.2cm)$) {#2};%
\begin{scope}%[x=0cm,y=1.8cm]
% Pinkullo code
%\path let \p1 = (A) in node at (\x1,\y1-0.3) {B};
\draw (0.02,1.1) -- (0.18,1.1);
\draw (0.02,0.1) -- (0.02,1.1);
\draw (0.02,0.1) -- (0.18,0.1);
\draw (0.18,0.1) -- (0.18,1.1);
\draw[fill=white] (0.1,0.25) circle[radius=0.05];
\draw[fill=blue] (0.1,0.41) circle[radius=0.05];
\draw[fill=blue] (-0.06,0.53) circle[radius=0.05];
\draw[fill=blue] (0.06,1.09) --++(0.0cm,-0.13cm)--++(0.04cm,-0.07cm)--++(0.04cm,+0.07cm)--++(0.0cm,0.13cm)--cycle;
%\draw[red-undar] (A) ++ (0.01,-0.03) rectangle (0.03,2.5);
\end{scope}}}
\usepackage{amsmath}%Para signo igual
\usepackage{musixtex}
\input {musixfll}%
\input {musixper}%percusión
\input{musixlyr}% added for \lyrraise
\begin{document}%
\begin{music}
\font\A=phvb8t at 10pt% added for letter type.
\largemusicsize
\nobarnumbers
%\nostartrule
\generalmeter{\meterfrac44}%
\lyrraise{1}{a40pt}%
\A\setlyrics{s}{{~~3} {~~2} {~~1} {~~0} {~~3} {~~2}}%
\startextract
\assignlyrics1{s}%
\NOTEs\zcharnote r{\addBbG{BbG}}\zcharnote n{Si\musFlat{}}\wh{_b}\en\bar
\NOTEs\zcharnote r{\addCbG{CbG}}\zcharnote n{Do\musFlat{}}\wh{_c}\en\bar
\NOTEs\zcharnote r{\addDbG{DbG}}\zcharnote n{Re\musFlat{}}\wh{_d}\en\bar
\NOTEs\zcharnote r{\addEbG{EbG}}\zcharnote n{Mi\musFlat{}}\wh{_e}\en\bar
\NOTEs\zcharnote r{\addFG{FG}}\zcharnote n{Fa}\wh{f}\en\bar
\NOTEs\zcharnote r{\addGbG{GbG}}\zcharnote n{Sol\musFlat{}}\wh{_g}\en
\endextract
\end{music}
\end{document}