new chan osc, part 6
more adaptations how can I get you out of my head... I want to go back to work!
This commit is contained in:
parent
fe00ee805d
commit
6265d2cd39
27 changed files with 293 additions and 123 deletions
|
|
@ -29,11 +29,14 @@
|
|||
void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
||||
const int depthScale=(15-outDepth);
|
||||
int output=0;
|
||||
|
||||
oscBuf->begin(len);
|
||||
|
||||
for (size_t h=0; h<len; h++) {
|
||||
if (!chan[0].active) {
|
||||
buf[0][h]=0;
|
||||
buf[1][h]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
oscBuf->putSample(h,0);
|
||||
continue;
|
||||
}
|
||||
if (chan[0].useWave || (chan[0].sample>=0 && chan[0].sample<parent->song.sampleLen)) {
|
||||
|
|
@ -229,7 +232,7 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
|||
} else {
|
||||
output=((output*MIN(volMax,chan[0].vol)*MIN(chan[0].envVol,64))>>6)/volMax;
|
||||
}
|
||||
oscBuf->data[oscBuf->needle++]=((output>>depthScale)<<depthScale)>>1;
|
||||
oscBuf->putSample(h,((output>>depthScale)<<depthScale)>>1);
|
||||
if (outStereo) {
|
||||
buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;
|
||||
buf[1][h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale;
|
||||
|
|
@ -239,6 +242,8 @@ void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
|||
buf[1][h]=output;
|
||||
}
|
||||
}
|
||||
|
||||
oscBuf->end(len);
|
||||
}
|
||||
|
||||
void DivPlatformPCMDAC::tick(bool sysTick) {
|
||||
|
|
@ -542,7 +547,7 @@ void DivPlatformPCMDAC::setFlags(const DivConfig& flags) {
|
|||
outDepth=(flags.getInt("outDepth",15))&15;
|
||||
outStereo=flags.getBool("stereo",true);
|
||||
interp=flags.getInt("interpolation",0);
|
||||
oscBuf->rate=rate;
|
||||
oscBuf->setRate(rate);
|
||||
volMax=flags.getInt("volMax",255);
|
||||
if (volMax<1) volMax=1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue