Tone.js/examples/analysis.html

60 lines
1.6 KiB
HTML
Raw Normal View History

2015-08-10 18:41:23 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Analyser</title>
2019-01-09 01:21:29 +00: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">
2019-01-09 01:21:29 +00:00
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@^2/webcomponents-bundle.js"></script>
<script src="../build/Tone.js"></script>
2019-01-09 01:21:29 +00:00
<script src="./js/tonejs-ui.js"></script>
2015-08-10 18:41:23 +00:00
</head>
<body>
2019-01-09 01:21:29 +00:00
<style>
tone-oscilloscope, tone-fft {
width: 100%;
height: 44px;
border-radius: 22px;
background-color: black;
}
</style>
<tone-example>
<tone-loader></tone-loader>
<tone-explanation label="Analyser">
<a href="https://tonejs.github.io/docs/FFT" target="_blank">Tone.FFT</a>
returns the amplitude of the incoming signal at different frequencies.
<a href="https://tonejs.github.io/docs/Waveform" target="_blank">Tone.Waveform</a>
2019-01-09 01:21:29 +00:00
returns the signal value between 0-1.
</tone-explanation>
<tone-content>
<tone-oscilloscope></tone-oscilloscope>
<tone-fft></tone-fft>
<tone-play-toggle></tone-play-toggle>
</tone-content>
<tone-drawer label="Components">
<tone-player collapsed></tone-player>
</tone-drawer>
</tone-example>
<script type="text/javascript">
2015-08-10 18:41:23 +00:00
var player = new Tone.Player({
"url" : "./audio/FWDL.[mp3|ogg]",
2015-08-10 18:41:23 +00:00
"loop" : true
2019-01-09 01:21:29 +00:00
}).toMaster();
2015-08-10 18:41:23 +00:00
2019-01-09 01:21:29 +00:00
//connect the UI with the components
document.querySelector("tone-player").bind(player);
document.querySelector("tone-play-toggle").bind(player);
document.querySelector("tone-oscilloscope").bind(player);
document.querySelector("tone-fft").bind(player);
2017-03-26 20:39:19 +00:00
2015-08-10 18:41:23 +00:00
</script>
</body>
</html>