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.

DistrhoPlugin3BandEQ.hpp 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * DISTRHO 3BandEQ Plugin, based on 3BandEQ by Michael Gruhn
  3. * Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
  4. * Copyright (C) 2012-2014 Filipe Coelho <falktx@falktx.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation.
  9. *
  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 Lesser General Public License for more details.
  14. *
  15. * For a full copy of the license see the LICENSE file.
  16. */
  17. #ifndef DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED
  18. #define DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED
  19. #include "DistrhoPlugin.hpp"
  20. START_NAMESPACE_DISTRHO
  21. // -----------------------------------------------------------------------
  22. class DistrhoPlugin3BandEQ : public Plugin
  23. {
  24. public:
  25. enum Parameters
  26. {
  27. paramLow = 0,
  28. paramMid,
  29. paramHigh,
  30. paramMaster,
  31. paramLowMidFreq,
  32. paramMidHighFreq,
  33. paramCount
  34. };
  35. DistrhoPlugin3BandEQ();
  36. protected:
  37. // -------------------------------------------------------------------
  38. // Information
  39. const char* d_getLabel() const noexcept override
  40. {
  41. return "3BandEQ";
  42. }
  43. const char* d_getMaker() const noexcept override
  44. {
  45. return "DISTRHO";
  46. }
  47. const char* d_getLicense() const noexcept override
  48. {
  49. return "LGPL";
  50. }
  51. uint32_t d_getVersion() const noexcept override
  52. {
  53. return 0x1000;
  54. }
  55. int64_t d_getUniqueId() const noexcept override
  56. {
  57. return d_cconst('D', '3', 'E', 'Q');
  58. }
  59. // -------------------------------------------------------------------
  60. // Init
  61. void d_initParameter(uint32_t index, Parameter& parameter) override;
  62. void d_initProgramName(uint32_t index, d_string& programName) override;
  63. // -------------------------------------------------------------------
  64. // Internal data
  65. float d_getParameterValue(uint32_t index) const override;
  66. void d_setParameterValue(uint32_t index, float value) override;
  67. void d_setProgram(uint32_t index) override;
  68. // -------------------------------------------------------------------
  69. // Process
  70. void d_activate() override;
  71. void d_deactivate() override;
  72. void d_run(const float** inputs, float** outputs, uint32_t frames) override;
  73. // -------------------------------------------------------------------
  74. private:
  75. float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq;
  76. float lowVol, midVol, highVol, outVol;
  77. float freqLP, freqHP;
  78. float xLP, a0LP, b1LP;
  79. float xHP, a0HP, b1HP;
  80. float out1LP, out2LP, out1HP, out2HP;
  81. float tmp1LP, tmp2LP, tmp1HP, tmp2HP;
  82. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPlugin3BandEQ)
  83. };
  84. // -----------------------------------------------------------------------
  85. END_NAMESPACE_DISTRHO
  86. #endif // DISTRHO_PLUGIN_3BANDEQ_HPP_INCLUDED