Skip to content

Commit 1a14be9

Browse files
committed
fix(zlp::controller): fix unintialized ws and status
1 parent 6f012a4 commit 1a14be9

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

source/zlp/controller.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,15 +590,16 @@ namespace zlp {
590590
fft_hop_size_ = fft_size_ / 4;
591591
num_bin_ = fft_size_ / 2 + 1;
592592
num_bin_effective_ = fft_size_ / 2;
593-
ws_.resize(num_bin_effective_);
593+
ws_.resize(num_bin_);
594+
zldsp::filter::IdealBase<float>::calculateWs(ws_);
594595

595596
window1_.resize(fft_size_);
596597
window2_.resize(fft_size_);
597598
window_bypass_.resize(fft_size_);
598599

599600
zldsp::fft::createPeriodicHanning(std::span{window1_.data(), window1_.size()}, 2.f / static_cast<float>(fft_size_));
600601
const auto v_window2_scale = hn::Set(d, static_cast<float>(fft_size_) / 3.f);
601-
const auto v_bypass_scale = hn::Set(d, 4.f / 3.f);
602+
const auto v_bypass_scale = hn::Set(d, static_cast<float>(fft_size_ * fft_size_) / 6.f);
602603
for (size_t i = 0; i < fft_size_; i += lanes) {
603604
const auto v_window1 = hn::Load(d, window1_.data() + i);
604605
const auto v_window2 = hn::Mul(v_window1, v_window2_scale);
@@ -681,6 +682,10 @@ namespace zlp {
681682
std::ranges::fill(to_update_bases_, true);
682683
std::ranges::fill(to_update_channel_static_, true);
683684
std::ranges::fill(to_update_channel_smooth_bounds_, true);
685+
to_update_.signal();
686+
to_update_filter_status_.signal();
687+
to_update_dynamic_status_.signal();
688+
to_update_lrms_.signal();
684689
to_update_spec_response_.signal();
685690
to_update_channel_data_.signal();
686691
to_update_spec_smooth_.signal();

source/zlp/zlp_definitions.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,6 @@ namespace zlp {
395395
static constexpr auto kDefaultV = false;
396396
};
397397

398-
class PSideSwap : public BoolParameters<PSideSwap> {
399-
public:
400-
static constexpr auto kID = "side_swap";
401-
static constexpr auto kName = "Side Swap";
402-
static constexpr auto kDefaultV = false;
403-
};
404-
405398
class PDynamicMode : public ChoiceParameters<PDynamicMode> {
406399
public:
407400
static constexpr auto kID = "dynamic_mode";
@@ -474,7 +467,6 @@ namespace zlp {
474467
PGain::get(suffix), PTargetGain::get(suffix),
475468
PQ::get(suffix, true, true),
476469
PDynamicON::get(suffix), PDynamicBypass::get(suffix), PDynamicMode::get(suffix),
477-
PSideSwap::get(suffix),
478470
PThresholdAbs::get(suffix), PThresholdBand::get(suffix), PThresholdRel::get(suffix),
479471
PKneeW::get(suffix), PAttack::get(suffix), PRelease::get(suffix));
480472
}

0 commit comments

Comments
 (0)