-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCirclycirc.tex
67 lines (53 loc) · 2.45 KB
/
Circlycirc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% This work is licensed under a Creative Commons Attribution 3.0 Unported License
% author: Clemens Korner
\documentclass[11pt,
parskip=half]
{scrartcl}
\usepackage{tikz}
\usepackage{amsmath}
\newcommand{\drawcirclycirc}[1] {
\begin{tikzpicture}
\tikzstyle{cut}=[dashed]
\tikzstyle{major}=[color=blue!80, line width=6pt]
\tikzstyle{minor}=[color=orange!80, line width=6pt]
\tikzstyle{chordcircle} = []
\ifnum #1=1
\tikzstyle{chordcircle}+=[dashed, fill=white]
\fi
% inner and outer circle
\draw[fill] (0, 0) circle (0.05);
\draw[cut] (0, 0) circle (7.5);
% colored lines and nodes for major and minor chords
\ifnum #1=1
\draw[major] (0, 0) circle (6);
\draw[minor] (0, 0) circle (4);
\draw[major] (-1, 0.75) -- ++(1, 0) node[right, black] {Major};
\draw[minor] (-1, -0.75) -- ++(1, 0) node[right, black] {Minor};
\fi
\foreach \i in {0, ..., 11} {
% angle of the chord names
\tikzstyle{chord}=[rotate={360-360*\i/12}]
% calculate coordinates for chord nodes
\coordinate (majorchord);
\coordinate (minorchrord);
\ifnum #1=1
\coordinate (majorchord) at ({5*cos(90-360*\i/12)}, {5*sin(90-360*\i/12)});
\coordinate (minorchord) at ({3*cos(90-360*\i/12)}, {3*sin(90-360*\i/12)});
\else
\coordinate (majorchord) at ({6*cos(90-360*\i/12)}, {6*sin(90-360*\i/12)});
\coordinate (minorchord) at ({4*cos(90-360*\i/12)}, {4*sin(90-360*\i/12)});
\fi
\draw[chordcircle] ({6*cos(360*\i/12)}, {6*sin(360*\i/12)}) circle (0.7);
\draw[chordcircle] ({4*cos(360*\i/12)}, {4*sin(360*\i/12)}) circle (0.7);
\node[chord] at (majorchord) {\pgfmathparse{\major[\i]}\pgfmathresult};
\node[chord] at (minorchord) {\pgfmathparse{\minor[\i]}\pgfmathresult};
}
\end{tikzpicture}
}
\newcommand{\Text}[1]{\text{\textnormal{#1}}}
\begin{document}
\def\major{{"C", "G", "D", "A", "E", "B", "F$\sharp$/G$\flat$", "C$\sharp$/D$\flat$", "G$\sharp$/A$\flat$", "D$\sharp$/E$\flat$", "A$\sharp$/B$\flat$", "F"}}
\def\minor{{"a", "e", "b", "f$\sharp$/g$\flat$", "c$\sharp$/d$\flat$", "g$\sharp$/a$\flat$", "d$\sharp$/e$\flat$", "a$\sharp$/b$\flat$", "f", "c", "g", "d"}}
\drawcirclycirc{1}
\drawcirclycirc{0}
\end{document}