Didn’t have good experience poking with boost memory map so just wondering
You definitely have to . the bottle neck is in getSample Call . these are mip mapped so i can get away with linear interpolation I hope.
class PokerThread: public juce::Thread {
public:
PokerThread(PrecisionKickAudioProcessor & processor)
:juce::Thread("PokerThread"),audioProcessor(processor)
{
}
void run() override {
while(!threadShouldExit()) {
if(auto * sound = dynamic_cast<SampSound*>(audioProcessor.samplerI.getSound(0).get())) {
for(int i = std::fmax(sound->sample_pos.load()-2048,0); i < sound->sample_pos.load()+2048; i++) {
sound->mmr[0]->touchSample(i*2);
sound->mmr[1]->touchSample(i);
sound->mmr[2]->touchSample(i/2);
sound->mmr[3]->touchSample(i/4);
sound->mmr[4]->touchSample(i/8);
sound->mmr[5]->touchSample(i/16);
sound->mmr[6]->touchSample(i/32);
sound->mmr[7]->touchSample(i/64);
}
}
wait(10);
}
}
PrecisionKickAudioProcessor & audioProcessor;
};
