26 #include "siddefs-fp.h"
31 #include "FilterModelConfig.h"
57 const int voiceScaleS14, voiceDC;
60 unsigned short* currentGain;
63 unsigned short* currentMixer;
66 unsigned short* currentSummer;
69 unsigned short* currentResonance;
72 std::auto_ptr<Integrator> hpIntegrator;
75 std::auto_ptr<Integrator> bpIntegrator;
77 const unsigned short* f0_dac;
79 unsigned short** mixer;
80 unsigned short** summer;
81 unsigned short** gain;
89 voiceScaleS14(FilterModelConfig::getInstance()->getVoiceScaleS14()),
90 voiceDC(FilterModelConfig::getInstance()->getVoiceDC()),
95 hpIntegrator(FilterModelConfig::getInstance()->buildIntegrator()),
96 bpIntegrator(FilterModelConfig::getInstance()->buildIntegrator()),
97 f0_dac(FilterModelConfig::getInstance()->getDAC(0.5)),
98 mixer(FilterModelConfig::getInstance()->getMixer()),
99 summer(FilterModelConfig::getInstance()->getSummer()),
100 gain(FilterModelConfig::getInstance()->getGain())
107 int clock(
int voice1,
int voice2,
int voice3);
109 void input(
int sample) { ve = (sample * voiceScaleS14 * 3 >> 10) + mixer[0][0]; }
136 #if RESID_INLINING || defined(FILTER6581_CPP)
138 #include "Integrator.h"
146 voice1 = (voice1 * voiceScaleS14 >> 18) + voiceDC;
147 voice2 = (voice2 * voiceScaleS14 >> 18) + voiceDC;
148 voice3 = (voice3 * voiceScaleS14 >> 18) + voiceDC;
153 (
filt1 ? Vi : Vo) += voice1;
155 (filt2 ? Vi : Vo) += voice2;
168 (filtE ? Vi : Vo) += ve;
170 const int oldVhp = Vhp;
171 Vhp = currentSummer[currentResonance[Vbp] + Vlp + Vi];
172 Vlp = bpIntegrator->solve(Vbp);
173 Vbp = hpIntegrator->solve(oldVhp);
190 return currentGain[currentMixer[Vo]] - (1 << 15);