Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <mm_malloc.h>
  2. #include "Heavy_heavy.h"
  3.  
  4. int main(int argc, const char *argv[]) {
  5.  
  6. int numInputChannels = 0;
  7. int numOutputChannels = 2;
  8. double sampleRate = 44100.0;
  9.  
  10. Hv_heavy *context = hv_heavy_new(numInputChannels, numOutputChannels, 44100.0);
  11.  
  12. int numIterations = 100;
  13. int blockSize = 256; // should be a multiple of 8
  14.  
  15. // sample buffers should be (ideally 32) byte-aligned
  16. float *outBuffers = (float *) _mm_malloc(numOutputChannels * blockSize * sizeof(float), 32);
  17. for (int i = 0; i < numIterations; ++i) {
  18. hv_heavy_process_inline(context, NULL, outBuffers, blockSize);
  19. // do something with output here
  20. }
  21.  
  22. hv_heavy_free(context);
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement