fix module being updated at the wrong time causing incorrect LFO speed
This commit is contained in:
parent
8d987fa5b0
commit
ffe4026b18
|
|
@ -76,8 +76,8 @@ void Module::runLFO() {
|
|||
else
|
||||
lfo = (lfoPhase & 0x3fff) - 0x1fff;
|
||||
|
||||
pw = 0x3fff-(((0x2000 + lfo) * patchRam.pwmLfo) >> 7);
|
||||
pw = (patchRam.switch2 & 0x01) ? 0x3fff - (patchRam.pwmLfo << 7 ) : pw;
|
||||
pw = 0x3fff - (((0x2000 + lfo) * patchRam.pwmLfo) >> 7);
|
||||
pw = (patchRam.switch2 & 0x01) ? 0x3fff - (patchRam.pwmLfo << 7) : pw;
|
||||
lfo = (lfo * lfoDelay) >> 14;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class Module {
|
|||
*/
|
||||
|
||||
struct {
|
||||
uint8_t lfoRate = 0x00;
|
||||
uint8_t lfoRate = 0x1f;
|
||||
uint8_t lfoDelay = 0x00;
|
||||
uint8_t vcoLfo = 0x00;
|
||||
uint8_t pwmLfo = 0x3c;
|
||||
|
|
@ -124,6 +124,7 @@ class Module {
|
|||
|
||||
private:
|
||||
void runLFO();
|
||||
|
||||
// precalculated coefficients for RC networks
|
||||
float pwmTC = 0, subTC = 0, mVcaTC = 0;
|
||||
float pwmRC = 0, subRC = 0, vcaRC = 0;
|
||||
|
|
|
|||
|
|
@ -80,16 +80,14 @@ void Peacock::run(const float**, float** outputs, uint32_t frames, const MidiEve
|
|||
while (framePos < frames) {
|
||||
if (blockLeft == 0) {
|
||||
// no more samples to calculate in this update period
|
||||
blockLeft = sampleRate / 238; // update rate in Hz
|
||||
blockLeft = sampleRate / 233.5; // update rate in Hz, measured
|
||||
runMidi(midiEvents, midiEventCount, framePos + blockLeft);
|
||||
m->run(voice, blockLeft);
|
||||
}
|
||||
|
||||
// how many frames to do? Are we about to run off an update block
|
||||
sizeThisTime = (framesLeft < blockLeft) ? framesLeft : blockLeft;
|
||||
|
||||
// update the module board for this block
|
||||
m->run(voice, sizeThisTime);
|
||||
|
||||
// now run all the voices for this chunk of samples
|
||||
for (uint32_t i = 0; i < NUM_VOICES; i++) {
|
||||
voice[i].run(m, outputs[0], framePos, sizeThisTime);
|
||||
|
|
|
|||
Loading…
Reference in New Issue