kind of inefficient

This commit is contained in:
Gordon JC Pearce 2024-09-05 14:40:51 +01:00
parent 9f6525c918
commit 62285542b3

View File

@ -149,14 +149,16 @@ void Chassis::doMidi(const MidiEvent *ev, uint32_t count, uint32_t timelimit ) {
void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) {
// if (midiEventCount > 0) printf("\n--------------------\n");
uint32_t framePos;
s.framesLeft = frames;
while ( s.framesLeft != 0) {
uint32_t sizeThisTime = (frames <= s.blockLeft)?frames:s.blockLeft;
printf("sL = %d bL = %d, calculating %d frames\n", s.framesLeft, s.blockLeft, sizeThisTime);
printf("sL = %d bL = %d, calculating %d frames at %d\n", s.framesLeft, s.blockLeft, sizeThisTime, framePos);
framePos += sizeThisTime;
s.framesLeft -= sizeThisTime;
s.blockLeft -= sizeThisTime;
if (s.blockLeft == 0) {
@ -167,7 +169,7 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
}
if (s.framesLeft <= s.blockLeft) {
s.blockLeft -= s.framesLeft;
printf("ended with %d frames, %d left in block\n", s.framesLeft, s.blockLeft);
printf("ended with %d frames at %d, %d left in block\n", s.framesLeft, framePos, s.blockLeft);
s.framesLeft = 0;
}
};