13#define USE_FILESYSTEM (__has_include(<filesystem>) && _WIN32)
28 int progress = (width * percent) / 100;
30 for (
int i = 0; i < width; ++i)
35 std::cout <<
"] " << std::setw(3) << percent <<
"%\r";
41 constexpr std::array<double, 5> factors { 1., 2., .5, 3., 1. / 3 };
42 std::vector<OctaveError> octaveErrors;
44 factors.begin(), factors.end(), std::back_inserter(octaveErrors),
46 const auto remainder = std::log2(factor * actual / expected);
47 return OctaveError { factor, remainder };
49 return *std::min_element(
50 octaveErrors.begin(), octaveErrors.end(),
51 [](
const auto& a,
const auto& b) {
52 return std::abs(a.remainder) < std::abs(b.remainder);
OctaveError GetOctaveError(double expected, double actual)
Gets the tempo detection octave error, as defined in section 5. of Schreiber, H., Urbano,...
void ProgressBar(int width, int percent)