Created
November 27, 2019 16:53
-
-
Save jussiry/57d34e7fd9efb858779a6aa486dc847f to your computer and use it in GitHub Desktop.
Music lib example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Music makers HTML test</title> | |
</head> | |
<body> | |
<textarea style="width: 20em; height: 20em;"> | |
{"instrument": "guitar-electric", "distortion": 0.4} | |
sdfsdfsdfsdf | |
{"instrument": "guitar-acoustic", "distortion": 0} | |
sdfsdfsdfsdf | |
:piano: | |
sdfsdfsdfsdf | |
</textarea> | |
<button id="play">Play</button> | |
<button id="stop">Stop</button> | |
</body> | |
<script src="./music.lib.js"></script> | |
<script> | |
var $ = document.querySelector.bind(document) | |
$('#play').addEventListener('click', () => { | |
edide.music.play($('textarea').value) | |
}) | |
$('#stop').addEventListener('click', edide.music.stop) | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment