2014-04-06 20:51:30 +00:00
|
|
|
define(["Tone/core/Tone"], function(Tone){
|
2014-04-05 22:05:42 +00:00
|
|
|
|
2014-06-17 15:48:17 +00:00
|
|
|
/**
|
|
|
|
* split the incoming signal into left and right channels
|
|
|
|
*
|
|
|
|
* the left channel is the default output
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @extends {Tone}
|
|
|
|
*/
|
2014-04-05 22:05:42 +00:00
|
|
|
Tone.Split = function(){
|
|
|
|
Tone.call(this);
|
|
|
|
|
2014-06-17 15:48:17 +00:00
|
|
|
/** @type {ChannelSplitterNode} */
|
2014-04-05 22:05:42 +00:00
|
|
|
this.splitter = this.context.createChannelSplitter(2);
|
2014-06-17 15:48:17 +00:00
|
|
|
/**
|
|
|
|
* left channel output
|
|
|
|
* @alias for the default output
|
|
|
|
* @type {GainNode}
|
|
|
|
*/
|
|
|
|
this.left = this.output;
|
|
|
|
/**
|
|
|
|
* the right channel output
|
|
|
|
* @type {GainNode}
|
|
|
|
*/
|
2014-04-05 22:05:42 +00:00
|
|
|
this.right = this.context.createGain();
|
|
|
|
|
|
|
|
//connections
|
|
|
|
this.input.connect(this.splitter);
|
|
|
|
this.splitter.connect(this.left, 1, 0);
|
|
|
|
this.splitter.connect(this.right, 0, 0);
|
2014-06-17 15:48:17 +00:00
|
|
|
};
|
2014-04-05 22:05:42 +00:00
|
|
|
|
|
|
|
Tone.extend(Tone.Split);
|
|
|
|
|
|
|
|
return Tone.Split;
|
|
|
|
});
|