new dispatch, part 2

This commit is contained in:
tildearrow 2023-01-03 14:39:31 -05:00
parent a29f36a5df
commit 3a687eeb45
4 changed files with 6 additions and 3 deletions

View File

@ -85,6 +85,7 @@ void DivDispatchContainer::setRates(double gotRate) {
for (int i=0; i<outs; i++) {
blip_set_rates(bb[i],dispatch->rate,gotRate);
}
rateMemory=gotRate;
}
void DivDispatchContainer::setQuality(bool lowQual) {

View File

@ -177,6 +177,7 @@ struct DivDispatchContainer {
short* bbIn[DIV_MAX_OUTPUTS];
short* bbOut[DIV_MAX_OUTPUTS];
bool lowQuality, dcOffCompensation;
double rateMemory;
void setRates(double gotRate);
void setQuality(bool lowQual);
@ -194,7 +195,8 @@ struct DivDispatchContainer {
runPos(0),
lastAvail(0),
lowQuality(false),
dcOffCompensation(false) {
dcOffCompensation(false),
rateMemory(0.0) {
memset(bb,0,DIV_MAX_OUTPUTS*sizeof(blip_buffer_t*));
memset(temp,0,DIV_MAX_OUTPUTS*sizeof(int));
memset(prevSample,0,DIV_MAX_OUTPUTS*sizeof(int));

View File

@ -84,7 +84,7 @@ void DivPlatformK007232::acquire(short** buf, size_t len) {
} else {
const unsigned char vol=regPool[0xc];
const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))};
buf[0][h]=buf[1][h]=(out[0]+out[1])<<4;
buf[0][h]=(out[0]+out[1])<<4;
for (int i=0; i<2; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<5;
}

View File

@ -219,7 +219,7 @@ void DivPlatformX1_010::acquire(short** buf, size_t len) {
//printf("tempL: %d tempR: %d\n",tempL,tempR);
buf[0][h]=stereo?tempL:((tempL+tempR)>>1);
buf[1][h]=stereo?tempR:buf[0][h];
if (stereo) buf[1][h]=tempR;
for (int i=0; i<16; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(x1_010.voice_out(i,0)+x1_010.voice_out(i,1))>>1;