Skip to content

Commit

Permalink
add decay to CJ mod | 450
Browse files Browse the repository at this point in the history
this functions but accomplishes basically nothing at the moment, just adding utility. it only functions when going from dense chordjacks to complete lack of any chords, essentially - and becomes effectively useless if an interval becomes empty
  • Loading branch information
poco0317 committed Aug 27, 2021
1 parent f8f2073 commit dd907f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/Etterna/MinaCalc/Agnostic/HA_PatternMods/CJ.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct CJMod
float not_jack_scaler = 1.75F;

float vibro_flag = 1.F;
float decay_factor = 0.1F;

const std::vector<std::pair<std::string, float*>> _params{
{ "min_mod", &min_mod },
Expand All @@ -51,6 +52,7 @@ struct CJMod
{ "not_jack_scaler", &not_jack_scaler },

{ "vibro_flag", &vibro_flag },
{ "decay_factor", &decay_factor },
};
#pragma endregion params and param map

Expand All @@ -59,6 +61,13 @@ struct CJMod
float not_jack_prop = 0.F;
float pmod = min_mod;
float t_taps = 0.F;
float last_mod = 0.F;

void decay_mod()
{
pmod = std::clamp(last_mod - decay_factor, min_mod, max_mod);
last_mod = pmod;
}

// inline void set_dbg(std::vector<float> doot[], const int& i)
//{
Expand All @@ -76,7 +85,8 @@ struct CJMod

// no chords
if (itvi.chord_taps == 0) {
return min_mod;
decay_mod();
return pmod;
}

t_taps = static_cast<float>(itvi.total_taps);
Expand Down Expand Up @@ -124,6 +134,9 @@ struct CJMod
}
}

// set for decay
last_mod = pmod;

return pmod;
}
};
2 changes: 1 addition & 1 deletion src/Etterna/MinaCalc/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ MinaSDCalcDebug(
}
}

int mina_calc_version = 449;
int mina_calc_version = 450;
auto
GetCalcVersion() -> int
{
Expand Down

0 comments on commit dd907f8

Please sign in to comment.