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.

82 lines
2.4KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. LFOParams.h - Parameters for LFO
  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_PARAMS_H
  12. #define LFO_PARAMS_H
  13. #include <Misc/Time.h>
  14. #include <rtosc/ports.h>
  15. #include "Presets.h"
  16. class XMLwrapper;
  17. #define LFO_SINE 0
  18. #define LFO_TRIANGLE 1
  19. #define LFO_SQUARE 2
  20. #define LFO_RAMPUP 3
  21. #define LFO_RAMPDOWN 4
  22. #define LFO_EXP_DOWN1 5
  23. #define LFO_EXP_DOWN2 6
  24. #define LFO_RANDOM 7
  25. class LFOParams:public Presets
  26. {
  27. public:
  28. LFOParams(const AbsTime* time_ = nullptr);
  29. LFOParams(char Pfreq_,
  30. char Pintensity_,
  31. char Pstartphase_,
  32. char PLFOtype_,
  33. char Prandomness_,
  34. char Pdelay_,
  35. char Pcontinous,
  36. char fel_,
  37. const AbsTime* time_ = nullptr);
  38. ~LFOParams();
  39. void add2XML(XMLwrapper& xml);
  40. void defaults();
  41. /**Loads the LFO from the xml*/
  42. void getfromXML(XMLwrapper& xml);
  43. void paste(LFOParams &);
  44. /* MIDI Parameters*/
  45. float Pfreq; /**<frequency*/
  46. unsigned char Pintensity; /**<intensity*/
  47. unsigned char Pstartphase; /**<start phase (0=random)*/
  48. unsigned char PLFOtype; /**<LFO type (sin,triangle,square,ramp,...)*/
  49. unsigned char Prandomness; /**<randomness (0=off)*/
  50. unsigned char Pfreqrand; /**<frequency randomness (0=off)*/
  51. unsigned char Pdelay; /**<delay (0=off)*/
  52. unsigned char Pcontinous; /**<1 if LFO is continous*/
  53. unsigned char Pstretch; /**<how the LFO is "stretched" according the note frequency (64=no stretch)*/
  54. int fel; //what kind is the LFO (0 - frequency, 1 - amplitude, 2 - filter)
  55. const AbsTime *time;
  56. int64_t last_update_timestamp;
  57. static const rtosc::Ports &ports;
  58. private:
  59. /* Default parameters */
  60. unsigned char Dfreq;
  61. unsigned char Dintensity;
  62. unsigned char Dstartphase;
  63. unsigned char DLFOtype;
  64. unsigned char Drandomness;
  65. unsigned char Ddelay;
  66. unsigned char Dcontinous;
  67. };
  68. #endif