mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
31 lines
No EOL
645 B
HTML
31 lines
No EOL
645 B
HTML
<html>
|
|
<head>
|
|
<title>FEEDBACK DELAY</title>
|
|
|
|
<script type="text/javascript" src="../Tone.js"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<button onclick='player.start()'>hit</button>
|
|
<div id='loading'>loading...<div>
|
|
<script type="text/javascript">
|
|
//the player
|
|
var player = new Tone.Player("./audio/505/snare.mp3");
|
|
|
|
//load it
|
|
player.load(function(){
|
|
document.querySelector("#loading").remove();
|
|
});
|
|
|
|
var feedbackDelay = new Tone.FeedbackDelay(.25);
|
|
//60% feedback
|
|
feedbackDelay.setFeedback(.2);
|
|
|
|
//connections
|
|
player.connect(feedbackDelay);
|
|
feedbackDelay.toMaster();
|
|
feedbackDelay.setWet(0.5);
|
|
|
|
</script>
|
|
</body>
|
|
</html> |