Skip to content

Commit a07d85e

Browse files
committed
polysynth: _voicesInUse.getValueAtTime instead of value
1 parent 905a842 commit a07d85e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/polysynth.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ define(function (require) {
193193
}
194194

195195

196-
if(this._voicesInUse.value < this.polyValue) {
197-
currentVoice = this._voicesInUse.value;
196+
if(this._voicesInUse.getValueAtTime(t) < this.polyValue) {
197+
currentVoice = this._voicesInUse.getValueAtTime(t);
198198
} else {
199199
currentVoice = this._oldest;
200200

@@ -205,7 +205,7 @@ define(function (require) {
205205

206206
this.notes[note] = currentVoice;
207207

208-
this._voicesInUse.setValueAtTime(this._voicesInUse.value + 1, t);
208+
this._voicesInUse.setValueAtTime(this._voicesInUse.getValueAtTime(t) + 1, t);
209209

210210
this._newest = currentVoice;
211211

@@ -236,7 +236,7 @@ define(function (require) {
236236
var tFromNow = secondsFromNow || 0;
237237
var t = now + tFromNow;
238238

239-
this._voicesInUse.setValueAtTime(this._voicesInUse.value - 1, t);
239+
this._voicesInUse.setValueAtTime(this._voicesInUse.getValueAtTime(t) - 1, t);
240240
this.audiovoices[ this.notes[note] ].triggerRelease(secondsFromNow);
241241
this.notes[note] = undefined;
242242

0 commit comments

Comments
 (0)