|
@@ -2363,7 +2363,8 @@ void cmScMatcherPrint( cmScMatcher* p )
|
2363
|
2363
|
unsigned esli = 0;
|
2364
|
2364
|
unsigned i,j,k;
|
2365
|
2365
|
|
2366
|
|
- // get first/last scLocIdx from res[]
|
|
2366
|
+ // get first/last scLocIdx from res[] - this is the range of
|
|
2367
|
+ // score events that the score matcher has identified
|
2367
|
2368
|
for(i=0; i<p->ri; ++i)
|
2368
|
2369
|
if( p->res[i].locIdx != cmInvalidIdx )
|
2369
|
2370
|
{
|
|
@@ -2382,15 +2383,16 @@ void cmScMatcherPrint( cmScMatcher* p )
|
2382
|
2383
|
aan += lp->evtCnt;
|
2383
|
2384
|
}
|
2384
|
2385
|
|
2385
|
|
- // allocate an array off 'aan' print records
|
|
2386
|
+ // allocate an array of 'aan' print records
|
2386
|
2387
|
cmScMatcherPrint_t* a = cmMemAllocZ(cmScMatcherPrint_t,aan);
|
2387
|
2388
|
|
2388
|
|
- // fill a[] note and bar events from cmScoreLoc()
|
|
2389
|
+ // fill the cmScMatcherPrint_t array with note and bar events from the score
|
2389
|
2390
|
for(i=bsli; i<=esli; ++i)
|
2390
|
2391
|
{
|
2391
|
2392
|
unsigned scLocIdx = i;
|
2392
|
2393
|
cmScoreLoc_t* lp = cmScoreLoc(p->mp->scH, scLocIdx );
|
2393
|
2394
|
|
|
2395
|
+ // for each score event which occurs at this location
|
2394
|
2396
|
for(j=0; j<lp->evtCnt; ++j)
|
2395
|
2397
|
{
|
2396
|
2398
|
assert( an < aan );
|
|
@@ -2400,6 +2402,7 @@ void cmScMatcherPrint( cmScMatcher* p )
|
2400
|
2402
|
|
2401
|
2403
|
an += 1;
|
2402
|
2404
|
|
|
2405
|
+
|
2403
|
2406
|
switch( ep->type )
|
2404
|
2407
|
{
|
2405
|
2408
|
case kBarEvtScId:
|
|
@@ -2420,6 +2423,12 @@ void cmScMatcherPrint( cmScMatcher* p )
|
2420
|
2423
|
|
2421
|
2424
|
}
|
2422
|
2425
|
|
|
2426
|
+ //
|
|
2427
|
+ // a[an] now contains a record for each note and bar event in the
|
|
2428
|
+ // time range associated with the score matcher's result array.
|
|
2429
|
+ //
|
|
2430
|
+
|
|
2431
|
+
|
2423
|
2432
|
// for each result record
|
2424
|
2433
|
for(i=0; i<p->ri; ++i)
|
2425
|
2434
|
{
|
|
@@ -2428,7 +2437,7 @@ void cmScMatcherPrint( cmScMatcher* p )
|
2428
|
2437
|
// if this result recd matched a score event
|
2429
|
2438
|
if( cmIsFlag(rp->flags,kSmTruePosFl) )
|
2430
|
2439
|
{
|
2431
|
|
- // locate the matching score event
|
|
2440
|
+ // locate the matching score event in a[an]
|
2432
|
2441
|
for(k=0; k<an; ++k)
|
2433
|
2442
|
if( a[k].scLocIdx==p->mp->loc[rp->locIdx].scLocIdx && a[k].pitch==rp->pitch )
|
2434
|
2443
|
{
|
|
@@ -2512,6 +2521,9 @@ void cmScMatcherPrint( cmScMatcher* p )
|
2512
|
2521
|
}
|
2513
|
2522
|
}
|
2514
|
2523
|
|
|
2524
|
+ printf("sloc bar mni ptch flag\n");
|
|
2525
|
+ printf("---- ---- ---- ---- ----\n");
|
|
2526
|
+
|
2515
|
2527
|
for(i=0; i<an; ++i)
|
2516
|
2528
|
{
|
2517
|
2529
|
printf("%4i %4i %4i %4s %c%c%c\n",a[i].scLocIdx,a[i].barNumb,a[i].mni,
|