对于复合仪表,需要对第二台仪表中的仪表进行校准,基本代码如下:
\documentclass[tikz,border=22mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{musixtex}
\newlength{\musicwidth}%new
\setlength{\musicwidth}{0.95\textwidth}%new, can be set for each instance of a figure environment
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{caption}
\usepackage{tikz}
\begin{document}
%\begin{adjustbox}{width=.6\textwidth,center}
%\resizebox{0.46\textwidth}{!}{%
%\scalebox{0.6}{
%\framebox{
\begin{tikzpicture}%[thick, scale=0.5, every node/.style={scale=0.5}]
\node[anchor=south west,inner sep=0] (image) at (0,0) {
\begin{music}
\parindent3mm
\instrumentnumber{2}
\setstaffs1{1}
\setstaffs2{1}
%\hsize=\musicwidth
\setclef1\treble % Clave de Sol para el Instrumento 1
\setclef2\treble % Clave de Sol para el Instrumento 2
\nobarnumbers % Omite la numeración en los compases
\generalmeter{\meterfrac{2}4} %Compás en 4/4
\setinterstaff{1}{14}%Distancia entre sistemas del pentagrama
\startextract % Se inicia el fragmento musical
\Notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en\setdoublebar
\generalmeter{\meterfrac{3}{4}}\changecontext
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en\setdoublebar
\generalmeter{\meterfrac{4}{4}}\changecontext
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en
\setdoubleBAR
\endextract % Se finaliza el fragmento musical
\end{music}
};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
%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}; }
%Dibujando lineas y texto
\draw[-latex,line width=2pt,red] (-0.09,0.55) -- (-0.09,0.4);
\draw[-latex,line width=2pt,red] (0.05,0.55) -- (0.05,0.4);
\draw[-latex,line width=2pt,red] (0.27,0.55) -- (0.27,0.4);
\draw[-latex,line width=2pt,red] (0.41,0.55) -- (0.41,0.4);
\draw[-latex,line width=2pt,red] (0.55,0.55) -- (0.55,0.4);
\draw[-latex,line width=2pt,red] (0.77,0.55) -- (0.77,0.4);
\draw[-latex,line width=2pt,red] (0.91,0.55) -- (0.91,0.4);
\draw[-latex,line width=2pt,red] (1.05,0.55) -- (1.05,0.4);
\draw[-latex,line width=2pt,red] (1.18,0.55) -- (1.18,0.4);
\end{scope}
\end{tikzpicture}
%}
%\end{adjustbox}
\end{document}
答案1
您必须根据 musixdoc.pdf 第 15.4 章“仪表变化”(第 76 页)明确设置仪表。
\setmeter2{{\meterfrac{2}{4}}}%
\setmeter1{{\meterfrac{6}{8}}}\changecontext
...
%\generalmeter{\meterfrac{3}{4}}\changecontext
\setmeter2{{\meterfrac{3}{4}}}%
\setmeter1{{\meterfrac{9}{8}}}\changecontext
...
%\generalmeter{\meterfrac{4}{4}}\changecontext
\setmeter2{{\meterfrac{4}{4}}}%
\setmeter1{{\meterfrac{12}{8}}}\changecontext
答案2
根据 Daunaf 支持,代码如下:
\documentclass[tikz,border=22mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\usepackage{musixtex}
\newlength{\musicwidth}%new
\setlength{\musicwidth}{0.95\textwidth}%new, can be set for each instance of a figure environment
\begin{document}
\begin{tikzpicture}%[thick, scale=0.5, every node/.style={scale=0.5}]
\node[anchor=south west,inner sep=0] (image) at (0,0) {
\begin{music}
\parindent3mm
\instrumentnumber{2}
\setstaffs1{1}
\setstaffs2{1}
%\hsize=\musicwidth
\setclef1\treble % Clave de Sol para el Instrumento 1
\setclef2\treble % Clave de Sol para el Instrumento 2
\nobarnumbers % Omite la numeración en los compases
%\generalmeter{\meterfrac{2}4} %Compás en 4/4
\setmeter2{{\meterfrac{2}{4}}}%
\setmeter1{{\meterfrac{6}{8}}}%\changecontext
\setinterstaff{1}{14}%Distancia entre sistemas del pentagrama
\startextract % Se inicia el fragmento musical
\Notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en\setdoublebar
%\generalmeter{\meterfrac{3}{4}}\changecontext
\setmeter2{{\meterfrac{3}{4}}}%
\setmeter1{{\meterfrac{9}{8}}}\changecontext
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en\setdoublebar
%\generalmeter{\meterfrac{4}{4}}\changecontext
\setmeter2{{\meterfrac{4}{4}}}%
\setmeter1{{\meterfrac{12}{8}}}\changecontext
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*} \en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en
\notes \ibl0f0 \zqb0{f}\qup j\qb0{f}\tbl0\zqb0{f} \qu {*} & \ibl0f0 \zqb0{f}\qu j\tbl0\zqb0{f} \qu {*}\en
\setdoubleBAR
\endextract % Se finaliza el fragmento musical
\end{music}
};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
%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}; }
%Dibujando lineas y texto
\draw[-latex,line width=2pt,red] (-0.09,0.55) -- (-0.09,0.4);
\draw[-latex,line width=2pt,red] (0.05,0.55) -- (0.05,0.4);
\draw[-latex,line width=2pt,red] (0.27,0.55) -- (0.27,0.4);
\draw[-latex,line width=2pt,red] (0.41,0.55) -- (0.41,0.4);
\draw[-latex,line width=2pt,red] (0.55,0.55) -- (0.55,0.4);
\draw[-latex,line width=2pt,red] (0.77,0.55) -- (0.77,0.4);
\draw[-latex,line width=2pt,red] (0.91,0.55) -- (0.91,0.4);
\draw[-latex,line width=2pt,red] (1.05,0.55) -- (1.05,0.4);
\draw[-latex,line width=2pt,red] (1.18,0.55) -- (1.18,0.4);
\end{scope}
\end{tikzpicture}
\end{document}