2014-04-05 22:05:42 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// MONO
|
|
|
|
//
|
|
|
|
// Merge a left and a right into a single left/right channel
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-04-06 20:51:30 +00:00
|
|
|
define(["Tone/core/Tone"], function(Tone){
|
2014-04-05 22:05:42 +00:00
|
|
|
|
|
|
|
Tone.Merge = function(){
|
|
|
|
Tone.call(this);
|
|
|
|
|
|
|
|
//components
|
|
|
|
this.left = this.context.createGain();
|
|
|
|
this.right = this.context.createGain();
|
|
|
|
this.merger = this.context.createChannelMerger(2);
|
|
|
|
|
|
|
|
//connections
|
|
|
|
this.left.connect(this.merger, 0, 0);
|
|
|
|
this.right.connect(this.merger, 0, 1);
|
|
|
|
this.merger.connect(this.output);
|
|
|
|
}
|
|
|
|
|
|
|
|
Tone.extend(Tone.Merge);
|
|
|
|
|
|
|
|
return Tone.Merge;
|
|
|
|
})
|