2018-02-05 21:25:43 +00:00
|
|
|
define(["Tone/component/Merge", "helper/Basic", "helper/PassAudio", "helper/PassAudioStereo",
|
2018-05-18 16:07:20 +00:00
|
|
|
"helper/Test", "helper/Offline", "Tone/signal/Signal", "Tone/component/Split",
|
2018-02-05 21:25:43 +00:00
|
|
|
"Tone/core/Tone", "helper/ConstantOutput", "helper/StereoSignal"],
|
2018-05-18 16:07:20 +00:00
|
|
|
function(Merge, Basic, PassAudio, PassAudioStereo, Test, Offline, Signal, Split, Tone, ConstantOutput, StereoSignal){
|
2015-08-28 22:42:44 +00:00
|
|
|
describe("Split", function(){
|
|
|
|
|
|
|
|
Basic(Split);
|
|
|
|
|
|
|
|
context("Splitting", function(){
|
|
|
|
|
|
|
|
it("handles input and output connections", function(){
|
|
|
|
var split = new Split();
|
|
|
|
Test.connect(split);
|
|
|
|
split.connect(Test);
|
|
|
|
split.dispose();
|
|
|
|
});
|
|
|
|
|
2017-02-20 04:55:55 +00:00
|
|
|
it("passes the incoming signal through on the left side", function(){
|
2017-05-17 05:52:09 +00:00
|
|
|
return ConstantOutput(function(){
|
2017-02-20 04:55:55 +00:00
|
|
|
var split = new Split();
|
2018-02-05 21:25:43 +00:00
|
|
|
var signal = StereoSignal(1, 2).connect(split);
|
2017-02-20 04:55:55 +00:00
|
|
|
split.left.toMaster();
|
2017-05-17 05:52:09 +00:00
|
|
|
}, 1);
|
2015-08-28 22:42:44 +00:00
|
|
|
});
|
|
|
|
|
2017-02-20 04:55:55 +00:00
|
|
|
it("passes the incoming signal through on the right side", function(){
|
2017-05-17 05:52:09 +00:00
|
|
|
return ConstantOutput(function(){
|
2017-02-20 04:55:55 +00:00
|
|
|
var split = new Split();
|
2018-02-05 21:25:43 +00:00
|
|
|
var signal = StereoSignal(1, 2).connect(split);
|
2017-02-20 04:55:55 +00:00
|
|
|
split.right.toMaster();
|
2018-02-05 21:25:43 +00:00
|
|
|
}, 2);
|
2015-08-28 22:42:44 +00:00
|
|
|
});
|
|
|
|
|
2017-02-20 04:55:55 +00:00
|
|
|
it("merges two signal into one stereo signal and then split them back into two signals on left side", function(){
|
2017-05-17 05:52:09 +00:00
|
|
|
return ConstantOutput(function(){
|
2017-02-20 04:55:55 +00:00
|
|
|
var split = new Split();
|
2018-02-05 21:25:43 +00:00
|
|
|
var signal = StereoSignal(1, 2).connect(split);
|
2017-02-20 04:55:55 +00:00
|
|
|
split.connect(Tone.Master, 0, 0);
|
2017-05-17 05:52:09 +00:00
|
|
|
}, 1);
|
2015-08-28 22:42:44 +00:00
|
|
|
});
|
|
|
|
|
2017-02-20 04:55:55 +00:00
|
|
|
it("merges two signal into one stereo signal and then split them back into two signals on right side", function(){
|
2017-05-17 05:52:09 +00:00
|
|
|
return ConstantOutput(function(){
|
2017-02-20 04:55:55 +00:00
|
|
|
var split = new Split();
|
2018-02-05 21:25:43 +00:00
|
|
|
var signal = StereoSignal(1, 2).connect(split);
|
2017-02-20 04:55:55 +00:00
|
|
|
split.connect(Tone.Master, 1, 0);
|
2017-05-17 05:52:09 +00:00
|
|
|
}, 2);
|
2015-08-28 22:42:44 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|