mirror of
https://github.com/Tonejs/Tone.js
synced 2024-12-26 03:23:11 +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.
|
||||
* Useful for silencing the synth.
|
||||
*/
|
||||
releaseAll(): this {
|
||||
const now = this.now();
|
||||
releaseAll(time?: Time): this {
|
||||
const computedTime = this.toSeconds(time);
|
||||
this._activeVoices.forEach(({ voice }) => {
|
||||
voice.triggerRelease(now);
|
||||
voice.triggerRelease(computedTime);
|
||||
});
|
||||
this._activeVoices = [];
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue