@@ -2524,7 +2524,7 @@ export class Song {
25242524 if (instrument.vibrato == Config.vibratos.length) {
25252525 buffer.push(base64IntToCharCode[Math.round(instrument.vibratoDepth * 25)]);
25262526 buffer.push(base64IntToCharCode[instrument.vibratoSpeed]);
2527- buffer.push(base64IntToCharCode[instrument.vibratoDelay]);
2527+ buffer.push(base64IntToCharCode[Math.round( instrument.vibratoDelay) ]);
25282528 buffer.push(base64IntToCharCode[instrument.vibratoType]);
25292529 }
25302530 }
@@ -3547,7 +3547,7 @@ export class Song {
35473547 if (vibrato == Config.vibratos.length) {
35483548 instrument.vibratoDepth = clamp(0, Config.modulators.dictionary["vibrato depth"].maxRawVol + 1, base64CharCodeToInt[compressed.charCodeAt(charIndex++)]) / 25;
35493549 instrument.vibratoSpeed = clamp(0, Config.modulators.dictionary["vibrato speed"].maxRawVol + 1, base64CharCodeToInt[compressed.charCodeAt(charIndex++)]);
3550- instrument.vibratoDelay = clamp(0, Config.modulators.dictionary["vibrato delay"].maxRawVol + 1, base64CharCodeToInt[compressed.charCodeAt(charIndex++)]);
3550+ instrument.vibratoDelay = clamp(0, Config.modulators.dictionary["vibrato delay"].maxRawVol + 1, base64CharCodeToInt[compressed.charCodeAt(charIndex++)]) / 2 ;
35513551 instrument.vibratoType = clamp(0, Config.vibratoTypes.length, base64CharCodeToInt[compressed.charCodeAt(charIndex++)]);
35523552 instrument.effects |= 1 << EffectType.vibrato;
35533553 }
@@ -5676,6 +5676,11 @@ class InstrumentState {
56765676 let startPoint: FilterControlPoint = eqFilterSettings.controlPoints[i];
56775677 let endPoint: FilterControlPoint = (instrument.tmpEqFilterEnd != null && instrument.tmpEqFilterEnd.controlPoints[i] != null) ? instrument.tmpEqFilterEnd.controlPoints[i] : eqFilterSettings.controlPoints[i];
56785678
5679+ // If switching dot type, do it all at once and do not try to interpolate since no valid interpolation exists.
5680+ if (startPoint.type != endPoint.type) {
5681+ startPoint = endPoint;
5682+ }
5683+
56795684 startPoint.toCoefficients(Synth.tempFilterStartCoefficients, samplesPerSecond, /*eqAllFreqsEnvelopeStart * eqFreqEnvelopeStart*/ 1.0, /*eqPeakEnvelopeStart*/ 1.0);
56805685 endPoint.toCoefficients(Synth.tempFilterEndCoefficients, samplesPerSecond, /*eqAllFreqsEnvelopeEnd * eqFreqEnvelopeEnd*/ 1.0, /*eqPeakEnvelopeEnd*/ 1.0);
56815686 if (this.eqFilters.length <= i) this.eqFilters[i] = new DynamicBiquadFilter();
@@ -8108,9 +8113,14 @@ export class Synth {
81088113 const noteFreqEnvelopeEnd: number = envelopeEnds[NoteAutomationIndex.noteFilterFreq0 + i];
81098114 const notePeakEnvelopeStart: number = envelopeStarts[NoteAutomationIndex.noteFilterGain0 + i];
81108115 const notePeakEnvelopeEnd: number = envelopeEnds[NoteAutomationIndex.noteFilterGain0 + i];
8111- const startPoint: FilterControlPoint = noteFilterSettings.controlPoints[i];
8116+ let startPoint: FilterControlPoint = noteFilterSettings.controlPoints[i];
81128117 const endPoint: FilterControlPoint = (instrument.tmpNoteFilterEnd != null && instrument.tmpNoteFilterEnd.controlPoints[i] != null) ? instrument.tmpNoteFilterEnd.controlPoints[i] : noteFilterSettings.controlPoints[i];
81138118
8119+ // If switching dot type, do it all at once and do not try to interpolate since no valid interpolation exists.
8120+ if (startPoint.type != endPoint.type) {
8121+ startPoint = endPoint;
8122+ }
8123+
81148124 startPoint.toCoefficients(Synth.tempFilterStartCoefficients, synth.samplesPerSecond, noteAllFreqsEnvelopeStart * noteFreqEnvelopeStart, notePeakEnvelopeStart);
81158125 endPoint.toCoefficients(Synth.tempFilterEndCoefficients, synth.samplesPerSecond, noteAllFreqsEnvelopeEnd * noteFreqEnvelopeEnd, notePeakEnvelopeEnd);
81168126 if (tone.noteFilters.length <= i) tone.noteFilters[i] = new DynamicBiquadFilter();
0 commit comments