I'm trying to build a sort of delay plugin that will trace incoming audio for a fixed window.
In my case, the window is max 4 bars (16 beats).
The worst case, with sample rate 192000 and 10 bpm I'll got:
Code: Select all
const int sampleRate = 192000;
const int bpm = 10;
const int beatsPerBar = 4;
const int bar = 4;
const int size = sampleRate * (60.0 / bpm) * beatsPerBar * bar;
float megaBytes = (size * sizeof(float)) / 1e+6;
[code]
Around ~17 megabytes that need to be allocated in memory.
Of course it can't go in the Stack, but in the Heap:
[code]
float *buffer = new float[size];
...
delete buffer;
I've always work in the Stack; this is the first time I'll approch Heap, processing blocks.
So, before design everything, I think it's better to ask to the experts
Thanks