spessasynth_lib 3.20.15 → 3.20.17

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.
@@ -184,6 +184,7 @@ export function clearSoundFont(sendPresets = true, clearOverride = true)
184
184
  if(clearOverride)
185
185
  {
186
186
  delete this.overrideSoundfont;
187
+ this.overrideSoundfont = undefined;
187
188
  }
188
189
  this.defaultPreset = this.getPreset(0, 0);
189
190
  this.drumPreset = this.getPreset(128, 0);
@@ -144,7 +144,7 @@ export class WorkletVolumeEnvelope
144
144
  return Math.floor(timecentsToSeconds(tc) * env.sampleRate);
145
145
  }
146
146
  // calculate absolute times (they can change so we have to recalculate every time
147
- env.attenuation = voice.modulatedGenerators[generatorTypes.initialAttenuation] / 10; // divide by ten to get decibelts
147
+ env.attenuation = Math.max(0, Math.min(voice.modulatedGenerators[generatorTypes.initialAttenuation], 1440)) / 10; // divide by ten to get decibelts
148
148
  env.sustainDb = Math.min(100, voice.volumeEnvelope.attenuation + voice.modulatedGenerators[generatorTypes.sustainVolEnv] / 10);
149
149
 
150
150
  // calculate durations