Skip to content

Commit 1ddcd83

Browse files
committed
Reset expTicksUsed after setSoftmaxFactor
1 parent ca49a6e commit 1ddcd83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/voice.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,16 @@ export class Voice extends Element {
195195
*/
196196
setSoftmaxFactor(factor: number): this {
197197
this.options.softmaxFactor = factor;
198+
this.expTicksUsed = 0; // reset
198199
return this;
199200
}
200201

201202
/**
202203
* Calculate the sum of the exponents of all the ticks in this voice to use
203-
* as the denominator of softmax.
204+
* as the denominator of softmax. (It is not the sum of the softmax(t) over all tickables)
205+
*
206+
* Note that the "exp" of "expTicksUsed" stands for "expontential" ticks used,
207+
* not "expected" ticks used.
204208
*/
205209
protected reCalculateExpTicksUsed(): number {
206210
const totalTicks = this.ticksUsed.value();

0 commit comments

Comments
 (0)