Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <mm_malloc.h>
- #include "Heavy_heavy.h"
- int main(int argc, const char *argv[]) {
- int numInputChannels = 0;
- int numOutputChannels = 2;
- double sampleRate = 44100.0;
- Hv_heavy *context = hv_heavy_new(numInputChannels, numOutputChannels, 44100.0);
- int numIterations = 100;
- int blockSize = 256; // should be a multiple of 8
- // sample buffers should be allocated on (ideally 32) byte boundaries
- float **outBuffers = (float **) _mm_malloc(numOutputChannels * sizeof(float *), 32);
- for (int i = 0; i < numOutputChannels; ++i)
- {
- outBuffers[i] = (float *) _mm_malloc(blockSize * sizeof(float), 32);
- }
- // main processing loop
- for (int i = 0; i < numIterations; ++i) {
- hv_heavy_process(context, NULL, outBuffers, blockSize);
- // do something with output here
- }
- hv_heavy_free(context);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement