DISTRHO Mini-Series
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.

129 lines
3.6KB

  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-2022 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. enum PortGroups
  36. {
  37. kPortGroupLow,
  38. kPortGroupMid,
  39. kPortGroupHigh,
  40. kPortGroupCount
  41. };
  42. DistrhoPlugin3BandSplitter();
  43. protected:
  44. // -------------------------------------------------------------------
  45. // Information
  46. const char* getLabel() const noexcept override
  47. {
  48. return "3BandSplitter";
  49. }
  50. const char* getDescription() const override
  51. {
  52. return "3 Band Equalizer, split output version.";
  53. }
  54. const char* getMaker() const noexcept override
  55. {
  56. return "DISTRHO";
  57. }
  58. const char* getHomePage() const override
  59. {
  60. return "https://github.com/DISTRHO/Mini-Series";
  61. }
  62. const char* getLicense() const noexcept override
  63. {
  64. return "LGPL";
  65. }
  66. uint32_t getVersion() const noexcept override
  67. {
  68. return d_version(1, 0, 0);
  69. }
  70. // -------------------------------------------------------------------
  71. // Init
  72. void initAudioPort(bool input, uint32_t index, AudioPort& port) override;
  73. void initParameter(uint32_t index, Parameter& parameter) override;
  74. void initPortGroup(uint32_t groupId, PortGroup& portGroup) override;
  75. void initProgramName(uint32_t index, String& programName) override;
  76. // -------------------------------------------------------------------
  77. // Internal data
  78. float getParameterValue(uint32_t index) const override;
  79. void setParameterValue(uint32_t index, float value) override;
  80. void loadProgram(uint32_t index) override;
  81. // -------------------------------------------------------------------
  82. // Process
  83. void activate() override;
  84. void deactivate() override;
  85. void run(const float** inputs, float** outputs, uint32_t frames) override;
  86. // -------------------------------------------------------------------
  87. private:
  88. float fLow, fMid, fHigh, fMaster, fLowMidFreq, fMidHighFreq;
  89. float lowVol, midVol, highVol, outVol;
  90. float freqLP, freqHP;
  91. float xLP, a0LP, b1LP;
  92. float xHP, a0HP, b1HP;
  93. float out1LP, out2LP, out1HP, out2HP;
  94. float tmp1LP, tmp2LP, tmp1HP, tmp2HP;
  95. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPlugin3BandSplitter)
  96. };
  97. // -----------------------------------------------------------------------
  98. END_NAMESPACE_DISTRHO
  99. #endif // DISTRHO_PLUGIN_3BANDSPLITTER_HPP_INCLUDED