7 const CalcPatternMod _pmod = OldRollScaler;
8 const std::string name =
"OldRollScalerMod";
13 float max_mod = 1.075F;
15 float use_cv_threshold = 0.6F;
17 float cv_base = 0.85F;
18 float power_scale = 6.F;
20 const std::vector<std::pair<std::string, float*>> _params{
21 {
"min_mod", &min_mod },
22 {
"max_mod", &max_mod },
24 {
"use_cv_threshold", &use_cv_threshold },
25 {
"min_cv", &min_cv },
26 {
"cv_base", &cv_base },
27 {
"power_scale", &power_scale },
29#pragma endregion params and param map
33 std::vector<float> all_ms{};
34 bool left_empty =
true;
35 bool right_empty =
true;
37#pragma region generic functions
52 void advance_sequencing(
const col_type& ct,
const float& any_ms) {
56 all_ms.push_back(any_ms);
60 all_ms.push_back(any_ms);
63 all_ms.push_back(any_ms);
64 all_ms.push_back(any_ms);
76 if (left_empty || right_empty || all_ms.size() == 1) {
80 const auto mmm = mean(all_ms);
82 for (
auto& x : all_ms) {
83 x = mmm / x < use_cv_threshold ? mmm : x;
86 const auto dacv = cv(all_ms);
88 pmod = fastsqrt(fastsqrt(cv_base + dacv));
90 pmod = fastpow(cv_base + dacv, power_scale);
93 pmod = std::clamp(pmod, min_mod, max_mod);