cwScoreFollower.cpp : The file output from write_sync_perf_csv() now includes the section which each matched event belongs to.

This commit is contained in:
kevin 2024-02-08 11:09:40 -05:00
parent 36496e8b79
commit ab2bb493d1

View File

@ -639,6 +639,7 @@ cw::rc_t cw::score_follower::write_sync_perf_csv( handle_t h, const char* out_fn
if( midi::isNoteOn(m->status,d1) ) if( midi::isNoteOn(m->status,d1) )
{ {
unsigned bar = 0; unsigned bar = 0;
const char* sectionLabel = "";
unsigned loc = score_parse::kInvalidLocId; unsigned loc = score_parse::kInvalidLocId;
unsigned dlevel = -1; unsigned dlevel = -1;
char sciPitch[ midi::kMidiSciPitchCharCnt + 1 ]; char sciPitch[ midi::kMidiSciPitchCharCnt + 1 ];
@ -665,6 +666,7 @@ cw::rc_t cw::score_follower::write_sync_perf_csv( handle_t h, const char* out_fn
} }
bar = e->barNumb; bar = e->barNumb;
sectionLabel = e->section != nullptr ? e->section->label : "";
curBarNumb = std::max(bar,curBarNumb); curBarNumb = std::max(bar,curBarNumb);
dlevel = e->dynLevel; dlevel = e->dynLevel;
loc = resultA[i].oLocId == kInvalidId ? score_parse::kInvalidLocId : resultA[i].oLocId; loc = resultA[i].oLocId == kInvalidId ? score_parse::kInvalidLocId : resultA[i].oLocId;
@ -674,8 +676,8 @@ cw::rc_t cw::score_follower::write_sync_perf_csv( handle_t h, const char* out_fn
rc = file::printf(fH, "%i,%i,%i,%i,0,%f,0.0,0.0,0,%s,,%i,%i,%i,%i,,,,,%i,%i,%i\n", rc = file::printf(fH, "%i,%i,%i,%i,0,%f,0.0,0.0,0,%s,,%i,%i,%i,%i,,%s,,,%i,%i,%i\n",
bar,i,1,loc,secs,sciPitch,dlevel,m->status,d0,d1,dampPedalDownFl,softPedalDownFl,sostPedalDownFl); bar,i,1,loc,secs,sciPitch,dlevel,m->status,d0,d1,sectionLabel,dampPedalDownFl,softPedalDownFl,sostPedalDownFl);
} }
else else
{ {