|
@@ -2433,13 +2433,8 @@ cmScRC_t cmScoreFileFromMidi( cmCtx_t* ctx, const cmChar_t* midiFn, const c
|
2433
|
2433
|
goto errLabel;
|
2434
|
2434
|
}
|
2435
|
2435
|
|
2436
|
|
- printf("secs:%f smps:%f\n",cmMidiFileDurSecs(mfH),cmMidiFileDurSecs(mfH)*96000);
|
|
2436
|
+ //printf("secs:%f smps:%f\n",cmMidiFileDurSecs(mfH),cmMidiFileDurSecs(mfH)*96000);
|
2437
|
2437
|
|
2438
|
|
-
|
2439
|
|
- // Convert the track message 'dtick' field to delta-microseconds.
|
2440
|
|
- cmMidiFileTickToMicros(mfH);
|
2441
|
|
-
|
2442
|
|
-
|
2443
|
2438
|
unsigned msgCnt = cmMidiFileMsgCount(mfH);
|
2444
|
2439
|
unsigned i;
|
2445
|
2440
|
const cmMidiTrackMsg_t** tmpp = cmMidiFileMsgArray(mfH);
|
|
@@ -2474,7 +2469,7 @@ cmScRC_t cmScoreFileFromMidi( cmCtx_t* ctx, const cmChar_t* midiFn, const c
|
2474
|
2469
|
unsigned d0 = 0;
|
2475
|
2470
|
unsigned d1 = 0;
|
2476
|
2471
|
unsigned metaId = 0;
|
2477
|
|
- double dsecs = (double)tmp->dtick / 1000000.0;
|
|
2472
|
+ double dsecs = (double)tmp->amicro / 1000000.0;
|
2478
|
2473
|
|
2479
|
2474
|
acc_secs += dsecs;
|
2480
|
2475
|
|
|
@@ -2666,10 +2661,6 @@ void cmScoreFix( cmCtx_t* ctx )
|
2666
|
2661
|
if( cmMidiFileOpen(mfn,&mfH,ctx) != kOkMfRC )
|
2667
|
2662
|
goto errLabel;
|
2668
|
2663
|
|
2669
|
|
- cmMidiFileTickToMicros(mfH);
|
2670
|
|
-
|
2671
|
|
- cmMidiFileCalcNoteDurations(mfH);
|
2672
|
|
-
|
2673
|
2664
|
mn = cmMidiFileMsgCount(mfH);
|
2674
|
2665
|
|
2675
|
2666
|
msg = cmMidiFileMsgArray(mfH);
|
|
@@ -2699,7 +2690,7 @@ void cmScoreFix( cmCtx_t* ctx )
|
2699
|
2690
|
const cmMidiTrackMsg_t* m = msg[mi];
|
2700
|
2691
|
|
2701
|
2692
|
assert( mi+1 <= id );
|
2702
|
|
- secs += m->dtick/1000000.0;
|
|
2693
|
+ secs += m->amicro/1000000.0;
|
2703
|
2694
|
|
2704
|
2695
|
if( mi+1 != id )
|
2705
|
2696
|
{
|
|
@@ -2715,7 +2706,7 @@ void cmScoreFix( cmCtx_t* ctx )
|
2715
|
2706
|
++mi;
|
2716
|
2707
|
|
2717
|
2708
|
if( m->status == kNoteOnMdId )
|
2718
|
|
- cmCsvSetCellDouble( csvH, ci, kDSecsColScIdx, m->u.chMsgPtr->durTicks/1000000.0 );
|
|
2709
|
+ cmCsvSetCellDouble( csvH, ci, kDSecsColScIdx, m->u.chMsgPtr->durMicros /1000000.0 );
|
2719
|
2710
|
break;
|
2720
|
2711
|
}
|
2721
|
2712
|
|