mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-17 00:58:09 +00:00
27 lines
666 B
JavaScript
27 lines
666 B
JavaScript
///////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// MERGE
|
|
//
|
|
// Merge a left and a right into a single left/right channel
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
define(["Tone/core/Tone"], function(Tone){
|
|
|
|
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;
|
|
})
|