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.

74 lines
1.8KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. LFO.h - LFO implementation
  4. Copyright (C) 2002-2005 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10. */
  11. #ifndef LFO_H
  12. #define LFO_H
  13. #include "../globals.h"
  14. #include "../Misc/Time.h"
  15. #include "WatchPoint.h"
  16. /**Class for creating Low Frequency Oscillators*/
  17. class LFO
  18. {
  19. public:
  20. /**Constructor
  21. *
  22. * @param lfopars pointer to a LFOParams object
  23. * @param basefreq base frequency of LFO
  24. */
  25. LFO(const LFOParams &lfopars, float basefreq, const AbsTime &t, WatchManager *m=0,
  26. const char *watch_prefix=0);
  27. ~LFO();
  28. float lfoout();
  29. float amplfoout();
  30. private:
  31. float baseOut(const char waveShape, const float phase);
  32. //Phase of Oscillator
  33. float phase;
  34. //Phase Increment Per Frame
  35. float phaseInc;
  36. //Frequency Randomness
  37. float incrnd, nextincrnd;
  38. //Amplitude Randomness
  39. float amp1, amp2;
  40. // RND mode
  41. int first_half;
  42. float last_random;
  43. //Intensity of the wave
  44. float lfointensity;
  45. //Amount Randomness
  46. float lfornd, lfofreqrnd;
  47. //Delay before starting
  48. RelTime delayTime;
  49. char waveShape;
  50. //If After initialization there are no calls to random number gen.
  51. bool deterministic;
  52. const float dt_;
  53. const LFOParams &lfopars_;
  54. const float basefreq_;
  55. VecWatchPoint watchOut;
  56. void computeNextFreqRnd(void);
  57. };
  58. #endif