Etterna 0.75.1
Loading...
Searching...
No Matches
OldOHJScaler.h
1#pragma once
2#include "../MetaIntervalHandInfo.h"
3
6{
7 const CalcPatternMod _pmod = OldOHJScaler;
8 const std::string name = "OldOHJScalerMod";
9
10#pragma region params
11
12 float min_mod = 0.6F;
13 float max_mod = 1.1F;
14
15 float extra_divisor = 1.F;
16 float power_scale = 0.24F;
17
18 const std::vector<std::pair<std::string, float*>> _params{
19 { "min_mod", &min_mod },
20 { "max_mod", &max_mod },
21
22 { "extra_divisor", &extra_divisor },
23 { "power_scale", &power_scale },
24 };
25#pragma endregion params and param map
26
27 float pmod = neutral;
28
29#pragma region generic functions
30
31 void full_reset() { pmod = neutral; }
32
33#pragma endregion
34
35 void set_pmod(const ItvHandInfo& itvhi)
36 {
37
38 // nothing here
39 if (itvhi.get_taps_nowi() == 0) {
40 pmod = neutral;
41 } else {
42 // taps counts up twice for ohj
43 const auto taps = itvhi.get_taps_nowf();
44 // one ohj makes this also worth 2
45 const auto jumptaps = itvhi.get_col_taps_nowf(col_ohjump);
46 // so, if there is just a single ohj in the interval
47 // taps == jumptaps
48
49 pmod = fastpow(1 - (jumptaps / taps / extra_divisor), power_scale);
50 }
51
52
53 pmod = std::clamp(pmod, min_mod, max_mod);
54 }
55
56 auto operator()(const ItvHandInfo& itvhi) -> float
57 {
58 set_pmod(itvhi);
59 return pmod;
60 }
61};
accumulates hand specific info across an interval as it's processed by row
Definition IntervalHandInfo.h:6
auto get_taps_nowi() const -> int
access functions for hand tap counts
Definition IntervalHandInfo.h:135
auto get_col_taps_nowf(const col_type &ct) const -> float
cast to float for divisioning and clean screen
Definition IntervalHandInfo.h:61
auto get_taps_nowf() const -> float
cast to float for divisioning and clean screen
Definition IntervalHandInfo.h:141
Hand downscaler based on how many one hand jumps there are.
Definition OldOHJScaler.h:6