mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-27 20:13:07 +00:00
Added simple HTML5 example to examples folder (#465)
* Added simple HTML5 example to examples folder * put script inside HTML <script> tags * removed app.js
This commit is contained in:
parent
3c2d1250ea
commit
2c2c45ff29
1 changed files with 21 additions and 0 deletions
21
examples/simpleHtml.html
Normal file
21
examples/simpleHtml.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>App</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/13.8.3/Tone.js"></script>
|
||||||
|
<script>
|
||||||
|
function playNote() {
|
||||||
|
var synth = new Tone.Synth().toMaster();
|
||||||
|
synth.triggerAttackRelease("C4", "8n");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Simple HTML5 Tone.js Demo</h1>
|
||||||
|
<button onclick="playNote()">Click me to play note!</button>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue