Merge pull request #1023 from jussiry/master

Wave update
This commit is contained in:
Mark Nadal 2020-11-11 12:48:07 -08:00 committed by GitHub
commit bafb25dcfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 946 additions and 691 deletions

40
examples/wave.html Normal file
View File

@ -0,0 +1,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>

File diff suppressed because it is too large Load Diff