Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. globals.h - it contains program settings and the program capabilities
  4. like number of parts, of effects
  5. Copyright (C) 2002-2005 Nasca Octavian Paul
  6. Author: Nasca Octavian Paul
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11. */
  12. #include "Misc/Util.h"
  13. #include "globals.h"
  14. namespace zyncarla {
  15. void SYNTH_T::alias(bool randomize)
  16. {
  17. halfsamplerate_f = (samplerate_f = samplerate) / 2.0f;
  18. buffersize_f = buffersize;
  19. bufferbytes = buffersize * sizeof(float);
  20. oscilsize_f = oscilsize;
  21. //produce denormal buf
  22. // note: once there will be more buffers, use a cleanup function
  23. // for deleting the buffers and also call it in the dtor
  24. denormalkillbuf.resize(buffersize);
  25. for(int i = 0; i < buffersize; ++i)
  26. if(randomize)
  27. denormalkillbuf[i] = (RND - 0.5f) * 1e-16;
  28. else
  29. denormalkillbuf[i] = 0;
  30. }
  31. }