main.cpp/cfg : Added cwCSV test and updated cfg for 'score_follow'.

This commit is contained in:
kevin 2023-05-16 09:09:11 -04:00
parent 4fef6e4dc7
commit df8140522a
2 changed files with 82 additions and 17 deletions

View File

@ -1828,27 +1828,81 @@
},
score_follow: {
"midi_fname": "~/src/currawong/audio/workshop/beck1/record_4/midi.mid",
"srate": 48000,
"out_dir": "~/temp/score_follow_test"
srate: 48000,
out_dir: "~/temp/score_follow_test",
pre_test_fl: true,
show_muid_fl: false,
// each of these files will be written to the dir: <out_dir>/<perf_label>
out_svg_fname: "sf_results.html",
out_cm_score_rpt_fname: "cm_score_report.txt",
out_midi_csv_fname: "midi.csv",
cfg: {
"score_csv_fname": "~/src/currawong/projects/score_follow/cm_score.csv",
"search_area_locN": 10,
"key_wnd_locN": 7,
cm_score_csv_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/cm_score.csv",
search_area_locN: 10,
key_wnd_locN: 7,
}
//1. first notes in shiau-uen 11 are duplicated.
// show muid in perf-notes to check if the duplicates are caused by backtracking
//
//2. valgrind shows a write error
perfL: [
{
label: shiau_uen_5,
enable_fl: false,
start_loc: 327,
midi_fname: "~/temp/shiau_uen/record_5/midi.mid",
},
{
label: shiau_uen_7,
enable_fl: false,
start_loc: 2547,
midi_fname: "~/temp/shiau_uen/record_7/midi.mid",
},
{
label: shiau_uen_11,
enable_fl: true,
start_loc: 5361,
midi_fname: "~/temp/shiau_uen/record_11/midi.mid",
},
{
label: shiau_uen_13,
enable_fl: false,
start_loc: 8291,
midi_fname: "~/temp/shiau_uen/record_13/midi.mid",
},
{
label: shiau_uen_17,
enable_fl: false,
start_loc: 11456,
midi_fname: "~/temp/shiau_uen/record_17/midi.mid",
},
{
label: shiau_uen_23,
enable_fl: false,
start_loc: 13565,
midi_fname: "~/temp/shiau_uen/record_23/midi.mid",
}
]
}
svg_midi_file: {
//"src_file_type": "midi",
//"src_fname": "~/src/currawong/audio/workshop/beck1/record_4/midi.mid",
"src_file_type": "midi",
"src_fname": "~/temp/shiau_uen/record_5/midi.mid",
"src_file_type": "piano_score",
"src_fname": "~/src/cwtest/src/cwtest/cfg/gutim_full/score/temp.csv",
//"src_file_type": "piano_score",
//"src_fname": "~/src/cwtest/src/cwtest/cfg/gutim_full/score/temp.csv",
//"src_fname": "/home/kevin/src/cwtest/src/cwtest/cfg/preset_sel/score/20220423/temp.csv"
"out_fname": "~/temp/temp_midi.html"
"out_fname": "~/temp/score_follow_test/midi_svg.html"
"midi_state_args": {
"cache_enable_fl": true,
"cache_block_msg_count": 128,
@ -1882,7 +1936,14 @@
"pedal_half_min_midi_value": 43,
"pedal_half_max_midi_value": 45
}
}
},
csv: {
fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/cm_score.csv",
titleL: [ "status","d0","d1" ]
// titleL: []
},
}

View File

@ -32,6 +32,7 @@
#include "cwIoPresetSelApp.h"
#include "cwCmInterface.h"
#include "cwScoreFollower.h"
#include "cwCsv.h"
#if defined(cwWEBSOCK)
#include "cwWebSock.h"
@ -403,6 +404,7 @@ cw::rc_t flowTest( const cw::object_t* cfg, const cw::object_t* args
cw::rc_t scoreFollowTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_follower::test(args); }
cw::rc_t svgMidiFileTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::svg_midi::test_midi_file(args); }
cw::rc_t midiStateTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::midi_state::test(args); }
cw::rc_t csvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::csv::test(args); }
#if defined(cwWEBSOCK)
@ -792,6 +794,7 @@ int main( int argc, const char* argv[] )
{ "score_follow", scoreFollowTest },
{ "svg_midi_file", svgMidiFileTest },
{ "midi_state", midiStateTest },
{ "csv", csvTest },
{ "stub", stubTest },
{ nullptr, nullptr }
};
@ -861,11 +864,12 @@ int main( int argc, const char* argv[] )
if( modeArray[i].label == nullptr )
rc = cwLogError(cw::kInvalidArgRC,"The mode selector: '%s' is not valid.", cwStringNullGuard(mode));
if( cfg != nullptr )
cfg->free();
}
errLabel:
if( cfg != nullptr )
cfg->free();
cw::log::destroyGlobal();
return (int)rc;