This commit is contained in:
Gordon JC Pearce 2025-12-24 00:34:52 +00:00
parent 7a4ebded58
commit d6e5f21e5b
1 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,7 @@ void Module::run(Voice* voices, uint32_t blockSize) {
pw = 0.5 - ((0x2000 + lfo) * patchRam.pwmLfo) / (32768.0f * 128); pw = 0.5 - ((0x2000 + lfo) * patchRam.pwmLfo) / (32768.0f * 128);
pw = (patchRam.switch2 & 0x01) ? 0.5 - (patchRam.pwmLfo / 256.0f) : pw; pw = (patchRam.switch2 & 0x01) ? 0.5 - (patchRam.pwmLfo / 256.0f) : pw;
float master = powf(2, (patchRam.vca / 31.75 - 4.0f)); float master = powf(2, (patchRam.vca / 31.75 - 4.0f));
float sub = patchRam.sub/ 127.0f; float sub = patchRam.sub/ 127.0f;
@ -125,8 +126,9 @@ void Module::run(Voice* voices, uint32_t blockSize) {
// per voice we need to calculate the key follow amount and envelope amount // per voice we need to calculate the key follow amount and envelope amount
v->vcfCut = (patchRam.vcfFreq << 7) + ((vcf * v->env) >> 14); v->vcfCut = (patchRam.vcfFreq << 7) + ((vcf * v->env) >> 14);
v->vcfCut += (int)((v->note-36) * (patchRam.vcfKey << 1) * 0.375); v->vcfCut += (lfo * patchRam.vcfLfo) >> 9;
v->vcfCut += (int)((v->note-36) * (patchRam.vcfKey << 1) * 0.375);
if (v->vcfCut > 0x3fff) v->vcfCut = 0x3fff; if (v->vcfCut > 0x3fff) v->vcfCut = 0x3fff;
if (v->vcfCut < 0) v->vcfCut = 0; if (v->vcfCut < 0) v->vcfCut = 0;