7 const CalcPatternMod _pmod = HandBalance;
8 const std::string name =
"HandBalance";
15 float power_scaling = 0.5F;
17 const std::vector<std::pair<std::string, float*>> _params{
18 {
"min_mod", &min_mod },
19 {
"max_mod", &max_mod },
21 {
"power_scaling", &power_scaling },
23#pragma endregion params and param map
27 float left_hand = 0.F;
28 float right_hand = 0.F;
36 void advance_sequencing(
const int& notes,
Calc& calc) {
37 left_hand += std::popcount(notes & calc.hand_col_masks.at(0));
38 right_hand += std::popcount(notes & calc.hand_col_masks.at(1));
46 auto operator()() ->
float
48 if (left_hand == 0 && right_hand == 0) {
53 fabsf(left_hand - right_hand) / ((left_hand + right_hand) / 2.F);
55 const auto prop = fastpow(1 - diff, power_scaling);
57 pmod = std::clamp(prop, min_mod, max_mod);