Fix Zyn oscillator filter harmonic indexing
This commit is contained in:
parent
ee67865c31
commit
e53ea515ab
7 changed files with 60 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue