MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / python_round_to_int

Function python_round_to_int

src/models/ace_step/request_parser.cpp:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74int64_t python_round_to_int(float value) {
75 const double input = static_cast<double>(value);
76 const double floor_value = std::floor(input);
77 const double fraction = input - floor_value;
78 if (fraction > 0.5) {
79 return static_cast<int64_t>(floor_value + 1.0);
80 }
81 if (fraction < 0.5) {
82 return static_cast<int64_t>(floor_value);
83 }
84 const int64_t floor_int = static_cast<int64_t>(floor_value);
85 return (floor_int % 2 == 0) ? floor_int : floor_int + 1;
86}
87
88void apply_repaint_mode_strength(AceStepGenerationOptions & options, const runtime::TaskRequest & request) {
89 const auto mode_value = runtime::find_option(request.options, {"repaint_mode"});

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected