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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 modify
  8. it under the terms of version 2 of the GNU General Public License
  9. as published by the Free Software Foundation.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License (version 2 or later) for more details.
  14. You should have received a copy of the GNU General Public License (version 2)
  15. along with this program; if not, write to the Free Software Foundation,
  16. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #include "Misc/Util.h"
  19. #include "globals.h"
  20. void SYNTH_T::alias(bool randomize)
  21. {
  22. halfsamplerate_f = (samplerate_f = samplerate) / 2.0f;
  23. buffersize_f = buffersize;
  24. bufferbytes = buffersize * sizeof(float);
  25. oscilsize_f = oscilsize;
  26. //produce denormal buf
  27. // note: once there will be more buffers, use a cleanup function
  28. // for deleting the buffers and also call it in the dtor
  29. denormalkillbuf.resize(buffersize);
  30. for(int i = 0; i < buffersize; ++i)
  31. if(randomize)
  32. denormalkillbuf[i] = (RND - 0.5f) * 1e-16;
  33. else
  34. denormalkillbuf[i] = 0;
  35. }