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.

globals.cpp 1.1KB

12345678910111213141516171819202122232425262728293031323334
  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. void SYNTH_T::alias(bool randomize)
  15. {
  16. halfsamplerate_f = (samplerate_f = samplerate) / 2.0f;
  17. buffersize_f = buffersize;
  18. bufferbytes = buffersize * sizeof(float);
  19. oscilsize_f = oscilsize;
  20. //produce denormal buf
  21. // note: once there will be more buffers, use a cleanup function
  22. // for deleting the buffers and also call it in the dtor
  23. denormalkillbuf.resize(buffersize);
  24. for(int i = 0; i < buffersize; ++i)
  25. if(randomize)
  26. denormalkillbuf[i] = (RND - 0.5f) * 1e-16;
  27. else
  28. denormalkillbuf[i] = 0;
  29. }