2#include "../IntervalHandInfo.h"
9 const CalcPatternMod _pmod = Chaos;
10 const std::string name =
"ChaosMod";
14 float min_mod = 0.88F;
15 float max_mod = 1.07F;
18 const std::vector<std::pair<std::string, float*>> _params{
19 {
"min_mod", &min_mod },
20 {
"max_mod", &max_mod },
23#pragma endregion params and param map
33#pragma region generic functions
47 const float a = ms_any.
get_now();
52 if (any_ms_is_zero(a) || any_ms_is_zero(b) || any_ms_is_close(a, b)) {
58 const float prop = div_high_by_low(a, b);
59 const int mop =
static_cast<int>(prop);
60 float flop = prop -
static_cast<float>(mop);
64 }
else if (flop >= 0.5F) {
65 flop = abs(flop - 1.F) + 1.F;
67 }
else if (flop < 0.5F) {
75 auto operator()(
const int& total_taps) ->
float
78 if (total_taps == 0) {
83 pmod = std::clamp(pmod, min_mod, max_mod);
Definition CalcWindow.h:15
void zero()
set everything to zero
Definition CalcWindow.h:210
auto get_mean_of_window(const int &window) const -> float
get the mean for the moving window up to a given size
Definition CalcWindow.h:85
auto get_now() const -> T
get most recent value in moving window
Definition CalcWindow.h:38
auto get_last() const -> T
get oldest value in moving window
Definition CalcWindow.h:40