commit 24b01d660a6b1ff5fbc989e0739c6c24c18733e6
parent c1c73f9d37cfff6eb590352ca096904acd1d2c77
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Wed, 1 Sep 2021 09:35:29 +0200
Little improvements
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/examples/plugins/core-plugin.cc b/examples/plugins/core-plugin.cc
@@ -224,7 +224,8 @@ namespace clap {
std::terminate();
}
- p->setValueSmoothed(ev->param_value.value, 128);
+ p->setValueSmoothed(ev->param_value.value, paramSmoothingDuration_);
+ //p->setValueImmediately(ev->param_value.value);
pluginToGuiQueue_.set(p->info().id, {ev->param_value.value, p->modulation()});
}
break;
@@ -240,7 +241,7 @@ namespace clap {
std::terminate();
}
- p->setModulationSmoothed(ev->param_mod.amount, 128);
+ p->setModulationSmoothed(ev->param_mod.amount, paramSmoothingDuration_);
pluginToGuiQueue_.set(p->info().id, {p->value(), ev->param_mod.amount});
}
break;
diff --git a/examples/plugins/core-plugin.hh b/examples/plugins/core-plugin.hh
@@ -178,5 +178,7 @@ namespace clap {
std::unique_ptr<RemoteGui> remoteGui_;
Parameters parameters_;
+
+ static const constexpr uint32_t paramSmoothingDuration_ = 64;
};
} // namespace clap
\ No newline at end of file
diff --git a/examples/plugins/dc-offset/dc-offset.cc b/examples/plugins/dc-offset/dc-offset.cc
@@ -88,7 +88,7 @@ namespace clap {
/* Process as many samples as possible until the next event */
for (; i < N; ++i) {
- float offset = offsetParam_->step();
+ const float offset = offsetParam_->step();
for (int c = 0; c < channelCount_; ++c)
out[c][i] = in[c][i] + offset;
}