CrossoverEQ.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * CrossoverEQ.h - A native 4-band Crossover Equalizer
  3. * good for simulating tonestacks or simple peakless (flat-band) equalization
  4. *
  5. * Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
  6. * Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  7. *
  8. * This file is part of LMMS - https://lmms.io
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2 of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public
  21. * License along with this program (see COPYING); if not, write to the
  22. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  23. * Boston, MA 02110-1301 USA.
  24. *
  25. */
  26. #ifndef CROSSOVEREQ_H
  27. #define CROSSOVEREQ_H
  28. #include "Effect.h"
  29. #include "CrossoverEQControls.h"
  30. #include "ValueBuffer.h"
  31. #include "lmms_math.h"
  32. #include "BasicFilters.h"
  33. class CrossoverEQEffect : public Effect
  34. {
  35. public:
  36. CrossoverEQEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key );
  37. virtual ~CrossoverEQEffect();
  38. virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames );
  39. virtual EffectControls* controls()
  40. {
  41. return &m_controls;
  42. }
  43. void clearFilterHistories();
  44. private:
  45. CrossoverEQControls m_controls;
  46. void sampleRateChanged();
  47. float m_sampleRate;
  48. float m_gain1;
  49. float m_gain2;
  50. float m_gain3;
  51. float m_gain4;
  52. StereoLinkwitzRiley m_lp1;
  53. StereoLinkwitzRiley m_lp2;
  54. StereoLinkwitzRiley m_lp3;
  55. StereoLinkwitzRiley m_hp2;
  56. StereoLinkwitzRiley m_hp3;
  57. StereoLinkwitzRiley m_hp4;
  58. sampleFrame * m_tmp1;
  59. sampleFrame * m_tmp2;
  60. sampleFrame * m_work;
  61. bool m_needsUpdate;
  62. friend class CrossoverEQControls;
  63. };
  64. #endif