-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
126 lines (126 loc) · 4.38 KB
/
index.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Piano Keyboard</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css?family=Fira+Code"
rel="stylesheet"
/>
<link href="styles.css" rel="stylesheet" />
<link href="score.css" rel="stylesheet" />
<link rel="manifest" href="manifest.json" />
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
<link rel="apple-touch-icon" type="image/png" href="apple-touch-icon.png" />
<link
rel="icon"
type="image/png"
href="android-chrome-192x192.png"
sizes="192x192"
/>
<link
rel="icon"
type="image/png"
href="android-chrome-512x512.png"
sizes="512x512"
/>
</head>
<body class="rainbow">
<main>
<div id="keyboard">
<div class="settings">
<div class="main-settings">
<div class="toggle-rainbow">
<input
id="toggle-rainbow"
name="toggle-rainbow"
type="checkbox"
checked
onclick="toggleRainbow();"
/>
<label for="toggle-rainbow"> rainbow</label>
</div>
<div class="toggle-shortcuts">
<input
id="toggle-shortcuts"
name="toggle-shortcuts"
type="checkbox"
checked
onclick="toggleShortcuts();"
/>
<label for="toggle-shortcuts"> shortcuts</label>
</div>
</div>
<div id="input-info"></div>
<div class="toggle-complexity">
<input
id="toggle-complexity"
name="toggle-complexity"
type="checkbox"
onclick="toggleComplexity();"
/>
<label for="toggle-complexity"> minimal</label>
</div>
</div>
<div class="keyboard-keys-wrapper">
<div id="keyboard-keys"></div>
</div>
</div>
<div class="info">
<h1>Piano Keyboard</h1>
<textarea id="recordedNotesTextarea"></textarea>
<button
type="button"
text="convert to notes"
onclick="convertToNotes();"
class="button"
>
convert to notes
</button>
<div id="musicOutput" width="100%"></div>
<audio
id="unmuteAudio"
src="data:audio/wav;base64,UklGRisAAABXQVZFZm10IBAAAAABAAEAAQAAAAEAAAABAAgAZGF0YQcAAACAgICAgICAAAA="
x-webkit-airplay="deny"
></audio>
<h2>Info and tips</h2>
<p>
This piano keyboard is created with A4 as 440Hz, with
computer-generated sound using the JavaScript AudioContext,
OscillatorNode, and GainNode.
</p>
<p>
For easier chromatic scales, use the <kbd>tab</kbd> key to progress
forward and <kbd>shift</kbd> + <kbd>tab</kbd> to progress backwards.
</p>
<p>
For less distractions, use the minimal mode. If you want this as an
app on your phone or touch-screen device, save it to your homescreen
and it will automatically use the fullscreen mode.
</p>
<h2>Browser support</h2>
<p>
This app should work in Firefox, Chrome, and Safari on desktop and on
Firefox, Safari, and Opera on iPhone and iPad. Sorry Chrome and Edge
mobile, I still haven't figured out why it doesn't work there.
</p>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/cjs/vexflow.js"></script>
<script src="js/notes-consts.js"></script>
<script src="js/sheetmusic-functions.js"></script>
<script src="js/keyboard-functions.js"></script>
<script src="js/toggle-functions.js"></script>
<script src="js/script.js"></script>
</body>
</html>