|
@@ -668,12 +668,15 @@ cmTlRC_t _cmTlProcMidiFile( _cmTl_t* p, _cmTlObj_t* op, cmMidiFileH_t mfH )
|
668
|
668
|
// printf("%s: bsi:%9i acc:%f smp acc:%f min %s\n", mp->status == kNoteOnMdId?"non":" ", begSmpIdx, accum, accum / (p->srate * 60),cmStringNullGuard(mfp->obj.name));
|
669
|
669
|
|
670
|
670
|
// count the note-on messages
|
671
|
|
- if( mp->status == kNoteOnMdId )
|
|
671
|
+ if( cmMidiIsNoteOn(mp->status) )
|
672
|
672
|
{
|
673
|
673
|
durSmpCnt = mp->u.chMsgPtr->durTicks;
|
674
|
674
|
++mfp->noteOnCnt;
|
675
|
675
|
}
|
676
|
676
|
|
|
677
|
+ if( cmMidiIsCtl(mp->status) && cmMidiIsSustainPedal(mp->status,mp->u.chMsgPtr->d0) )
|
|
678
|
+ durSmpCnt = mp->u.chMsgPtr->durTicks;
|
|
679
|
+
|
677
|
680
|
// allocate the generic time-line object record
|
678
|
681
|
if((rc = _cmTlAllocRecd2(p, NULL, refOp, begSmpIdx, durSmpCnt, kMidiEvtTlId, mfp->obj.seqId, recdByteCnt, &meop)) != kOkTlRC )
|
679
|
682
|
goto errLabel;
|