new chan osc, part 4

adapt dispatch code to it
This commit is contained in:
tildearrow 2025-03-01 19:49:56 -05:00
parent c0e4552c52
commit a16d20e190
18 changed files with 218 additions and 88 deletions

View file

@ -41,6 +41,10 @@ double DivPlatformSoundUnit::NOTE_SU(int ch, int note) {
}
void DivPlatformSoundUnit::acquire(short** buf, size_t len) {
for (int i=0; i<8; i++) {
oscBuf[i]->begin(len);
}
for (size_t h=0; h<len; h++) {
while (!writes.empty()) {
QueuedWrite w=writes.front();
@ -49,9 +53,13 @@ void DivPlatformSoundUnit::acquire(short** buf, size_t len) {
}
su->NextSample(&buf[0][h],&buf[1][h]);
for (int i=0; i<8; i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=su->GetSample(i);
oscBuf[i]->putSample(h,su->GetSample(i));
}
}
for (int i=0; i<8; i++) {
oscBuf[i]->end(len);
}
}
void DivPlatformSoundUnit::writeControl(int ch) {
@ -646,7 +654,7 @@ void DivPlatformSoundUnit::setFlags(const DivConfig& flags) {
CHECK_CUSTOM_CLOCK;
rate=chipClock/4;
for (int i=0; i<8; i++) {
oscBuf[i]->rate=rate;
oscBuf[i]->setRate(rate);
}
bool echoOn=flags.getBool("echo",false);
initIlCtrl=3|(echoOn?4:0);