182 int max_ot_sh_len = 0;
183 int max_burst_len = 0;
184 int max_jack_len = 0;
188 int max_anchor_len = 0;
190 void set_params(
const float& moht,
197 max_oht_len =
static_cast<int>(moht);
198 max_off_len =
static_cast<int>(moff);
199 max_ot_sh_len =
static_cast<int>(motsh);
200 max_burst_len =
static_cast<int>(mburst);
201 max_jack_len =
static_cast<int>(mjack);
202 max_anchor_len =
static_cast<int>(manch);
205 col_type _ct = col_init;
206 rm_status _status = rm_inactive;
207 rm_behavior _rmb = rmb_init;
208 rm_behavior _last_rmb = rmb_init;
213 bool is_bursting =
false;
214 bool had_burst =
false;
216 float last_anchor_time = s_init;
217 float _start = s_init;
219#pragma region functions
225 _status = rm_inactive;
227 _last_rmb = rmb_init;
230 last_anchor_time = s_init;
248 assert(_last_rmb == rmb_off_tap_sh);
260 last_anchor_time = as.
_last;
262 assert(_start < last_anchor_time);
286 auto should_restart()
const ->
bool {
return _last_rmb == rmb_off_tap_sh; }
288 void end_off_tap_run()
296 _rm.end_off_tap_run();
300 void handle_last_rmb()
308 _rm.add_off_tap_sh();
316 auto off_len_exceeds_max() ->
bool
319 if (_rm.off_len <= max_off_len) {
325 if (had_burst || _rm.off_len > max_burst_len) {
335 auto ot_sh_len_exceeds_max()
const ->
bool
340 auto jack_len_exceeds_max()
const ->
bool
342 return _rm.jack_len > max_jack_len;
345 auto anch_len_exceeds_max()
const ->
bool
347 return _rm.
anch_len > max_anchor_len;
350 auto oht_len_exceeds_max()
const ->
bool
352 return _rm.
oht_len > max_oht_len;
362 if (anch_len_exceeds_max()) {
363 _status = rm_inactive;
367 switch (as._status) {
374 if (should_restart()) {
377 _status = rm_inactive;
381 _rm.add_anchor_tap();
382 _rm.end_off_tap_run();
389 void handle_off_tap_sh_behavior()
392 _rm.add_off_tap_sh();
393 if (off_len_exceeds_max() || ot_sh_len_exceeds_max()) {
395 _status = rm_inactive;
399 _rm.end_jack_and_anch_runs();
403 void handle_off_tap_oh_behavior()
406 if (off_len_exceeds_max()) {
407 _status = rm_inactive;
415 void handle_jack_behavior()
418 if (jack_len_exceeds_max()) {
419 _status = rm_inactive;
429 void handle_oht_behavior(
const col_type& ct)
452 if (oht_len_exceeds_max()) {
453 _status = rm_inactive;
460 assert(_status == rm_running);
467 handle_off_tap_sh_behavior();
470 handle_anchor_behavior(as);
473 handle_jack_behavior();
484 void advance_off_hand_sequencing()
486 handle_off_tap_oh_behavior();
487 _last_rmb = rmb_off_tap_oh;
490 void operator()(
const col_type& ct,
498 if (mt == meta_cccccc) {
499 handle_oht_behavior(ct);
506 last_anchor_time = as.
_last;
511 if (last_anchor_time == s_init) {
518 case base_left_right:
519 case base_right_left:
520 case base_single_single:
526 _rmb = rmb_off_tap_sh;
529 case base_jump_single:
530 if (_last_rmb == rmb_off_tap_oh) {
538 _rmb = rmb_off_tap_sh;
546 case base_single_jump:
550 if (_last_rmb == rmb_off_tap_oh) {
568 if (_status == rm_inactive) {
569 if (_rmb == rmb_anchor && _last_rmb == rmb_off_tap_sh) {
572 _status = rm_running;
584 [[nodiscard]]
auto get_difficulty()
const ->
float
586 if (_status == rm_inactive || _rm.
_len < 3) {
590 const auto flool = ms_from(last_anchor_time, _start);
592 const auto len =
static_cast<float>(_rm.
_len);
593 const auto len_1 =
static_cast<float>(_rm.
_len - 1);
595 const auto pule = (flool / len_1) * (len / len_1);
596 const auto drool = ms_to_scaled_nps(pule) * rma_diff_scaler;