mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-14 04:43:54 +00:00
Merge pull request #1126 from quargsgreene/dev
custom decay curve issue #1107
This commit is contained in:
commit
aa58bf7fd1
1 changed files with 5 additions and 6 deletions
|
@ -141,7 +141,7 @@ export class Envelope extends ToneAudioNode<EnvelopeOptions> {
|
||||||
/**
|
/**
|
||||||
* The automation curve type for the decay
|
* The automation curve type for the decay
|
||||||
*/
|
*/
|
||||||
private _decayCurve!: BasicEnvelopeCurve;
|
private _decayCurve!: InternalEnvelopeCurve;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The automation curve type for the release
|
* The automation curve type for the release
|
||||||
|
@ -322,12 +322,11 @@ export class Envelope extends ToneAudioNode<EnvelopeOptions> {
|
||||||
* env.triggerAttack();
|
* env.triggerAttack();
|
||||||
* }, 1, 1);
|
* }, 1, 1);
|
||||||
*/
|
*/
|
||||||
get decayCurve(): BasicEnvelopeCurve {
|
get decayCurve(): EnvelopeCurve {
|
||||||
return this._decayCurve;
|
return this._getCurve(this._decayCurve, "Out");
|
||||||
}
|
}
|
||||||
set decayCurve(curve) {
|
set decayCurve(curve) {
|
||||||
assert(["linear", "exponential"].some(c => c === curve), `Invalid envelope curve: ${curve}`);
|
this._setCurve("_decayCurve", "Out", curve);
|
||||||
this._decayCurve = curve;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue