Fix Zyn oscillator filter harmonic indexing

This commit is contained in:
Meta Vens 2026-05-15 15:17:01 +01:00
commit e53ea515ab
7 changed files with 60 additions and 7 deletions

View file

@ -141,6 +141,7 @@ internal static class PadSynthWaveform
for (var i = 0; i < profileSize * superSample; i++)
{
var x = i / (double)(profileSize * superSample);
var originalX = x * 2.0 - 1.0;
x = (x - 0.5) * width + 0.5;
if (x is < 0 or > 1)
{
@ -156,7 +157,6 @@ internal static class PadSynthWaveform
continue;
}
var originalX = x * 2.0 - 1.0;
var beforeFreqMult = x;
x *= freqMult;
x += Math.Sin(beforeFreqMult * Math.PI * modFreq) * modPar;

View file

@ -533,7 +533,7 @@ public static class ZynInstrumentReader
private static double ZynOscilFilterGain(int type, int harmonic, double par, double par2)
{
var i = Math.Max(0, harmonic - 1);
var i = Math.Max(1, harmonic);
return type switch
{
1 => ZynOscilLowPass(i, par, par2),