-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwave.html
40 lines (36 loc) · 1.11 KB
/
wave.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
<!DOCTYPE HTML>
<html>
<head>
<title>Wave example</title>
</head>
<body>
<button id="bPiano">Piano left</button>
<button id="bGuitar">Guitar itched</button>
<button id="bXylo">Xylophone slow</button>
<button id="bAll">All in one</button>
<script src="../lib/wave.js"></script>
<script>
function piano() {
wave(':piano:zxcvbn').balance(-1).play()
}
function guitar() {
wave(':guitar:zxcvbn').itch(0.5).play()
}
function xylo() {
wave(':xylophone:zxcvbn').pace(100).play()
}
function all() {
wave(`
:pace 400: :itch 0: :balance 0:
:piano: :balance -1: zxcvbn
:guitar: :balance 0: :itch 0.5: zxcvbn
:xylophone: :itch 0: :pace 100: zxcvbn
`).play()
}
document.querySelector('#bPiano').addEventListener("click", piano)
document.querySelector('#bGuitar').addEventListener("click", guitar)
document.querySelector('#bXylo').addEventListener("click", xylo)
document.querySelector('#bAll').addEventListener("click", all)
</script>
</body>
</html>