Skip to content

Commit

Permalink
stream and cj things | 515
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Nov 1, 2024
1 parent dd6cc2b commit 6c3ce07
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/Etterna/MinaCalc/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ MinaSDCalcDebug(
#endif
}

int mina_calc_version = 514;
int mina_calc_version = 515;
auto
GetCalcVersion() -> int
{
Expand Down
110 changes: 64 additions & 46 deletions src/Etterna/MinaCalc/SequencedBaseDiffCalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,19 @@ struct ceejay

#pragma region params

float static_ms_weight = .65F;
float static_ms_weight = 0.65F;
float min_ms = 75.F;

float base_tap_scaler = 3.F;
float base_tap_scaler = 1.2F;
float huge_anchor_scaler = 1.15F;
float small_anchor_scaler = 1.15F;
float ccj_scaler = 1.25F;
float cct_scaler = 1.5F;
float ccn_scaler = 1.15F;
float ccb_scaler = 1.25F;

int mediterranean = 10;

const std::vector<std::pair<std::string, float*>> _params{
{ "static_ms_weight", &static_ms_weight },
{ "min_ms", &min_ms },
Expand All @@ -240,6 +242,16 @@ struct ceejay
is_scj = (row_count == 1 && last_row_count > 1) &&
((row_notes & last_row_notes) != 0u);

is_actually_continuing_jack = ((row_notes & last_row_notes) != 0u);

carpathian_basin_capsized_boat_chord_bonk.push_back(row_notes ==
last_row_notes);

if (carpathian_basin_capsized_boat_chord_bonk.size() > mediterranean) {
carpathian_basin_capsized_boat_chord_bonk.erase(
carpathian_basin_capsized_boat_chord_bonk.begin());
}

is_at_least_3_note_anch =
((row_notes & last_row_notes) & last_last_row_notes) != 0u;

Expand All @@ -250,6 +262,12 @@ struct ceejay
last_row_notes = row_notes;

last_was_3_note_anch = is_at_least_3_note_anch;

if (is_actually_continuing_jack) {
chain++;
} else {
chain = 1;
}
}

void advance_base(const float& any_ms, Calc& calc)
Expand All @@ -261,44 +279,22 @@ struct ceejay
// pushing back ms values, so multiply to nerf
float pewpew = base_tap_scaler;

if (is_at_least_3_note_anch && last_was_3_note_anch) {
// biggy boy anchors and beyond
pewpew = huge_anchor_scaler;
} else if (is_at_least_3_note_anch) {
// big boy anchors
pewpew = small_anchor_scaler;
} else {
// single note
if (!is_cj) {
if (is_scj) {
// was cj a little bit ago..
if (was_cj) {
// single note jack with 2 chords behind it
// ccj (chord chord jack)
pewpew = ccj_scaler;
} else {
// single note, not a jack, 2 chords behind
// cct (chord chord tap)
pewpew = cct_scaler;
}
}
} else {
// actual cj
if (was_cj) {
// cj now and was cj before, but not necessarily
// with strong anchors
// ccn (chord chord no anchor)
pewpew = ccn_scaler;
} else {
// cj now but wasn't even cj before
// ccb (chordjack beginning)
pewpew = ccb_scaler;
}
}
if (chain < 3)
pewpew *= 1.1F; // stupid and gay
if (chain == 3)
pewpew /= 1.1F; // yes im really doing this

int laguardiaairport = 0;
for (int i = 0; i < carpathian_basin_capsized_boat_chord_bonk.size();
i++) {
laguardiaairport += carpathian_basin_capsized_boat_chord_bonk[i];
}

pewpew *= std::pow(1.025F, laguardiaairport);

// single note streams / regular jacks should retain the base
// multiplier
// cry about it

const auto ms = std::max(min_ms, any_ms * pewpew);
calc.cj_static.at(row_counter) = ms;
Expand Down Expand Up @@ -330,16 +326,21 @@ struct ceejay
}
for (auto i = 0; i < static_ms.size(); i++) {
// weight = 0 means all values become modev
static_ms.at(i) =
weighted_average(static_ms.at(i), static_cast<float>(modev), static_ms_weight, 1.F);
static_ms.at(i) = weighted_average(static_ms.at(i),
static_cast<float>(modev),
static_ms_weight,
1.F);
}

const auto ms_total = sum(static_ms);
const auto ms_mean = ms_total / static_cast<float>(row_counter);
return ms_to_scaled_nps(ms_mean);
}

void interval_end() { row_counter = 0; }
void interval_end()
{
row_counter = 0;
}
void full_reset()
{
is_cj = false;
Expand All @@ -348,11 +349,17 @@ struct ceejay
is_at_least_3_note_anch = false;
last_was_3_note_anch = false;

is_actually_continuing_jack = false;

last_row_count = 0;
last_last_row_count = 0;

last_row_notes = 0U;
last_last_row_notes = 0U;

chain = 1;

carpathian_basin_capsized_boat_chord_bonk.clear();
}

private:
Expand All @@ -364,11 +371,18 @@ struct ceejay
bool is_at_least_3_note_anch = false;
bool last_was_3_note_anch = false;

bool is_actually_continuing_jack = false;

int last_row_count = 0;
int last_last_row_count = 0;

unsigned last_row_notes = 0U;
unsigned last_last_row_notes = 0U;

int chain = 1;

std::vector<int> carpathian_basin_capsized_boat_chord_bonk =
std::vector<int>();
};

/// if this looks ridiculous, that's because it is
Expand Down Expand Up @@ -414,20 +428,24 @@ struct techyo

void advance_base(const SequencerGeneral& seq,
const col_type& ct,
Calc& calc, const int& hand, const float& row_time)
Calc& calc,
const int& hand,
const float& row_time)
{
if (row_counter >= max_rows_for_single_interval) {
return;
}

//process_mw_dt(ct, seq.get_any_ms_now());
//advance_trill_base(calc);
//increment_column_counters(ct);
//auto balance_comp = std::max(calc_balance_comp() * balance_ratio_scaler, min_balance_ratio);
// process_mw_dt(ct, seq.get_any_ms_now());
// advance_trill_base(calc);
// increment_column_counters(ct);
// auto balance_comp = std::max(calc_balance_comp() *
// balance_ratio_scaler, min_balance_ratio);
auto chaos_comp = calc_chaos_comp(seq, ct, calc, hand, row_time);
//insert(balance_ratios, balance_comp);
// insert(balance_ratios, balance_comp);
teehee(chaos_comp);
calc.tc_static.at(row_counter) = teehee.get_mean_of_window((int)tc_static_base_window);
calc.tc_static.at(row_counter) =
teehee.get_mean_of_window((int)tc_static_base_window);
++row_counter;
}

Expand Down
27 changes: 16 additions & 11 deletions src/Etterna/MinaCalc/Ulbu.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct TheGreatBazoinkazoinkInTheSky : public Bazoinkazoink
OHTrill,
VOHTrill,
Roll,
Chaos,
// Chaos,
WideRangeRoll,
WideRangeJumptrill,
WideRangeJJ,
Expand Down Expand Up @@ -175,13 +175,13 @@ struct TheGreatBazoinkazoinkInTheSky : public Bazoinkazoink
{
CJ,
// CJDensity,
CJOHJump,
CJOHAnchor,
VOHTrill,
// CJOHJump,
// CJOHAnchor,
// WideRangeAnchor,
FlamJam, // you may say, why? why not?
// WideRangeJJ,
WideRangeJumptrill,
VOHTrill,
FlamJam, // you may say, why? why not?
},

// tech, duNNO wat im DOIN
Expand Down Expand Up @@ -211,9 +211,9 @@ struct TheGreatBazoinkazoinkInTheSky : public Bazoinkazoink
* chorded patterns have lower enps than streams, streams default to 1 and
* chordstreams start lower, stam is a special case and may use normalizers
* again */
const std::array<float, NUM_Skillset> basescalers = {
0.F, 0.91F, 0.75F, 0.77F, 0.93F, 1.01F, 1.02F, 1.06F
};
const std::array<float, NUM_Skillset> basescalers = { 0.F, 0.91F, 0.75F,
0.77F, 0.93F, 1.01F,
1.06F, 1.06F };

public:
const std::array<std::vector<int>, NUM_Skillset>& get_pmods() const override
Expand Down Expand Up @@ -274,6 +274,10 @@ struct TheGreatBazoinkazoinkInTheSky : public Bazoinkazoink
// we leave
* stam_base alone here, still based on nps
*/
*adj_diff =
_calc.init_base_diff_vals.at(hand).at(CJBase).at(itv) *
basescalers.at(Skill_Chordjack) *
pmod_product_cur_interval[Skill_Chordjack];
break;
case Skill_Technical:
*adj_diff =
Expand Down Expand Up @@ -589,9 +593,6 @@ struct TheGreatBazoinkazoinkInTheSky : public Bazoinkazoink

ct = determine_col_type(row_notes, ids);

// cj must always update
_diffz._cj.update_flags(row_notes, row_count);

// handle any special cases that need to be executed on
// empty rows for this hand here before moving on, aside
// from whatever is in this block _nothing_ else should
Expand All @@ -605,6 +606,10 @@ struct TheGreatBazoinkazoinkInTheSky : public Bazoinkazoink
continue;
}

// cj must always update or maybe not!
_diffz._cj.update_flags(row_notes & ids,
std::popcount(row_notes & ids));

// basically a time master, keeps track of different
// timings, update first
_seq.advance_sequencing(ct, row_time, any_ms);
Expand Down

0 comments on commit 6c3ce07

Please sign in to comment.