10 const CalcPatternMod _pmod = WideRangeCJAnchor;
11 const std::string name =
"WideRangeCJAnchorMod";
18 float len_3_weight = 0.01F;
19 float len_long_weight = -0.0034F;
20 float min_required_taps = 7.F;
21 float moving_window_intervals = 2.F;
22 float long_anchor_pow_base = 1.025F;
24 const std::vector<std::pair<std::string, float*>> _params{
25 {
"min_mod", &min_mod },
26 {
"max_mod", &max_mod },
28 {
"len_3_weight", &len_3_weight },
29 {
"len_long_weight", &len_long_weight },
30 {
"long_anchor_pow_base", &long_anchor_pow_base },
32 {
"min_required_taps", &min_required_taps },
33 {
"moving_window_intervals", &moving_window_intervals },
35#pragma endregion params and param map
58 pmod = fastsqrt(pmod);
62 const auto left = as.get_max_for_window_and_col(
63 col_left,
static_cast<int>(moving_window_intervals));
64 const auto right = as.get_max_for_window_and_col(
65 col_right,
static_cast<int>(moving_window_intervals));
70 const auto anchorest_value = left > right ? left : right;
72 if (anchorest_value < 3) {
74 pmod = fastsqrt(pmod);
76 }
else if (anchorest_value == 3) {
78 pmod = fastsqrt(pmod) + len_3_weight;
84 pmod = pmod + fastpow(long_anchor_pow_base, anchorest_value) * len_long_weight;
92 pmod = std::clamp(pmod, min_mod, max_mod);