Skip to content

Commit 05178da

Browse files
committed
p5.js actually does need to .cancelScheduledValues of its control param
1 parent 2e97d14 commit 05178da

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/env.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,16 @@ define(function (require) {
558558
{
559559
this.control.exponentialRampToValueAtTime(this.checkExpInput(this.aLevel), t);
560560
valToSet = this.checkExpInput(this.control.getValueAtTime(t));
561+
this.control.cancelScheduledValues(t);
561562
this.control.exponentialRampToValueAtTime(valToSet, t);
562563
}
563564
else
564565
{
565566
this.control.linearRampToValueAtTime(this.aLevel, t);
566567
valToSet = this.control.getValueAtTime(t);
568+
this.control.cancelScheduledValues(t);
567569
this.control.linearRampToValueAtTime(valToSet, t);
570+
568571
}
569572

570573
// decay to decay level (if using ADSR, then decay level == sustain level)
@@ -573,12 +576,14 @@ define(function (require) {
573576
{
574577
this.control.exponentialRampToValueAtTime(this.checkExpInput(this.dLevel), t);
575578
valToSet = this.checkExpInput(this.control.getValueAtTime(t));
579+
this.control.cancelScheduledValues(t);
576580
this.control.exponentialRampToValueAtTime(valToSet, t);
577581
}
578582
else
579583
{
580584
this.control.linearRampToValueAtTime(this.dLevel, t);
581585
valToSet = this.control.getValueAtTime(t);
586+
this.control.cancelScheduledValues(t);
582587
this.control.linearRampToValueAtTime(valToSet, t);
583588
}
584589
};
@@ -680,12 +685,14 @@ define(function (require) {
680685
{
681686
this.control.exponentialRampToValueAtTime(this.checkExpInput(this.rLevel), t);
682687
valToSet = this.checkExpInput(this.control.getValueAtTime(t));
688+
this.control.cancelScheduledValues(t);
683689
this.control.exponentialRampToValueAtTime(valToSet, t);
684690
}
685691
else
686692
{
687693
this.control.linearRampToValueAtTime(this.rLevel, t);
688694
valToSet = this.control.getValueAtTime(t);
695+
this.control.cancelScheduledValues(t);
689696
this.control.linearRampToValueAtTime(valToSet, t);
690697
}
691698

0 commit comments

Comments
 (0)