15 const CalcPatternMod _pmod = OHTrill;
16 const std::string name =
"OHTrillMod";
20 float window_param = 3.F;
25 float suppression = 0.4F;
28 float cv_threshhold = 0.5F;
30 const std::vector<std::pair<std::string, float*>> _params{
31 {
"window_param", &window_param },
33 {
"min_mod", &min_mod },
34 {
"max_mod", &max_mod },
36 {
"suppression", &suppression },
38 {
"cv_reset", &cv_reset },
39 {
"cv_threshhold", &cv_threshhold },
41#pragma endregion params and param map
46 bool luca_turilli =
false;
60 std::array<int, max_trills_per_interval> foundyatrills = { 0, 0, 0, 0 };
66 float hello_my_name_is_goat = 0.F;
68 float moving_cv = cv_reset;
71#pragma region generic functions
82 for (
auto& v : foundyatrills) {
93 std::clamp(
static_cast<int>(window_param), 1, max_moving_window_size);
95 std::clamp(
static_cast<int>(window_param), 1, max_moving_window_size);
100 auto make_thing(
const float& itv_taps) ->
float
102 hello_my_name_is_goat = 0.F;
104 if (found_oht == 0) {
108 for (
auto& v : foundyatrills) {
114 hello_my_name_is_goat =
115 (
static_cast<float>(v) / itv_taps) - suppression;
117 return std::clamp(hello_my_name_is_goat, 0.1F, 1.F);
122 if (!luca_turilli || oht_len == 0) {
126 if (found_oht < max_trills_per_interval) {
127 foundyatrills.at(found_oht) = oht_len;
130 luca_turilli =
false;
133 moving_cv = (moving_cv + cv_reset) / 2.F;
142 return moving_cv < cv_threshhold;
157 void advance_sequencing(
const meta_type& mt,
163 if (oht_timing_check(ms_any)) {
173 case meta_meta_enigma:
195 if (itvhi.get_taps_windowi(window) == 0 ||
202 if (itvhi.get_taps_windowi(window) ==
211 pmod = std::clamp(pmod, min_mod, max_mod);
216 if (oht_len > 0 && found_oht < max_trills_per_interval) {
217 foundyatrills.at(found_oht) = oht_len;
221 _mw_oht_taps(oht_taps);
231 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