levels balanced a bit better
This commit is contained in:
parent
e3c54e3ef1
commit
4077447102
|
|
@ -85,7 +85,7 @@ void Module::runLFO() {
|
||||||
|
|
||||||
pw = (lfoState & 0x02) ? lfoPhase + 0x2000 : 0x2000 - lfoPhase; // PW LFO is unipolar
|
pw = (lfoState & 0x02) ? lfoPhase + 0x2000 : 0x2000 - lfoPhase; // PW LFO is unipolar
|
||||||
pw = (patchRam.switch2 & 0x01) ? 0x3fff : pw; // either LFO or "all on"
|
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) {
|
void Module::run(Voice* voices, uint32_t blockSize) {
|
||||||
|
|
@ -104,12 +104,12 @@ void Module::run(Voice* voices, uint32_t blockSize) {
|
||||||
// originally I had 0.28, 0.36, 0.4
|
// originally I had 0.28, 0.36, 0.4
|
||||||
// measurement suggests that saw and square are around 100mV each with sub 160mV
|
// measurement suggests that saw and square are around 100mV each with sub 160mV
|
||||||
|
|
||||||
square = (patchRam.switch1 & 0x08) ? 0.3 : 0;
|
square = (patchRam.switch1 & 0x08) ? 1 : 0;
|
||||||
saw = (patchRam.switch1 & 0x10) ? .3 : 0;
|
saw = (patchRam.switch1 & 0x10) ? 1 : 0;
|
||||||
sub = (patchRam.sub / 127.0f) * 0.48;
|
sub = (patchRam.sub / 127.0f) * 1.4;
|
||||||
|
|
||||||
res = patchRam.vcfReso / 127.0;
|
res = patchRam.vcfReso / 127.0;
|
||||||
noise = (patchRam.noise / 127.0) * 0.4;
|
noise = (patchRam.noise / 127.0);
|
||||||
|
|
||||||
// FIXME the exp in these is expensive, don't call it all the time
|
// FIXME the exp in these is expensive, don't call it all the time
|
||||||
chorus->setChorus(patchRam.switch1 & 0x60);
|
chorus->setChorus(patchRam.switch1 & 0x60);
|
||||||
|
|
@ -143,7 +143,6 @@ void Module::run(Voice* voices, uint32_t blockSize) {
|
||||||
pitchBase += lfoToVco;
|
pitchBase += lfoToVco;
|
||||||
pitchBase += /* pitch bend FIXME */ 0;
|
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 = (patchRam.vcfFreq << 7) + /* vcf bend FIXME */ 0;
|
||||||
vcfBase += lfoToVcf;
|
vcfBase += lfoToVcf;
|
||||||
if (vcfBase > 0x3fff) vcfBase = 0x3fff;
|
if (vcfBase > 0x3fff) vcfBase = 0x3fff;
|
||||||
|
|
@ -183,7 +182,7 @@ void Module::run(Voice* voices, uint32_t blockSize) {
|
||||||
v->omega = px / (sampleRate * 8.0f); // FIXME recalculate table using proper scaler
|
v->omega = px / (sampleRate * 8.0f); // FIXME recalculate table using proper scaler
|
||||||
|
|
||||||
// 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 = vcfBase + (((v->env * patchRam.vcfEnv)>>7) * ((patchRam.switch1 & 0x02) ? -1 : 1));
|
v->vcfCut = vcfBase + (((v->env * patchRam.vcfEnv)>>7) * ((patchRam.switch2 & 0x02) ? -1 : 1));
|
||||||
|
|
||||||
v->vcfCut += (int)((v->note - 36) * (patchRam.vcfKey << 1) * 0.375);
|
v->vcfCut += (int)((v->note - 36) * (patchRam.vcfKey << 1) * 0.375);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ void Voice::run(Module* m, float* buffer, uint32_t framePos, uint32_t samples) {
|
||||||
|
|
||||||
float r = 5 * m->res;
|
float r = 5 * m->res;
|
||||||
|
|
||||||
float amp = vcaEnv / 4096.0f;
|
float amp = vcaEnv / 32768.0f;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < samples; i++) {
|
for (uint32_t i = 0; i < samples; i++) {
|
||||||
out = delay;
|
out = delay;
|
||||||
|
|
@ -117,8 +117,8 @@ void Voice::run(Module* m, float* buffer, uint32_t framePos, uint32_t samples) {
|
||||||
fb = y3;
|
fb = y3;
|
||||||
// hard clip
|
// hard clip
|
||||||
fb = ((out * 0.5) - fb) * r;
|
fb = ((out * 0.5) - fb) * r;
|
||||||
if (fb > 2) fb = 2;
|
if (fb > 6) fb = 6;
|
||||||
if (fb < -2) fb = -2;
|
if (fb < -6) fb = -6;
|
||||||
|
|
||||||
y0 = ((out + fb - y0) * vcfRC) + y0;
|
y0 = ((out + fb - y0) * vcfRC) + y0;
|
||||||
y1 = ((y0 - y1) * vcfRC) + y1;
|
y1 = ((y0 - y1) * vcfRC) + y1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue