diff --git a/src/cwtest/cfg/main.cfg b/src/cwtest/cfg/main.cfg index bbf89a7..814b5e8 100644 --- a/src/cwtest/cfg/main.cfg +++ b/src/cwtest/cfg/main.cfg @@ -1831,10 +1831,11 @@ score_follow: { srate: 48000, - out_dir: "~/temp/score_follow_test", + out_dir: "~/temp/score_follow_test_1", pre_test_fl: true, show_muid_fl: false, + score_report_fl: false, // each of these files will be written to the dir: / out_svg_fname: "sf_results.html", @@ -1842,9 +1843,36 @@ out_midi_csv_fname: "midi.csv", 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, 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. @@ -1857,7 +1885,7 @@ { label: shiau_uen_5, - enable_fl: false, + enable_fl: true, start_loc: 327, midi_fname: "~/temp/shiau_uen/record_5/midi.mid", @@ -1870,7 +1898,7 @@ }, { label: shiau_uen_11, - enable_fl: true, + enable_fl: false, start_loc: 5361, midi_fname: "~/temp/shiau_uen/record_11/midi.mid", }, @@ -1946,139 +1974,89 @@ // titleL: [] }, - sfscore: { - //cm_score_fname: "~/src/cwtest/src/cwtest/cfg/gutim_full/cm_score.csv", - cm_score_fname: "/home/kevin/src/currawong/projects/score_proc/score_out.csv" + score_test: { + score_fname: "/home/kevin/src/currawong/projects/score_proc/temp.csv" srate: 48000, - - 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 - } - } - - sfmatch: { - gen_perf_example: - { - enable_fl: false, - beg_loc_idx: 0, - 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 - 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 - } + parse_fl: true, // do score parsing + parse_report_fl: false, // report parse + score_fl: true , // do sfscore processing + score_report_fl: false, // report sfscore + match_fl: true, // score match test + track_fl: true, // score track test - perf: [ - { muid:0 smpIdx:0 pitch:65 vel:44 }, - { muid:1 smpIdx:3600 pitch:63 vel:64 }, - { muid:2 smpIdx:7200 pitch:45 vel:64 }, - { muid:3 smpIdx:10800 pitch:30 vel:64 }, - { muid:4 smpIdx:14400 pitch:37 vel:64 }, - { muid:5 smpIdx:18000 pitch:65 vel:112 }, - { muid:6 smpIdx:21600 pitch:87 vel:100 }, - { muid:7 smpIdx:21600 pitch:36 vel:88 }, - { muid:8 smpIdx:21600 pitch:46 vel:30 }, - { muid:9 smpIdx:193028 pitch:85 vel:30 }, - { muid:10 smpIdx:330171 pitch:100 vel:88 }, - { muid:11 smpIdx:638742 pitch:80 vel:100 }, + dyn_ref: [ + { mark: "silent", level:0, vel:1 }, + { mark:"pppp-", level:1, vel:3 }, + { mark:"pppp", level:2, vel:5 }, + { mark:"pppp+", level:3, vel:7 }, + { mark:"ppp-", level:4, vel:10 }, + { mark:"ppp", level:5, vel:15 }, + { mark:"ppp+", level:6, vel:20 }, + { mark:"pp-", level:7, vel:25 }, + { mark:"pp", level:8, vel:30 }, + { mark:"pp+", level:9, vel:35 }, + { mark:"p-", level:10,vel:40 }, + { mark:"p", level:11,vel:45 }, + { mark:"p+", level:12, vel:50 }, + { mark:"mp-", level:13, vel:55 }, + { mark:"mp", level:14, vel:60 }, + { 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: { - sftrack: { + gen_perf_example: + { + enable_fl: false, + beg_loc_idx: 0, + 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 - maxMidiWndN:7, // max counf of the performance (MIDI) alignment window + maxScWndN: 10, // max size of the score alignment window + maxMidiWndN: 7, // max counf of the performance (MIDI) alignment window - report_midi_file_fl: false, - report_score_fl: false, - report_track_fl: true + perf: [ + { muid:0 smpIdx:0 pitch:65 vel:44 }, + { muid:1 smpIdx:3600 pitch:63 vel:64 }, + { muid:2 smpIdx:7200 pitch:45 vel:64 }, + { muid:3 smpIdx:10800 pitch:30 vel:64 }, + { muid:4 smpIdx:14400 pitch:37 vel:64 }, + { muid:5 smpIdx:18000 pitch:65 vel:112 }, + { muid:6 smpIdx:21600 pitch:87 vel:100 }, + { muid:7 smpIdx:21600 pitch:36 vel:88 }, + { muid:8 smpIdx:21600 pitch:46 vel:30 }, + { muid:9 smpIdx:193028 pitch:85 vel:30 }, + { muid:10 smpIdx:330171 pitch:100 vel:88 }, + { muid:11 smpIdx:638742 pitch:80 vel:100 }, + ] + + }, + + sftrack: { + maxScWndN: 10, // max size of the score 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 - } + report_midi_file_fl: false, + report_track_fl: true, - perf:{ - enable_fl:true, - loc_idx: 120, - midi_fname:"/home/kevin/temp/shiau_uen/record_5/midi.mid" - + perf:{ + enable_fl:true, + loc_idx: 120, + midi_fname:"/home/kevin/temp/shiau_uen/record_5/midi.mid" + } } } - } diff --git a/src/cwtest/main.cpp b/src/cwtest/main.cpp index 6670fb6..4fa8f0d 100644 --- a/src/cwtest/main.cpp +++ b/src/cwtest/main.cpp @@ -30,7 +30,17 @@ #include "cwFlow.h" #include "cwPianoScore.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 "cwScoreFollower.h" #include "cwCsv.h" @@ -42,13 +52,8 @@ #include "cwUiTest.h" #endif -#include "cwTime.h" -#include "cwMidi.h" #include "cwMidiFile.h" #include "cwAudioDevice.h" -#include "cwSfScore.h" -#include "cwSfMatch.h" -#include "cwSfTrack.h" #if(cwALSA) #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 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 sfScoreTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::sfscore::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); } +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); } #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); } @@ -801,9 +804,7 @@ int main( int argc, const char* argv[] ) { "svg_midi_file", svgMidiFileTest }, { "midi_state", midiStateTest }, { "csv", csvTest }, - { "sfscore", sfScoreTest }, - { "sfmatch", sfMatchTest }, - { "sftrack", sfTrackTest }, + { "score_test", scoreTest }, { "stub", stubTest }, { nullptr, nullptr } };