2019-01-27 18:05:20 +00:00
|
|
|
import ConstantOutput from "helper/ConstantOutput";
|
|
|
|
import Negate from "Tone/signal/Negate";
|
|
|
|
import Basic from "helper/Basic";
|
|
|
|
import Test from "helper/Test";
|
|
|
|
import Oscillator from "Tone/source/Oscillator";
|
|
|
|
import Signal from "Tone/signal/Signal";
|
2015-08-24 15:17:21 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
describe("Negate", function(){
|
2015-08-24 15:17:21 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
Basic(Negate);
|
2015-08-24 15:17:21 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
context("Negating", function(){
|
2015-08-24 15:17:21 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
it("handles input and output connections", function(){
|
|
|
|
var negate = new Negate();
|
|
|
|
Test.connect(negate);
|
|
|
|
negate.connect(Test);
|
|
|
|
negate.dispose();
|
|
|
|
});
|
2015-08-24 21:29:19 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
it("negateates a positive value", function(){
|
|
|
|
return ConstantOutput(function(){
|
|
|
|
var signal = new Signal(1);
|
|
|
|
var negate = new Negate();
|
|
|
|
signal.connect(negate);
|
|
|
|
negate.toMaster();
|
|
|
|
}, -1);
|
2015-08-24 15:17:21 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
|
|
|
|
it("makes a negateative value positive", function(){
|
|
|
|
return ConstantOutput(function(){
|
|
|
|
var signal = new Signal(-10);
|
|
|
|
var negate = new Negate();
|
|
|
|
signal.connect(negate);
|
|
|
|
negate.toMaster();
|
|
|
|
}, 10);
|
|
|
|
});
|
2015-08-24 15:17:21 +00:00
|
|
|
});
|
2017-12-30 16:26:29 +00:00
|
|
|
});
|
2019-01-27 18:05:20 +00:00
|
|
|
|