Browse Source

cmTimeLine.c : durSmpCnt is now set for pedal up/down in _cmTlProcMidiFile().

master
kevin 10 years ago
parent
commit
e581d54cc0
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      app/cmTimeLine.c

+ 4
- 1
app/cmTimeLine.c View File

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));
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
     // count the note-on messages
670
     // count the note-on messages
671
-    if( mp->status == kNoteOnMdId )
671
+    if( cmMidiIsNoteOn(mp->status) )
672
     {
672
     {
673
       durSmpCnt = mp->u.chMsgPtr->durTicks;
673
       durSmpCnt = mp->u.chMsgPtr->durTicks;
674
       ++mfp->noteOnCnt;
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
     // allocate the generic time-line object record
680
     // allocate the generic time-line object record
678
     if((rc = _cmTlAllocRecd2(p, NULL, refOp, begSmpIdx, durSmpCnt, kMidiEvtTlId, mfp->obj.seqId, recdByteCnt, &meop)) != kOkTlRC )
681
     if((rc = _cmTlAllocRecd2(p, NULL, refOp, begSmpIdx, durSmpCnt, kMidiEvtTlId, mfp->obj.seqId, recdByteCnt, &meop)) != kOkTlRC )
679
       goto errLabel;
682
       goto errLabel;

Loading…
Cancel
Save