Skip to content

Instantly share code, notes, and snippets.

@jussiry
Created November 27, 2019 16:53
Show Gist options
  • Save jussiry/57d34e7fd9efb858779a6aa486dc847f to your computer and use it in GitHub Desktop.
Save jussiry/57d34e7fd9efb858779a6aa486dc847f to your computer and use it in GitHub Desktop.
Music lib example
<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