2014-10-22 22:49:42 +00:00
|
|
|
<!DOCTYPE html>
|
2014-06-23 17:29:22 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2014-10-22 22:49:42 +00:00
|
|
|
<meta charset="utf-8">
|
2015-06-26 05:23:05 +00:00
|
|
|
<title>MonoSynth</title>
|
2014-06-23 17:29:22 +00:00
|
|
|
|
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-06-26 05:23:05 +00:00
|
|
|
|
2014-09-04 19:20:25 +00:00
|
|
|
<script type="text/javascript" src="../build/Tone.js"></script>
|
2015-06-26 05:23:05 +00:00
|
|
|
<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>
|
2015-02-20 05:59:19 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Interface.js"></script>
|
2015-12-05 18:20:53 +00:00
|
|
|
<script type="text/javascript" src="./scripts/Logo.js"></script>
|
2015-06-26 05:23:05 +00:00
|
|
|
<script type="text/javascript" src="./scripts/qwerty-hancock.js"></script>
|
2014-06-23 17:29:22 +00:00
|
|
|
|
2015-02-20 05:59:19 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="./style/examples.css">
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// jshint ignore: start
|
|
|
|
</script>
|
|
|
|
|
2014-06-23 17:29:22 +00:00
|
|
|
</head>
|
2015-06-26 05:23:05 +00:00
|
|
|
<body>
|
2015-02-20 05:59:19 +00:00
|
|
|
<style type="text/css">
|
2015-06-26 05:23:05 +00:00
|
|
|
|
2015-02-20 05:59:19 +00:00
|
|
|
</style>
|
|
|
|
<div id="Content">
|
2015-06-26 05:23:05 +00:00
|
|
|
<div id="Title">MonoSynth</div>
|
|
|
|
<div id="Explanation">
|
2015-06-27 22:02:55 +00:00
|
|
|
<a href="http://tonejs.org/docs/#MonoSynth">Tone.MonoSynth</a>
|
|
|
|
is composed of one oscillator, one filter, and two envelopes.
|
2015-06-26 05:23:05 +00:00
|
|
|
Both envelopes are triggered simultaneously when a note is triggered.
|
|
|
|
<img src="https://docs.google.com/drawings/d/1gaY1DF9_Hzkodqf8JI1Cg2VZfwSElpFQfI94IQwad38/pub?w=924&h=240">
|
2014-09-02 04:25:38 +00:00
|
|
|
</div>
|
2015-06-26 05:23:05 +00:00
|
|
|
<div id="Keyboard"></div>
|
2014-06-23 17:29:22 +00:00
|
|
|
</div>
|
|
|
|
|
2015-06-26 05:23:05 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
var synth = new Tone.MonoSynth({
|
|
|
|
"oscillator" : {
|
|
|
|
"type" : "square"
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.2,
|
|
|
|
"sustain" : 0.4,
|
|
|
|
"release" : 0.2,
|
2015-12-05 18:20:53 +00:00
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
|
|
|
"attack" : 0.005,
|
|
|
|
"decay" : 0.1,
|
|
|
|
"sustain" : 0.05,
|
|
|
|
"release" : 0.8,
|
|
|
|
"min" : 300,
|
|
|
|
"max" : 10000
|
2015-06-26 05:23:05 +00:00
|
|
|
}
|
|
|
|
}).toMaster();
|
|
|
|
|
2015-02-20 05:59:19 +00:00
|
|
|
</script>
|
2015-06-26 05:23:05 +00:00
|
|
|
|
2015-02-20 05:59:19 +00:00
|
|
|
<script id="GUI" type="text/javascript">
|
2015-06-26 05:23:05 +00:00
|
|
|
$(function(){
|
|
|
|
|
|
|
|
var keyboard = new QwertyHancock({
|
|
|
|
id: "Keyboard",
|
|
|
|
width: $("#Content").width(),
|
|
|
|
height: 150,
|
|
|
|
octaves: Interface.isMobile ? 1.26 : 3,
|
|
|
|
startNote: "C3",
|
|
|
|
whiteKeyColour: "white",
|
|
|
|
blackKeyColour: "#1EDF3E",
|
|
|
|
activeColour : "#3833ED"
|
|
|
|
});
|
|
|
|
|
|
|
|
keyboard.keyDown = function (note, frequency) {
|
|
|
|
synth.triggerAttack(frequency);
|
|
|
|
};
|
|
|
|
|
|
|
|
keyboard.keyUp = function () {
|
|
|
|
synth.triggerRelease();
|
|
|
|
};
|
2014-09-02 04:25:38 +00:00
|
|
|
|
|
|
|
});
|
2014-06-23 17:29:22 +00:00
|
|
|
</script>
|
2015-06-26 05:23:05 +00:00
|
|
|
|
|
|
|
</style>
|
2014-06-23 17:29:22 +00:00
|
|
|
</body>
|
|
|
|
</html>
|