kind of inefficient
This commit is contained in:
parent
9f6525c918
commit
62285542b3
@ -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) {
|
void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) {
|
||||||
// if (midiEventCount > 0) printf("\n--------------------\n");
|
// if (midiEventCount > 0) printf("\n--------------------\n");
|
||||||
|
|
||||||
|
uint32_t framePos;
|
||||||
s.framesLeft = frames;
|
s.framesLeft = frames;
|
||||||
|
|
||||||
while ( s.framesLeft != 0) {
|
while ( s.framesLeft != 0) {
|
||||||
uint32_t sizeThisTime = (frames <= s.blockLeft)?frames:s.blockLeft;
|
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.framesLeft -= sizeThisTime;
|
||||||
s.blockLeft -= sizeThisTime;
|
s.blockLeft -= sizeThisTime;
|
||||||
if (s.blockLeft == 0) {
|
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) {
|
if (s.framesLeft <= s.blockLeft) {
|
||||||
s.blockLeft -= s.framesLeft;
|
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;
|
s.framesLeft = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user