2015-06-26 05:23:05 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>PolySynth</title>
|
|
|
|
|
2015-06-27 22:10:18 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
2015-12-08 05:06:58 +00:00
|
|
|
<link rel="icon" type="image/png" sizes="174x174" href="./style/favicon.png">
|
2015-06-26 05:23:05 +00:00
|
|
|
|
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
|
|
|
<script type="text/javascript" src="./scripts/jquery.min.js"></script>
|
2015-12-05 18:20:53 +00:00
|
|
|
<script type="text/javascript" src="./scripts/draggabilly.js"></script>
|
2016-03-04 22:38:32 +00:00
|
|
|
<script type="text/javascript" src="./scripts/StartAudioContext.js"></script>
|
2015-06-26 05:23:05 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Interface.js"></script>
|
2016-07-07 21:31:06 +00:00
|
|
|
<script type="text/javascript" src="https://tonejs.github.io/Logo/build/Logo.js"></script>
|
2016-12-22 19:30:24 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Keyboard.js"></script>
|
2015-06-26 05:23:05 +00:00
|
|
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// jshint ignore: start
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<style type="text/css">
|
|
|
|
|
|
|
|
</style>
|
2015-06-27 21:25:01 +00:00
|
|
|
<div id="Content" class="FullScreen">
|
2015-06-26 05:23:05 +00:00
|
|
|
<div id="Title">PolySynth</div>
|
|
|
|
<div id="Explanation">
|
2016-07-07 20:10:29 +00:00
|
|
|
<a href="https://tonejs.github.io/docs/#PolySynth">Tone.PolySynth</a>
|
2015-06-27 22:02:55 +00:00
|
|
|
handles voice creation and allocation for any
|
2015-06-27 21:25:01 +00:00
|
|
|
instruments passed in as the second parameter. PolySynth is
|
2015-06-26 05:23:05 +00:00
|
|
|
not a synthesizer by itself, it merely manages voices of
|
|
|
|
one of the other types of synths, allowing any of the
|
|
|
|
monophonic synthesizers to be polyphonic.
|
|
|
|
</div>
|
|
|
|
<div id="Keyboard"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2016-05-23 23:52:56 +00:00
|
|
|
var synth = new Tone.PolySynth(6, Tone.Synth, {
|
2015-12-05 18:20:53 +00:00
|
|
|
"oscillator" : {
|
|
|
|
"partials" : [0, 2, 3, 4],
|
|
|
|
}
|
|
|
|
}).toMaster();
|
2015-06-26 05:23:05 +00:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script id="GUI" type="text/javascript">
|
|
|
|
$(function(){
|
|
|
|
|
2016-12-22 19:30:24 +00:00
|
|
|
var keyboard = Interface.Keyboard();
|
2015-06-26 05:23:05 +00:00
|
|
|
|
|
|
|
keyboard.keyDown = function (note) {
|
|
|
|
synth.triggerAttack(note);
|
|
|
|
};
|
|
|
|
|
|
|
|
keyboard.keyUp = function (note) {
|
|
|
|
synth.triggerRelease(note);
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</body>
|
|
|
|
</html>
|