mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
Simplifying Freeverb dispose
This commit is contained in:
parent
dedfe18ac2
commit
267f1befc0
3 changed files with 6 additions and 11 deletions
|
@ -265,6 +265,7 @@ export class TickParam<TypeName extends "hertz" | "bpm"> extends Param<TypeName>
|
|||
// might be necessary to clear all the previous values
|
||||
const currentVal = this.value;
|
||||
this._multiplier = m;
|
||||
this.value = currentVal;
|
||||
this.cancelScheduledValues(0);
|
||||
this.setValueAtTime(currentVal, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ export class Transport extends ToneWithContext<TransportOptions> implements Emit
|
|||
this._bindClockEvents();
|
||||
this.bpm = this._clock.frequency as unknown as TickParam<"bpm">;
|
||||
this._clock.frequency.multiplier = options.ppq;
|
||||
this.bpm.value = options.bpm;
|
||||
this.bpm.setValueAtTime(options.bpm, 0);
|
||||
readOnly(this, "bpm");
|
||||
this._timeSignature = options.timeSignature;
|
||||
|
||||
|
|
|
@ -128,15 +128,9 @@ export class Freeverb extends StereoEffect<FreeverbOptions> {
|
|||
|
||||
dispose(): this {
|
||||
super.dispose();
|
||||
for (let al = 0; al < this._allpassFiltersL.length; al++) {
|
||||
this._allpassFiltersL[al].disconnect();
|
||||
}
|
||||
for (let ar = 0; ar < this._allpassFiltersR.length; ar++) {
|
||||
this._allpassFiltersR[ar].disconnect();
|
||||
}
|
||||
for (let cf = 0; cf < this._combFilters.length; cf++) {
|
||||
this._combFilters[cf].dispose();
|
||||
}
|
||||
this._allpassFiltersL.forEach(al => al.disconnect());
|
||||
this._allpassFiltersR.forEach(ar => ar.disconnect());
|
||||
this._combFilters.forEach(cf => cf.dispose());
|
||||
this.roomSize.dispose();
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue