mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
testing retrigger with custom curve
This commit is contained in:
parent
a40aa6bd12
commit
ad17849389
1 changed files with 32 additions and 0 deletions
|
@ -681,6 +681,38 @@ function (Envelope, Basic, Offline, Test, Offline2, Supports, PassAudio) {
|
|||
|
||||
}, 0.8);
|
||||
});
|
||||
|
||||
it ("can retrigger partial envelope with custom type", function(done){
|
||||
Offline2(function(output, test, after){
|
||||
|
||||
var env = new Envelope({
|
||||
attack : 0.3,
|
||||
sustain : 1,
|
||||
release: 0.3,
|
||||
decay : 0,
|
||||
attackCurve : "step",
|
||||
releaseCurve : "step",
|
||||
}).connect(output);
|
||||
|
||||
env.triggerAttackRelease(0.3, 0.1);
|
||||
env.triggerAttackRelease(0.35, 0.1);
|
||||
env.triggerAttackRelease(0.8, 0.1);
|
||||
|
||||
test(function(sample, time){
|
||||
if (time > 0.3 && time < 0.5){
|
||||
expect(sample).to.be.above(0);
|
||||
} else if (time < 0.1){
|
||||
expect(sample).to.equal(0);
|
||||
}
|
||||
});
|
||||
|
||||
after(function(){
|
||||
env.dispose();
|
||||
done();
|
||||
});
|
||||
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue