mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-17 00:58:09 +00:00
28 lines
No EOL
701 B
JavaScript
28 lines
No EOL
701 B
JavaScript
///////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// SPLIT
|
|
//
|
|
// splits the incoming signal into left and right outputs
|
|
// one input two outputs
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
define(["Tone/core/Tone"], function(Tone){
|
|
|
|
Tone.Split = function(){
|
|
Tone.call(this);
|
|
|
|
//components
|
|
this.splitter = this.context.createChannelSplitter(2);
|
|
this.left = this.context.createGain();
|
|
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);
|
|
}
|
|
|
|
Tone.extend(Tone.Split);
|
|
|
|
return Tone.Split;
|
|
}); |