Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 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 allocated on (ideally 32) byte boundaries
  16. float **outBuffers = (float **) _mm_malloc(numOutputChannels * sizeof(float *), 32);
  17. for (int i = 0; i < numOutputChannels; ++i)
  18. {
  19. outBuffers[i] = (float *) _mm_malloc(blockSize * sizeof(float), 32);
  20. }
  21.  
  22. // main processing loop
  23. for (int i = 0; i < numIterations; ++i) {
  24. hv_heavy_process(context, NULL, outBuffers, blockSize);
  25. // do something with output here
  26. }
  27.  
  28. hv_heavy_free(context);
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement