forked from cwilso/PitchDetect
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
66 lines (61 loc) · 2.25 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
<!doctype html>
<html>
<head>
<title>Pitch Detector</title>
<link rel="shortcut icon" href="#">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<style>
body { font: 14pt 'Alike', sans-serif;}
#note { font-size: 164px;}
.droptarget { background-color: #348781}
div.confident { color: black; }
div.vague { color: lightgrey; }
#note { display: inline-block; height:180px; text-align: left;}
#detector { width: 400px; height: 300px; border: 4px solid gray; border-radius: 8px; text-align: center; padding-top: 10px; margin-right:10px;}
#output { width: 300px; height: 42px; }
#flat { display: none; }
#sharp { display: none; }
select{
height:50px;
width: 400px;
font-size: 30px;
}
.center{
margin: auto;
}
.flat #flat { display: inline; }
.sharp #sharp { display: inline; }
.p5Canvas{margin-left: 4px; margin-top: 50px;}
.button{width: 400px; border: 4px solid black; font-size: 30px}
</style>
</head>
<body>
<p><button class="button" class="center" onclick="startPitchDetect();">Start</button></p>
<!-- <button onclick="toggleOscillator()">use oscillator</button> -->
<!--<button onclick="updatePitch(0);">sample</button>-->
<select name="Instrument" id="my-select">
<option value="C">Piano</option>
<option value="C">Flute</option>
<option value="C">Oboe</option>
<option value="BC">Bassoon</option>
<option value="Bb">Clarinet</option>
<option value="Eb">Alto Sax</option>
<option value="Bb">Tenor Sax</option>
<option value="Eb">Bari Sax</option>
<option value="Bb">Trumpet</option>
<option value="F"> F Horn</option>
<option value="BC">Trombone</option>
<option value="BC">Euphonium</option>
<option value="BC">Tuba</option>
<option value="C">Mallets</option>
</select>
</p>
<div id="detector" class="vague">
<div class="pitch"><span id="pitch">--</span>Hz</div>
<div class="note"><span id="note">--</span></div>
<div id="detune"><span id="detune_amt">--</span><span id="flat">cents ♭</span><span id="sharp">cents ♯</span></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.js"></script>
<script src="js/pitchdetect.js"></script>
</body>
</html>