2
0
Fork 0
mirror of https://github.com/Tonejs/Tone.js synced 2025-02-15 20:18:24 +00:00
Tone.js/examples/reverb.html

57 lines
1.7 KiB
HTML
Raw Normal View History

2018-04-06 16:55:42 -07:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Reverb</title>
2019-01-08 20:21:29 -05:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" type="image/png" sizes="174x174" href="./favicon.png">
2018-04-06 16:55:42 -07:00
2020-07-17 17:58:09 -07:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/2.4.3/webcomponents-bundle.js"></script>
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet"/>
2019-01-08 20:21:29 -05:00
<script src="../build/Tone.js"></script>
2020-07-17 17:58:09 -07:00
<script src="./js/tone-ui.js"></script>
<script src="./js/components.js"></script>
2018-04-06 16:55:42 -07:00
</head>
<body>
2019-01-08 20:21:29 -05:00
<style>
tone-play-toggle {
margin-bottom: 10px;
}
</style>
<tone-example label="Reverb">
<div slot="explanation">
2019-01-08 20:21:29 -05:00
<a href="https://tonejs.github.io/docs/Reverb">Tone.Reverb</a>
2018-04-06 16:55:42 -07:00
is a convolution-based reverb. An impulse response is created with a
decaying noise burst when you click 'Generate Reverb'. The 'Decay Time' controls
how long the noise burst lasts. If the 'Decay Time' is changed, a new noise burst
will need to be generated.
</div>
2018-04-06 16:55:42 -07:00
<div id="content">
<tone-play-toggle></tone-play-toggle>
</div>
2019-01-08 20:21:29 -05:00
</tone-example>
<script type="text/javascript">
var reverb = new Tone.Reverb().toDestination();
2018-04-06 16:55:42 -07:00
const player = new Tone.Player({
url: "https://tonejs.github.io/audio/berklee/shaker_slow_1.mp3",
loop: true,
volume: 6,
2018-04-06 16:55:42 -07:00
}).connect(reverb);
ui({
parent: document.querySelector('#content'),
tone: reverb
})
2019-01-08 20:21:29 -05:00
//bind the interface
document.querySelector("tone-play-toggle").addEventListener('start', () => player.start())
document.querySelector("tone-play-toggle").addEventListener('stop', () => player.stop())
2018-04-06 16:55:42 -07:00
</script>
</body>
</html>