diff --git a/plugin/module.cpp b/plugin/module.cpp index 73e404a..9d9ba2c 100644 --- a/plugin/module.cpp +++ b/plugin/module.cpp @@ -85,7 +85,7 @@ void Module::runLFO() { pw = (lfoState & 0x02) ? lfoPhase + 0x2000 : 0x2000 - lfoPhase; // PW LFO is unipolar pw = (patchRam.switch2 & 0x01) ? 0x3fff : pw; // either LFO or "all on" - pw = 0x3fff - ((pw * patchRam.pwmLfo) >> 7); // scaled by PWM pot + pw = 0x3fff - ((pw * (int)(patchRam.pwmLfo*1.45)) >> 7); // FIXME tidy up this bit } void Module::run(Voice* voices, uint32_t blockSize) { @@ -106,7 +106,7 @@ void Module::run(Voice* voices, uint32_t blockSize) { square = (patchRam.switch1 & 0x08) ? 1 : 0; saw = (patchRam.switch1 & 0x10) ? 1 : 0; - sub = (patchRam.sub / 127.0f) * 1.6; + sub = (patchRam.sub / 127.0f) * 1.4; res = patchRam.vcfReso / 127.0; noise = (patchRam.noise / 127.0); @@ -143,7 +143,6 @@ void Module::run(Voice* voices, uint32_t blockSize) { pitchBase += lfoToVco; pitchBase += /* pitch bend FIXME */ 0; - // int16_t vcf = (patchRam.vcfEnv << 7) * ((patchRam.switch2 & 0x02) ? -1 : 1); vcfBase = (patchRam.vcfFreq << 7) + /* vcf bend FIXME */ 0; vcfBase += lfoToVcf; if (vcfBase > 0x3fff) vcfBase = 0x3fff; diff --git a/plugin/voice.cpp b/plugin/voice.cpp index 918cd46..6f6f80b 100644 --- a/plugin/voice.cpp +++ b/plugin/voice.cpp @@ -72,7 +72,7 @@ void Voice::run(Module* m, float* buffer, uint32_t framePos, uint32_t samples) { float r = 5 * m->res; - float amp = vcaEnv / 16384.0f; + float amp = vcaEnv / 32768.0f; for (uint32_t i = 0; i < samples; i++) { out = delay; @@ -117,8 +117,8 @@ void Voice::run(Module* m, float* buffer, uint32_t framePos, uint32_t samples) { fb = y3; // hard clip fb = ((out * 0.5) - fb) * r; - if (fb > 2) fb = 2; - if (fb < -2) fb = -2; + if (fb > 6) fb = 6; + if (fb < -6) fb = -6; y0 = ((out + fb - y0) * vcfRC) + y0; y1 = ((y0 - y1) * vcfRC) + y1;