cmProc4.h/c : Added comments.

This commit is contained in:
Kevin Larke 2016-04-23 16:29:14 -04:00
parent 3a236648d3
commit c44a890088
2 changed files with 14 additions and 7 deletions

View File

@ -27,6 +27,7 @@
#include "cmScore.h" #include "cmScore.h"
#include "cmProc4.h" #include "cmProc4.h"
//======================================================================================================================= //=======================================================================================================================
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void ed_print_mtx( ed_r* r) void ed_print_mtx( ed_r* r)
@ -1412,6 +1413,7 @@ unsigned cmScMatcherScan( cmScMatcher* p, unsigned bli, unsigned hopCnt )
if( i_opt == cmInvalidIdx ) if( i_opt == cmInvalidIdx )
return cmInvalidIdx; return cmInvalidIdx;
// set the locIdx field in midiBuf[], trailing miss count and // set the locIdx field in midiBuf[], trailing miss count and
// return the latest positive-match locIdx // return the latest positive-match locIdx
p->eli = cmScMatchDoSync(p->mp,i_opt,p->midiBuf,p->mp->mmn,&p->missCnt); p->eli = cmScMatchDoSync(p->mp,i_opt,p->midiBuf,p->mp->mmn,&p->missCnt);
@ -1430,7 +1432,6 @@ unsigned cmScMatcherScan( cmScMatcher* p, unsigned bli, unsigned hopCnt )
} }
return i_opt; return i_opt;
} }
cmRC_t cmScMatcherStep( cmScMatcher* p ) cmRC_t cmScMatcherStep( cmScMatcher* p )
@ -1913,21 +1914,27 @@ cmRC_t cmScMeasInit( cmScMeas* p, cmScH_t scH, double srate, const unsigned*
return rc; return rc;
// assign set[].bli and set[].eli // assign set[].bli and set[].eli
// for each measurment set
for(j=0; j<p->sn; ++j) for(j=0; j<p->sn; ++j)
{ {
cmScMeasSet_t* msp = p->set + j; cmScMeasSet_t* msp = p->set + j;
// for each score location
for(i=0; i<p->mp->locN; ++i) for(i=0; i<p->mp->locN; ++i)
{ {
// if this set starts on this score location
if( msp->bli==cmInvalidIdx && msp->bsli==p->mp->loc[i].scLocIdx ) if( msp->bli==cmInvalidIdx && msp->bsli==p->mp->loc[i].scLocIdx )
msp->bli = i; msp->bli = i; // store the index of the score location
// if this set end on this score location
if( msp->esli==p->mp->loc[i].scLocIdx ) if( msp->esli==p->mp->loc[i].scLocIdx )
msp->eli = i; msp->eli = i; // store the index of the score location
} }
assert( msp->eli > msp->bli ); assert( msp->eli > msp->bli );
// track the longest set.
maxScWndN = cmMax( maxScWndN, msp->eli - msp->bli + 1 ); maxScWndN = cmMax( maxScWndN, msp->eli - msp->bli + 1 );
} }

View File

@ -328,8 +328,8 @@ extern "C" {
unsigned bsli; // beg score loc index unsigned bsli; // beg score loc index
unsigned esli; // end score loc index unsigned esli; // end score loc index
unsigned bli; // unsigned bli; // index into the cmScMatch.loc[] array of bsli
unsigned eli; // unsigned eli; // index into the cmScMatch.loc[] array of esli
double value; // DBL_MAX if the value has not yet been set double value; // DBL_MAX if the value has not yet been set
double tempo; // double tempo; //