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.

DistrhoPluginStereoEnhancer.hpp 3.1KB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * DISTRHO StereoEnhancer Plugin, based on StereoEnhancer by Michael Gruhn
  3. * Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
  4. * Copyright (C) 2012-2013 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 doc/LGPL.txt file.
  16. */
  17. #ifndef DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED
  18. #define DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED
  19. #include "DistrhoPlugin.hpp"
  20. START_NAMESPACE_DISTRHO
  21. // -----------------------------------------------------------------------
  22. class DistrhoPluginStereoEnhancer : public Plugin
  23. {
  24. public:
  25. enum Parameters
  26. {
  27. paramWidthLows = 0,
  28. paramWidthHighs,
  29. paramCrossover,
  30. paramCount
  31. };
  32. DistrhoPluginStereoEnhancer();
  33. ~DistrhoPluginStereoEnhancer() override;
  34. protected:
  35. // -------------------------------------------------------------------
  36. // Information
  37. const char* d_getLabel() const noexcept override
  38. {
  39. return "StereoEnhancer";
  40. }
  41. const char* d_getMaker() const noexcept override
  42. {
  43. return "DISTRHO";
  44. }
  45. const char* d_getLicense() const noexcept override
  46. {
  47. return "LGPL";
  48. }
  49. uint32_t d_getVersion() const noexcept override
  50. {
  51. return 0x1000;
  52. }
  53. long d_getUniqueId() const noexcept override
  54. {
  55. return d_cconst('D', 'S', 't', 'E');
  56. }
  57. // -------------------------------------------------------------------
  58. // Init
  59. void d_initParameter(uint32_t index, Parameter& parameter) override;
  60. void d_initProgramName(uint32_t index, d_string& programName) override;
  61. // -------------------------------------------------------------------
  62. // Internal data
  63. float d_getParameterValue(uint32_t index) const override;
  64. void d_setParameterValue(uint32_t index, float value) override;
  65. void d_setProgram(uint32_t index) override;
  66. // -------------------------------------------------------------------
  67. // Process
  68. void d_activate() override;
  69. void d_deactivate() override;
  70. void d_run(float** inputs, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
  71. // -------------------------------------------------------------------
  72. private:
  73. float widthLP, widthCoeffLP;
  74. float freqHP, freqHPFader;
  75. float widthHP, widthCoeffHP;
  76. float xHP, a0HP, b1HP;
  77. float out1HP, out2HP;
  78. float tmp1HP, tmp2HP;
  79. float monoHP, stereoHP;
  80. float monoLP, stereoLP;
  81. };
  82. // -----------------------------------------------------------------------
  83. END_NAMESPACE_DISTRHO
  84. #endif // DISTRHO_PLUGIN_STEREO_ENHANCER_HPP_INCLUDED