7 const CalcPatternMod _pmod = RollJS;
8 const std::string name =
"RollJSMod";
12 float min_mod = 0.85F;
15 float jj_scaler = 2.F;
22 float ms_threshold = 0.0701F;
28 float diff_falloff_power = 1.F;
30 float required_notes_before_nerf = 6.F;
32 const std::vector<std::pair<std::string, float*>> _params{
33 {
"min_mod", &min_mod },
34 {
"max_mod", &max_mod },
37 {
"jj_scaler", &jj_scaler },
38 {
"ms_threshold", &ms_threshold },
39 {
"diff_falloff_power", &diff_falloff_power },
40 {
"required_notes_before_nerf", &required_notes_before_nerf },
42#pragma endregion params and param map
51 float current_problems = 0.F;
56 std::array<float, max_rows_for_single_interval> _left_times{};
57 std::array<float, max_rows_for_single_interval> _right_times{};
59#pragma region generic functions
63 _left_times.fill(s_init);
64 _right_times.fill(s_init);
65 current_problems = 0.F;
84 while (lindex < lc && rindex < rc) {
85 const auto& l = _left_times.at(lindex);
86 const auto& r = _right_times.at(rindex);
87 const auto diff = fabsf(l - r);
89 if (diff <= ms_threshold) {
99 const auto x = std::pow(diff / std::max(ms_threshold, 0.00001F),
101 const auto v = 1 + (x / (x - 2));
102 current_problems += v;
121 void advance_sequencing(
const col_type& ct,
const float& time_s)
123 if (lc >= max_rows_for_single_interval ||
124 rc >= max_rows_for_single_interval) {
132 _left_times.at(lc++) = time_s;
136 _right_times.at(rc++) = time_s;
140 _left_times.at(lc++) = time_s;
141 _right_times.at(rc++) = time_s;
162 pmod = itvhi.
get_taps_nowf() / ((current_problems * 2.F) * jj_scaler);
163 pmod = std::clamp(base + pmod, min_mod, max_mod);
178 current_problems = 0.F;
179 _left_times.fill(s_init);
180 _right_times.fill(s_init);