White.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. White.h
  3. Copyright 2004-5 Tim Goetze <tim@quitte.de>
  4. http://quitte.de/dsp/
  5. white noise generator.
  6. */
  7. /*
  8. This program is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU General Public License
  10. as published by the Free Software Foundation; either version 2
  11. of the License, or (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. 02111-1307, USA or point your web browser to http://www.gnu.org.
  20. */
  21. #ifndef _WHITE_H_
  22. #define _WHITE_H_
  23. #include "dsp/White.h"
  24. class White
  25. : public Plugin
  26. {
  27. public:
  28. sample_t gain;
  29. DSP::White white;
  30. template <sample_func_t F>
  31. void one_cycle (int frames);
  32. public:
  33. static PortInfo port_info [];
  34. void init() {}
  35. void activate()
  36. { gain = getport(0); }
  37. void run (int n)
  38. {
  39. one_cycle<store_func> (n);
  40. }
  41. void run_adding (int n)
  42. {
  43. one_cycle<adding_func> (n);
  44. }
  45. };
  46. #endif /* _WHITE_H_ */