diff --git a/cmProc4.c b/cmProc4.c index c570ce8..2b31ac7 100644 --- a/cmProc4.c +++ b/cmProc4.c @@ -2363,7 +2363,8 @@ void cmScMatcherPrint( cmScMatcher* p ) unsigned esli = 0; unsigned i,j,k; - // get first/last scLocIdx from res[] + // get first/last scLocIdx from res[] - this is the range of + // score events that the score matcher has identified for(i=0; iri; ++i) if( p->res[i].locIdx != cmInvalidIdx ) { @@ -2382,15 +2383,16 @@ void cmScMatcherPrint( cmScMatcher* p ) aan += lp->evtCnt; } - // allocate an array off 'aan' print records + // allocate an array of 'aan' print records cmScMatcherPrint_t* a = cmMemAllocZ(cmScMatcherPrint_t,aan); - // fill a[] note and bar events from cmScoreLoc() + // fill the cmScMatcherPrint_t array with note and bar events from the score for(i=bsli; i<=esli; ++i) { unsigned scLocIdx = i; cmScoreLoc_t* lp = cmScoreLoc(p->mp->scH, scLocIdx ); + // for each score event which occurs at this location for(j=0; jevtCnt; ++j) { assert( an < aan ); @@ -2400,6 +2402,7 @@ void cmScMatcherPrint( cmScMatcher* p ) an += 1; + switch( ep->type ) { case kBarEvtScId: @@ -2420,6 +2423,12 @@ void cmScMatcherPrint( cmScMatcher* p ) } + // + // a[an] now contains a record for each note and bar event in the + // time range associated with the score matcher's result array. + // + + // for each result record for(i=0; iri; ++i) { @@ -2428,7 +2437,7 @@ void cmScMatcherPrint( cmScMatcher* p ) // if this result recd matched a score event if( cmIsFlag(rp->flags,kSmTruePosFl) ) { - // locate the matching score event + // locate the matching score event in a[an] for(k=0; kmp->loc[rp->locIdx].scLocIdx && a[k].pitch==rp->pitch ) { @@ -2512,6 +2521,9 @@ void cmScMatcherPrint( cmScMatcher* p ) } } + printf("sloc bar mni ptch flag\n"); + printf("---- ---- ---- ---- ----\n"); + for(i=0; imp->loc[]) looking for the best match to p->midiBuf[]. + // index into p->mp->loc[]) looking for the best match to p->midiBuf[]. // The score window contain scWndN (p->mp->mcn-1) score locations. // Returns the index into p->mp->loc[] of the start of the best // match score window. The score associated