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.

124 lines
3.4KB

  1. /*
  2. * DISTRHO 3BandSplitter Plugin, based on 3BandSplitter by Michael Gruhn
  3. * Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
  4. * Copyright (C) 2012-2015 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_3BANDSPLITTER_HPP_INCLUDED
  18. #define DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED
  19. #include "DistrhoPlugin.hpp"
  20. START_NAMESPACE_DISTRHO
  21. // -----------------------------------------------------------------------
  22. class DistrhoPlugin3BandSplitter : 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. DistrhoPlugin3BandSplitter();
  36. protected:
  37. // -------------------------------------------------------------------
  38. // Information
  39. const char* getLabel() const noexcept override
  40. {
  41. return "3BandSplitter";
  42. }
  43. const char* getDescription() const override
  44. {
  45. return "3 Band Equalizer, splitted output version.";
  46. }
  47. const char* getMaker() const noexcept override
  48. {
  49. return "DISTRHO";
  50. }
  51. const char* getHomePage() const override
  52. {
  53. return "https://github.com/DISTRHO/Mini-Series";
  54. }
  55. const char* getLicense() const noexcept override
  56. {
  57. return "LGPL";
  58. }
  59. uint32_t getVersion() const noexcept override
  60. {
  61. return d_version(1, 0, 0);
  62. }
  63. int64_t getUniqueId() const noexcept override
  64. {
  65. return d_cconst('D', '3', 'E', 'S');
  66. }
  67. // -------------------------------------------------------------------
  68. // Init
  69. void initParameter(uint32_t index, Parameter& parameter) override;
  70. void initProgramName(uint32_t index, String& programName) override;
  71. // -------------------------------------------------------------------
  72. // Internal data
  73. float getParameterValue(uint32_t index) const override;
  74. void setParameterValue(uint32_t index, float value) override;
  75. void loadProgram(uint32_t index) override;
  76. // -------------------------------------------------------------------
  77. // Process
  78. void activate() override;
  79. void deactivate() override;
  80. void run(const float** inputs, float** outputs, uint32_t frames) override;
  81. // -------------------------------------------------------------------
  82. private:
  83. float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq;
  84. float lowVol, midVol, highVol, outVol;
  85. float freqLP, freqHP;
  86. float xLP, a0LP, b1LP;
  87. float xHP, a0HP, b1HP;
  88. float out1LP, out2LP, out1HP, out2HP;
  89. float tmp1LP, tmp2LP, tmp1HP, tmp2HP;
  90. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPlugin3BandSplitter)
  91. };
  92. // -----------------------------------------------------------------------
  93. END_NAMESPACE_DISTRHO
  94. #endif // DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED