mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
35 lines
No EOL
837 B
HTML
35 lines
No EOL
837 B
HTML
<html>
|
|
<head>
|
|
<title>FEEDBACK DELAY</title>
|
|
|
|
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
|
|
<script type="text/javascript" src="../Tone.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="exampleStyle.css">
|
|
</head>
|
|
<body>
|
|
<div>Pass the sample through a feedback delay</div>
|
|
<br>
|
|
<button>hit</button>
|
|
<div id='loading'>loading...<div>
|
|
<script type="text/javascript">
|
|
//the player
|
|
var player = new Tone.Player("./audio/505/snare.mp3", 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);
|
|
|
|
$("button").click(function(){
|
|
player.start();
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html> |