spessasynth_lib 3.25.3 → 3.25.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -139,20 +139,19 @@ export class WorkletLowpassFilter
139
139
 
140
140
  // the final cutoff for this calculation
141
141
  const targetCutoff = filter.currentInitialFc + fcExcursion;
142
-
142
+ const modulatedResonance = voice.modulatedGenerators[generatorTypes.initialFilterQ];
143
143
  /* note:
144
144
  * the check for initialFC is because of the filter optimization
145
145
  * (if cents are the maximum then the filter is open)
146
146
  * filter cannot use this optimization if it's dynamic (see #53), and
147
147
  * the filter can only be dynamic if the initial filter is not open
148
148
  */
149
- if (filter.currentInitialFc > 13499 && targetCutoff > 13499 && filter.resonanceCb === 0)
149
+ if (filter.currentInitialFc > 13499 && targetCutoff > 13499 && modulatedResonance === 0)
150
150
  {
151
151
  filter.currentInitialFc = 13500;
152
152
  return; // filter is open
153
153
  }
154
154
 
155
- const modulatedResonance = voice.modulatedGenerators[generatorTypes.initialFilterQ];
156
155
  // check if the frequency has changed. if so, calculate new coefficients
157
156
  if (Math.abs(filter.lastTargetCutoff - targetCutoff) > 1 || filter.resonanceCb !== modulatedResonance)
158
157
  {