This repository was archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
70 lines (59 loc) · 1.37 KB
/
index.html
File metadata and controls
70 lines (59 loc) · 1.37 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
<!DOCTYPE html>
<html>
<head>
<title>Logo</title>
<script type="text/javascript" src="https://tonejs.github.io/build/Tone.min.js"></script>
<script type="text/javascript" src="./build/Logo.js"></script>
<script type="text/javascript" src="./deps/audiokeys.js"></script>
<link rel="stylesheet" href="./deps/fontello/css/fontello.css">
</head>
<body>
<style type="text/css">
body {
background-color: black;
}
#Logo {
margin-top: 100px;
width: 600px;
height: 150px;
left: 50%;
position: absolute;
margin-left: -300px;
}
#KeyboardInstructions {
position: absolute;
color: white;
font-size: 20px;
font-family: monospace;
width: 100%;
height: 30px;
left: 0px;
bottom: 0px;
text-align: center;
}
</style>
<div id="Logo"></div>
<div id="KeyboardInstructions"> use your <i class="icon-keyboard"></i> to make some sound</div>
<script type="text/javascript">
var synth = new Tone.PolySynth(4, Tone.DuoSynth).toMaster();
// create a keyboard
var keyboard = new AudioKeys({
polyphony: 4,
rows: 2,
priority: "lowest"
});
keyboard.down( function(note) {
// do things with the note object
synth.triggerAttack(note.frequency);
});
keyboard.up( function(note) {
synth.triggerRelease(note.frequency);
});
Logo({
"width" : 600,
"height" : 150,
"container" : "#Logo"
});
</script>
</body>
</html>