14 const CalcPatternMod _pmod = VOHTrill;
15 const std::string name =
"VOHTrillMod";
19 float window_param = 2.F;
21 float min_mod = 0.25F;
24 float suppression = 0.2F;
27 float cv_threshhold = 0.25F;
31 const std::vector<std::pair<std::string, float*>> _params{
32 {
"window_param", &window_param },
34 {
"min_mod", &min_mod },
35 {
"max_mod", &max_mod },
37 {
"suppression", &suppression },
39 {
"cv_reset", &cv_reset },
40 {
"cv_threshhold", &cv_threshhold },
42 {
"min_len", &min_len },
44#pragma endregion params and param map
49 bool luca_turilli =
false;
54 std::array<int, max_vtrills_per_interval> foundyatrills = { 0, 0, 0, 0 };
60 float hello_my_name_is_goat = 0.F;
62 float moving_cv = cv_reset;
65#pragma region generic functions
75 for (
auto& v : foundyatrills) {
86 std::clamp(
static_cast<int>(window_param), 1, max_moving_window_size);
88 std::clamp(
static_cast<int>(window_param), 1, max_moving_window_size);
93 auto make_thing(
const float& itv_taps) ->
float
95 hello_my_name_is_goat = 0.F;
101 for (
auto& v : foundyatrills) {
107 hello_my_name_is_goat =
108 (
static_cast<float>(v) / itv_taps) - suppression;
110 return std::clamp(hello_my_name_is_goat, 0.1F, 1.F);
115 if (!luca_turilli || oht_len == 0) {
119 if (found_oht < max_vtrills_per_interval) {
120 foundyatrills.at(found_oht) = oht_len;
123 luca_turilli =
false;
126 moving_cv = (moving_cv + cv_reset) / 2.F;
132 return moving_cv < cv_threshhold;
147 void advance_sequencing(
const meta_type& mt,
153 if (oht_timing_check(ms_any)) {
163 case meta_meta_enigma:
174 if (itvhi.get_taps_windowi(window) == 0 ||
186 if (itvhi.get_taps_windowi(window) ==
195 pmod = std::clamp(pmod, min_mod, max_mod);
200 if (oht_len > 0 && found_oht < max_vtrills_per_interval) {
201 foundyatrills.at(found_oht) = oht_len;
205 _mw_oht_taps(oht_taps);
215 foundyatrills.fill(0);
auto get_cv_of_window(const int &window) const -> float
get the coefficient of variance of the moving window up to a given size
Definition CalcWindow.h:113