mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-27 03:53:07 +00:00
24 lines
587 B
HTML
24 lines
587 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Simple HTML</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<!-- LOAD Tone.js from unpkg -->
|
|
<script src="https://unpkg.com/tone"></script>
|
|
<script>
|
|
function playNote() {
|
|
// create a synth
|
|
const synth = new Tone.Synth().toDestination();
|
|
// play a note from that synth
|
|
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>
|
|
|