🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
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.

36 lines
1.0 KiB

  1. #ifndef CORE_FRONT_STABLIZER_H
  2. #define CORE_FRONT_STABLIZER_H
  3. #include <array>
  4. #include <memory>
  5. #include "almalloc.h"
  6. #include "bufferline.h"
  7. #include "filters/splitter.h"
  8. struct FrontStablizer {
  9. static constexpr size_t DelayLength{256u};
  10. FrontStablizer(size_t numchans) : DelayBuf{numchans} { }
  11. alignas(16) std::array<float,BufferLineSize + DelayLength> Side{};
  12. alignas(16) std::array<float,BufferLineSize + DelayLength> MidDirect{};
  13. alignas(16) std::array<float,DelayLength> MidDelay{};
  14. alignas(16) std::array<float,BufferLineSize + DelayLength> TempBuf{};
  15. BandSplitter MidFilter;
  16. alignas(16) FloatBufferLine MidLF{};
  17. alignas(16) FloatBufferLine MidHF{};
  18. using DelayLine = std::array<float,DelayLength>;
  19. al::FlexArray<DelayLine,16> DelayBuf;
  20. static std::unique_ptr<FrontStablizer> Create(size_t numchans)
  21. { return std::unique_ptr<FrontStablizer>{new(FamCount(numchans)) FrontStablizer{numchans}}; }
  22. DEF_FAM_NEWDEL(FrontStablizer, DelayBuf)
  23. };
  24. #endif /* CORE_FRONT_STABLIZER_H */