6#include <catch2/catch.hpp>
23 std::string { CMAKE_CURRENT_SOURCE_DIR } +
24 "/benchmarking-dataset/loops/Acoustic Loop Lucaz Collab 116BPM.wav.mp3";
30 std::ofstream debug_output_module {
31 std::string(CMAKE_CURRENT_SOURCE_DIR) +
32 "/TatumQuantizationFitVisualization/debug_output.py"
34 debug_output_module <<
"wavFile = \"" << wavFile <<
"\"\n";
35 debug_output_module <<
"odfSr = " << debugOutput.
odfSr <<
"\n";
36 debug_output_module <<
"audioFileDuration = "
38 debug_output_module <<
"score = " << debugOutput.
score <<
"\n";
39 debug_output_module <<
"tatumRate = "
43 debug_output_module <<
"bpm = " << (result.has_value() ? result->bpm : 0.)
46 debug_output_module <<
"odf_peak_indices = [";
49 [&](
int i) { debug_output_module << i <<
","; });
50 debug_output_module <<
"]\n";
54 debug_output_module, debugOutput.
movingAverage,
"movingAverage");
56 debug_output_module, debugOutput.
odfAutoCorr,
"odfAutoCorr");
59 "odfAutoCorrPeakIndices");
61 std::ofstream stft_log_module {
62 std::string { CMAKE_CURRENT_SOURCE_DIR } +
63 "/TatumQuantizationFitVisualization/stft_log.py"
65 stft_log_module <<
"wavFile = \"" << wavFile <<
"\"\n";
66 stft_log_module <<
"sampleRate = " <<
audio.GetSampleRate() <<
"\n";
67 stft_log_module <<
"frameRate = " << debugOutput.
odfSr <<
"\n";
68 stft_log_module <<
"stft = [";
72 stft_log_module <<
"[";
73 std::for_each(row.begin(), row.end(), [&](float x) {
74 stft_log_module << x <<
",";
76 stft_log_module <<
"],";
78 stft_log_module <<
"]\n";
void PrintPythonVector(std::ofstream &ofs, const std::vector< T > &v, const char *name)
std::optional< MusicalMeter > GetMusicalMeterFromSignal(const MirAudioReader &audio, FalsePositiveTolerance tolerance, const std::function< void(double)> &progressCallback, QuantizationFitDebugOutput *debugOutput)
TEST_CASE("GetBpmFromFilename")
static constexpr auto runLocally
OnsetQuantization tatumQuantization
std::vector< float > odfAutoCorr
std::vector< float > rawOdf
std::vector< int > odfPeakIndices
std::vector< float > movingAverage
std::vector< PffftFloatVector > postProcessedStft
std::vector< int > odfAutoCorrPeakIndices