mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-13 20:39:06 +00:00
don't clear the activeVoices array when releasing all
actives voices will be cleared on it's own fixes #676
This commit is contained in:
parent
127a62da5a
commit
de95b27af0
1 changed files with 3 additions and 4 deletions
|
@ -367,12 +367,11 @@ export class PolySynth<Voice extends Monophonic<any> = Synth> extends Instrument
|
||||||
* Trigger the release portion of all the currently active voices immediately.
|
* Trigger the release portion of all the currently active voices immediately.
|
||||||
* Useful for silencing the synth.
|
* Useful for silencing the synth.
|
||||||
*/
|
*/
|
||||||
releaseAll(): this {
|
releaseAll(time?: Time): this {
|
||||||
const now = this.now();
|
const computedTime = this.toSeconds(time);
|
||||||
this._activeVoices.forEach(({ voice }) => {
|
this._activeVoices.forEach(({ voice }) => {
|
||||||
voice.triggerRelease(now);
|
voice.triggerRelease(computedTime);
|
||||||
});
|
});
|
||||||
this._activeVoices = [];
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue