26 #include "siddefs-fp.h"
31 #include "FilterModelConfig8580.h"
32 #include "Integrator8580.h"
281 class Filter8580 final :
public Filter
284 unsigned short** mixer;
285 unsigned short** summer;
286 unsigned short** gain_res;
287 unsigned short** gain_vol;
289 const int voiceScaleS11;
295 std::unique_ptr<Integrator8580>
const hpIntegrator;
298 std::unique_ptr<Integrator8580>
const bpIntegrator;
304 void updatedCenterFrequency()
override;
311 void updateResonance(
unsigned char res)
override { currentResonance = gain_res[res]; }
313 void updatedMixing()
override;
317 mixer(FilterModelConfig8580::getInstance()->getMixer()),
318 summer(FilterModelConfig8580::getInstance()->getSummer()),
319 gain_res(FilterModelConfig8580::getInstance()->getGainRes()),
320 gain_vol(FilterModelConfig8580::getInstance()->getGainVol()),
321 voiceScaleS11(FilterModelConfig8580::getInstance()->getVoiceScaleS11()),
322 voiceDC(FilterModelConfig8580::getInstance()->getVoiceDC()),
324 hpIntegrator(FilterModelConfig8580::getInstance()->buildIntegrator()),
325 bpIntegrator(FilterModelConfig8580::getInstance()->buildIntegrator())
333 unsigned short clock(
int voice1,
int voice2,
int voice3)
override;
335 void input(
int sample)
override { ve = (sample * voiceScaleS11 * 3 >> 11) + mixer[0][0]; }
342 void setFilterCurve(
double curvePosition);
347 #if RESID_INLINING || defined(FILTER8580_CPP)
353 unsigned short Filter8580::clock(
int voice1,
int voice2,
int voice3)
355 voice1 = (voice1 * voiceScaleS11 >> 15) + voiceDC;
356 voice2 = (voice2 * voiceScaleS11 >> 15) + voiceDC;
358 voice3 = (filt3 || !voice3off) ? (voice3 * voiceScaleS11 >> 15) + voiceDC : 0;
363 (filt1 ? Vi : Vo) += voice1;
364 (filt2 ? Vi : Vo) += voice2;
365 (filt3 ? Vi : Vo) += voice3;
366 (filtE ? Vi : Vo) += ve;
368 Vhp = currentSummer[currentResonance[Vbp] + Vlp + Vi];
369 Vbp = hpIntegrator->solve(Vhp);
370 Vlp = bpIntegrator->solve(Vbp);
376 return currentGain[currentMixer[Vo]];