new chan osc work in progress

This commit is contained in:
tildearrow 2025-03-01 05:05:50 -05:00
parent 0eea0ec139
commit dd7e1def3d
11 changed files with 171 additions and 74 deletions

View file

@ -71,6 +71,9 @@ const char** DivPlatformSNES::getRegisterSheet() {
void DivPlatformSNES::acquire(short** buf, size_t len) {
short out[2];
short chOut[16];
for (int i=0; i<8; i++) {
oscBuf[i]->begin(len);
}
for (size_t h=0; h<len; h++) {
if (--delay<=0) {
delay=0;
@ -94,9 +97,12 @@ void DivPlatformSNES::acquire(short** buf, size_t len) {
next=(next*254)/MAX(1,globalVolL+globalVolR);
if (next<-32768) next=-32768;
if (next>32767) next=32767;
oscBuf[i]->data[oscBuf[i]->needle++]=next>>1;
oscBuf[i]->putSample(h,next>>1);
}
}
for (int i=0; i<8; i++) {
oscBuf[i]->end(len);
}
}
void DivPlatformSNES::tick(bool sysTick) {
@ -1058,7 +1064,7 @@ int DivPlatformSNES::init(DivEngine* p, int channels, int sugRate, const DivConf
rate=chipClock/32;
for (int i=0; i<8; i++) {
oscBuf[i]=new DivDispatchOscBuffer;
oscBuf[i]->rate=rate;
oscBuf[i]->setRate(rate);
isMuted[i]=false;
}
setFlags(flags);