main.cpp,main.cfg : Updates to use cwScoreTest.

This commit is contained in:
kevin 2023-08-20 17:32:25 -04:00
parent e55673f0dd
commit cb1acfd18f
2 changed files with 117 additions and 138 deletions

View File

@ -1831,10 +1831,11 @@
score_follow: { score_follow: {
srate: 48000, srate: 48000,
out_dir: "~/temp/score_follow_test", out_dir: "~/temp/score_follow_test_1",
pre_test_fl: true, pre_test_fl: true,
show_muid_fl: false, show_muid_fl: false,
score_report_fl: false,
// each of these files will be written to the dir: <out_dir>/<perf_label> // each of these files will be written to the dir: <out_dir>/<perf_label>
out_svg_fname: "sf_results.html", out_svg_fname: "sf_results.html",
@ -1842,9 +1843,36 @@
out_midi_csv_fname: "midi.csv", out_midi_csv_fname: "midi.csv",
cfg: { cfg: {
cm_score_csv_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/cm_score.csv", enable_flag: true,
cm_score_csv_fname: "/home/kevin/src/currawong/projects/score_proc/score_out.csv",
search_area_locN: 10, search_area_locN: 10,
key_wnd_locN: 7, key_wnd_locN: 7,
dyn_ref:
{
"silent": 1,
"pppp":10,
"ppp_m":20,
"ppp":25,
"ppp_p":30,
"pp_m":30,
"pp":35,
"pp_p":40,
"p_m":40,
"p":45,
"p_p":50,
"mp_m":50
"mp":55
"mp_p":60,
"mf_m":60,
"mf":65,
"mf_p":70,
"f_m":70,
"f":75,
"f_p":80,
"ff":85,
"fff":100,
"ffff":120
}
} }
//1. first notes in shiau-uen 11 are duplicated. //1. first notes in shiau-uen 11 are duplicated.
@ -1857,7 +1885,7 @@
{ {
label: shiau_uen_5, label: shiau_uen_5,
enable_fl: false, enable_fl: true,
start_loc: 327, start_loc: 327,
midi_fname: "~/temp/shiau_uen/record_5/midi.mid", midi_fname: "~/temp/shiau_uen/record_5/midi.mid",
@ -1870,7 +1898,7 @@
}, },
{ {
label: shiau_uen_11, label: shiau_uen_11,
enable_fl: true, enable_fl: false,
start_loc: 5361, start_loc: 5361,
midi_fname: "~/temp/shiau_uen/record_11/midi.mid", midi_fname: "~/temp/shiau_uen/record_11/midi.mid",
}, },
@ -1946,37 +1974,46 @@
// titleL: [] // titleL: []
}, },
sfscore: { score_test: {
//cm_score_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/cm_score.csv", score_fname: "/home/kevin/src/currawong/projects/score_proc/temp.csv"
cm_score_fname: "/home/kevin/src/currawong/projects/score_proc/score_out.csv"
srate: 48000, srate: 48000,
dyn_ref: { parse_fl: true, // do score parsing
"silent": 1, parse_report_fl: false, // report parse
"pppp":10, score_fl: true , // do sfscore processing
"ppp_m":20, score_report_fl: false, // report sfscore
"ppp":25, match_fl: true, // score match test
"ppp_p":30, track_fl: true, // score track test
"pp_m":30,
"pp":35, dyn_ref: [
"pp_p":40, { mark: "silent", level:0, vel:1 },
"p_m":40, { mark:"pppp-", level:1, vel:3 },
"p":45, { mark:"pppp", level:2, vel:5 },
"p_p":50, { mark:"pppp+", level:3, vel:7 },
"mp_m":50 { mark:"ppp-", level:4, vel:10 },
"mp":55 { mark:"ppp", level:5, vel:15 },
"mp_p":60, { mark:"ppp+", level:6, vel:20 },
"mf_m":60, { mark:"pp-", level:7, vel:25 },
"mf":65, { mark:"pp", level:8, vel:30 },
"mf_p":70, { mark:"pp+", level:9, vel:35 },
"f_m":70, { mark:"p-", level:10,vel:40 },
"f":75, { mark:"p", level:11,vel:45 },
"f_p":80, { mark:"p+", level:12, vel:50 },
"ff":85, { mark:"mp-", level:13, vel:55 },
"fff":100, { mark:"mp", level:14, vel:60 },
"ffff":120 { mark:"mp+", level:15, vel:65 },
} { mark:"mf-", level:16, vel:70 },
} { mark:"mf", level:17, vel:75 },
{ mark:"mf+", level:18, vel:80 },
{ mark:"f-", level:19, vel:85 },
{ mark:"f", level:20, vel:90 },
{ mark:"f+", level:21, vel:95 },
{ mark:"ff", level:22, vel:100 },
{ mark:"ff+", level:23, vel:105 },
{ mark:"fff", level:24, vel:115 },
{ mark:"fff+", level:25, vel:120 },
{ mark:"ffff", level:26, vel:125 },
]
sfmatch: { sfmatch: {
@ -1987,37 +2024,9 @@
loc_cnt: 10 loc_cnt: 10
} }
cm_score_fname: "/home/kevin/src/currawong/projects/score_proc/score_out.csv"
srate: 48000,
maxScWndN: 10, // max size of the score alignment window maxScWndN: 10, // max size of the score alignment window
maxMidiWndN: 7, // max counf of the performance (MIDI) alignment window maxMidiWndN: 7, // max counf of the performance (MIDI) alignment window
dyn_ref: {
"silent": 1,
"pppp":10,
"ppp_m":20,
"ppp":25,
"ppp_p":30,
"pp_m":30,
"pp":35,
"pp_p":40,
"p_m":40,
"p":45,
"p_p":50,
"mp_m":50
"mp":55
"mp_p":60,
"mf_m":60,
"mf":65,
"mf_p":70,
"f_m":70,
"f":75,
"f_p":80,
"ff":85,
"fff":100,
"ffff":120
}
perf: [ perf: [
{ muid:0 smpIdx:0 pitch:65 vel:44 }, { muid:0 smpIdx:0 pitch:65 vel:44 },
{ muid:1 smpIdx:3600 pitch:63 vel:64 }, { muid:1 smpIdx:3600 pitch:63 vel:64 },
@ -2036,49 +2045,18 @@
}, },
sftrack: { sftrack: {
cm_score_fname: "/home/kevin/src/currawong/projects/score_proc/score_out.csv"
srate: 48000,
maxScWndN: 10, // max size of the score alignment window maxScWndN: 10, // max size of the score alignment window
maxMidiWndN: 7, // max counf of the performance (MIDI) alignment window maxMidiWndN: 7, // max counf of the performance (MIDI) alignment window
report_midi_file_fl: false, report_midi_file_fl: false,
report_score_fl: false, report_track_fl: true,
report_track_fl: true
dyn_ref: {
"silent": 1,
"pppp":10,
"ppp_m":20,
"ppp":25,
"ppp_p":30,
"pp_m":30,
"pp":35,
"pp_p":40,
"p_m":40,
"p":45,
"p_p":50,
"mp_m":50
"mp":55
"mp_p":60,
"mf_m":60,
"mf":65,
"mf_p":70,
"f_m":70,
"f":75,
"f_p":80,
"ff":85,
"fff":100,
"ffff":120
}
perf:{ perf:{
enable_fl:true, enable_fl:true,
loc_idx: 120, loc_idx: 120,
midi_fname:"/home/kevin/temp/shiau_uen/record_5/midi.mid" midi_fname:"/home/kevin/temp/shiau_uen/record_5/midi.mid"
}
} }
} }
} }

View File

@ -30,7 +30,17 @@
#include "cwFlow.h" #include "cwFlow.h"
#include "cwPianoScore.h" #include "cwPianoScore.h"
#include "cwIoPresetSelApp.h" #include "cwIoPresetSelApp.h"
#include "cwCmInterface.h"
#include "cwTime.h"
#include "cwMidi.h"
#include "cwDynRefTbl.h"
#include "cwScoreParse.h"
#include "cwSfScore.h"
#include "cwSfMatch.h"
#include "cwScoreTest.h"
#include "cwSfTrack.h"
#include "cwScoreFollowerPerf.h" #include "cwScoreFollowerPerf.h"
#include "cwScoreFollower.h" #include "cwScoreFollower.h"
#include "cwCsv.h" #include "cwCsv.h"
@ -42,13 +52,8 @@
#include "cwUiTest.h" #include "cwUiTest.h"
#endif #endif
#include "cwTime.h"
#include "cwMidi.h"
#include "cwMidiFile.h" #include "cwMidiFile.h"
#include "cwAudioDevice.h" #include "cwAudioDevice.h"
#include "cwSfScore.h"
#include "cwSfMatch.h"
#include "cwSfTrack.h"
#if(cwALSA) #if(cwALSA)
#include "cwMidiPort.h" #include "cwMidiPort.h"
@ -409,9 +414,7 @@ cw::rc_t scoreFollowTest( const cw::object_t* cfg, const cw::object_t* args, int
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 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 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); } cw::rc_t csvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::csv::test(args); }
cw::rc_t sfScoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::sfscore::test(args); } cw::rc_t scoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::score_test::test(args); }
cw::rc_t sfMatchTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::sfmatch::test(args); }
cw::rc_t sfTrackTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::sftrack::test(args); }
#if defined(cwWEBSOCK) #if defined(cwWEBSOCK)
cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::websockSrvTest(cfg); } cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::websockSrvTest(cfg); }
@ -801,9 +804,7 @@ int main( int argc, const char* argv[] )
{ "svg_midi_file", svgMidiFileTest }, { "svg_midi_file", svgMidiFileTest },
{ "midi_state", midiStateTest }, { "midi_state", midiStateTest },
{ "csv", csvTest }, { "csv", csvTest },
{ "sfscore", sfScoreTest }, { "score_test", scoreTest },
{ "sfmatch", sfMatchTest },
{ "sftrack", sfTrackTest },
{ "stub", stubTest }, { "stub", stubTest },
{ nullptr, nullptr } { nullptr, nullptr }
}; };