Compare commits

..

No commits in common. "c5ca40d22c91b6ecf50981a3b249f591b572865b" and "38ddbf91b1c8f54cd20bb10d1a38add15ad5d047" have entirely different histories.

2 changed files with 6 additions and 5 deletions

View File

@ -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 * (int)(patchRam.pwmLfo*1.45)) >> 7); // FIXME tidy up this bit
pw = 0x3fff - ((pw * patchRam.pwmLfo) >> 7); // scaled by PWM pot
}
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.4;
sub = (patchRam.sub / 127.0f) * 1.6;
res = patchRam.vcfReso / 127.0;
noise = (patchRam.noise / 127.0);
@ -143,6 +143,7 @@ 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;

View File

@ -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 / 32768.0f;
float amp = vcaEnv / 16384.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 > 6) fb = 6;
if (fb < -6) fb = -6;
if (fb > 2) fb = 2;
if (fb < -2) fb = -2;
y0 = ((out + fb - y0) * vcfRC) + y0;
y1 = ((y0 - y1) * vcfRC) + y1;