Last active
August 29, 2015 14:14
-
-
Save diplojocus/0bee67c1d078a5a9ef9b to your computer and use it in GitHub Desktop.
Heavy - Processing Inline Buffers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mm_malloc.h> | |
#include "Heavy_heavy.h" | |
int main(int argc, const char *argv[]) { | |
double sampleRate = 44100.0; | |
Hv_heavy *context = hv_heavy_new(sampleRate); | |
int numOutputChannels = hv_getNumOutputChannels(context); | |
int numIterations = 100; | |
int blockSize = 256; // should be a multiple of 8 | |
// sample buffers should be (ideally 32) byte-aligned | |
float *outBuffers = (float *) _mm_malloc(numOutputChannels * blockSize * sizeof(float), 32); | |
for (int i = 0; i < numIterations; ++i) { | |
hv_heavy_process_inline(context, NULL, outBuffers, blockSize); | |
// do something with output here | |
} | |
hv_heavy_free(context); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment