Merge pull request #1126 from quargsgreene/dev

custom decay curve issue #1107
This commit is contained in:
Yotam Mann 2022-10-02 09:52:54 -04:00 committed by GitHub
commit aa58bf7fd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
} }
/** /**