这里已经有一个关于五度圈图的问题(关联)但我想在这里添加类似此图的五线谱图片
是否可以在 LaTeX 中完成所有这些操作?我听说有一些用于编写音乐的软件包(但我对此没有经验)。谢谢你的建议。
我使用链接问题的答案解决了这个问题。只是标签。
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\newcommand{\myangle}{30}
\foreach \nota/\text [count=\sector] in {C/C minor,G/G minor,D/D minor,A/A minor,E/E minor, B/B minor, FS/F$\sharp$ minor, CS/C$\sharp$ minor, GS/G$\sharp$ minor, EF/E$\flat$ minor, BF/B$\flat$ minor, F/F minor}
{
\draw[shorten >=3mm] (0,0) -- ++({(4-\sector)*\myangle+90}:3cm) node (\nota) {\text};
}
\end{tikzpicture}
\end{document}
答案1
好问题!使用 MusiXTeX 包,实际上有一个非常优雅的解决方案。分配调号的命令\generalsignature{s}
只需要一个数字,其中s > 0
是升号的数量,s < 0
是降号的数量。
因此,我们可以创建一个foreach
从 到-6
的循环+5
。使用这些整数,可以直接使用 Ti 来分配圆周所需的角度钾Z 作为我们的绘图工具。
代码
\documentclass[tikz,margin=0.5cm]{standalone}
\usepackage{musixtex}
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\CircROne}{4.5}
\pgfmathsetmacro{\CircRTwo}{7}
\pgfmathsetmacro{\MusicR}{5.7}
\pgfmathsetmacro{\InnerLabelR}{3.7}
\pgfmathsetmacro{\OuterLabelR}{8}
% THE GRID
\draw (0,0) circle (\CircROne);
\draw (0,0) circle (\CircRTwo);
\foreach \X in {0,1,...,12}
{
\draw (0,0)--++(75-\X*360/12:\CircRTwo);
}
\draw [fill=white] (0,0) circle (1cm);
% THE MUSIC
\foreach \X in {-6,...,5}
{
\begin{scope}[shift={(90-\X*360/12:\MusicR)},xshift=-0.3cm]
\clip (-1,-1) rectangle (1,1);
\draw (0,0) node
{
\begin{music}
\generalsignature{\X}
\nostartrule
\startextract
\notes\en
\zendextract
\end{music}
};
\end{scope}
}
% INNER LABELS
\foreach \X/\KeyText in {-4/F,-3/C,-2/G,-1/D,0/A,1/E,2/B,3/F$\sharp$,4/C$\sharp$}
{
\draw (90-\X*360/12:\InnerLabelR) node {\KeyText~Minor};
}
\draw (90-5*360/12:\InnerLabelR) node [align=center] {A$\flat$ Minor\\ G$\sharp$ Minor};
\draw (90+6*360/12:\InnerLabelR) node [align=center] {D$\sharp$ Minor\\ E$\flat$ Minor};
\draw (90+5*360/12:\InnerLabelR) node [align=center] {A$\sharp$ Minor\\ B$\flat$ Minor};
% OUTER LABELS
\foreach \X/\KeyText in {-4/A$\flat$,-3/E$\flat$,-2/B$\flat$,-1/F,0/C,1/G,2/D,3/A,4/E}
{
\draw (90-\X*360/12:\OuterLabelR) node {\KeyText~Major};
}
\draw (90-5*360/12:\OuterLabelR) node [align=center] {B Major\\ C$\flat$ Major};
\draw (90+6*360/12:\OuterLabelR) node [align=center] {F$\sharp$ Major\\ G$\flat$ Major};
\draw (90+5*360/12:\OuterLabelR) node [align=center] {D$\flat$ Major\\ C$\sharp$ Major};
\end{tikzpicture}
\end{document}
旋转的五度圈……
\documentclass[tikz,margin=0.5cm]{standalone}
\usepackage{musixtex}
\begin{document}
\foreach \Y in {0,2.5,...,357.5}
{
\begin{tikzpicture}
\pgfmathsetmacro{\CircROne}{4.5}
\pgfmathsetmacro{\CircRTwo}{7}
\pgfmathsetmacro{\MusicR}{5.7}
\pgfmathsetmacro{\InnerLabelR}{3.7}
\pgfmathsetmacro{\OuterLabelR}{8}
\path [use as bounding box] (-9,-9) rectangle (9,9);
% THE GRID
\draw (0,0) circle (\CircROne);
\draw (0,0) circle (\CircRTwo);
\foreach \X in {0,1,...,12}
{
\draw (0,0)--++(\Y+75-\X*360/12:\CircRTwo);
}
\draw [fill=white] (0,0) circle (1cm);
% THE MUSIC
\foreach \X in {-6,...,5}
{
\begin{scope}[shift={(\Y+90-\X*360/12:\MusicR)},xshift=-0.3cm]
\clip (-1,-1) rectangle (1,1);
\draw (0,0) node {
\begin{music}
\generalsignature{\X}
\nostartrule
\startextract
\notes\en
\zendextract
\end{music}
};
\end{scope}
}
% INNER LABELS
\foreach \X/\text in {-4/F,-3/C,-2/G,-1/D,0/A,1/E,2/B,3/F$\sharp$,4/C$\sharp$}
{
\draw (\Y+90-\X*360/12:\InnerLabelR) node {\text~Minor};
}
\draw (\Y+90-5*360/12:\InnerLabelR) node [align=center] {A$\flat$ Minor\\ G$\sharp$ Minor};
\draw (\Y+90+6*360/12:\InnerLabelR) node [align=center] {D$\sharp$ Minor\\ E$\flat$ Minor};
\draw (\Y+90+5*360/12:\InnerLabelR) node [align=center] {A$\sharp$ Minor\\ B$\flat$ Minor};
% OUTER LABELS
\foreach \X/\text in {-4/A$\flat$,-3/E$\flat$,-2/B$\flat$,-1/F,0/C,1/G,2/D,3/A,4/E}
{
\draw (\Y+90-\X*360/12:\OuterLabelR) node {\text~Major};
}
\draw (\Y+90-5*360/12:\OuterLabelR) node [align=center] {B Major\\ C$\flat$ Major};
\draw (\Y+90+6*360/12:\OuterLabelR) node [align=center] {F$\sharp$ Major\\ G$\flat$ Major};
\draw (\Y+90+5*360/12:\OuterLabelR) node [align=center] {D$\flat$ Major\\ C$\sharp$ Major};
\end{tikzpicture}
}
\end{document}