forked from cifkao/tonnetz-viz
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
108 lines (86 loc) · 1.53 KB
/
index.html
File metadata and controls
108 lines (86 loc) · 1.53 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Tonnetz</title>
<style>
body {
font-family: Georgia, "Times New Roman", Times, serif;
font-weight: bold;
}
#tonnetz {
position: fixed;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: 0;
padding: 0;
overflow: hidden;
}
.labels {
color: transparent;
}
.labels > div {
position: absolute;
}
.labels > div > div {
margin-left: -50%;
line-height: 1em;
margin-top: -0.4em;
}
#note-labels .state-OFF {
color: #333333;
}
#note-labels .state-GHOST {
color: #ffffff;
}
#note-labels .state-SUSTAIN {
color: #ffffff;
}
#note-labels .state-ON {
color: #ffffff;
}
#triad-labels .minor {
color: #333333;
}
#triad-labels .minor.state-ON {
color: #ffffff;
}
#triad-labels .major {
color: #333333;
}
#triad-labels .major.state-ON {
color: #ffffff;
}
</style>
<script src="https://code.jquery.com/jquery.js"></script>
<script>
var canvas, ctx, noteLabels, triadLabels;
function main()
{
canvas = document.getElementById("canvas");
ctx = canvas.getContext("2d");
noteLabels = document.getElementById("note-labels");
triadLabels = document.getElementById("triad-labels");
audio.init();
tonnetz.init();
midi.init();
keyboard.init();
}
$(main);
</script>
<script src="audio.js"></script>
<script src="tonnetz.js"></script>
<script src="midi.js"></script>
<script src="keyboard.js"></script>
</head>
<body>
<div id="tonnetz">
<div id="note-labels" class="labels"></div>
<div id="triad-labels" class="labels"></div>
<canvas id="canvas"></canvas>
</div>
</body>
</html>