From e581d54cc0e1642688d85c9cad35afa9c0ce7caf Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 17 Mar 2014 10:05:20 -0700 Subject: [PATCH] cmTimeLine.c : durSmpCnt is now set for pedal up/down in _cmTlProcMidiFile(). --- app/cmTimeLine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/cmTimeLine.c b/app/cmTimeLine.c index 2b920f0..35e2008 100644 --- a/app/cmTimeLine.c +++ b/app/cmTimeLine.c @@ -668,12 +668,15 @@ cmTlRC_t _cmTlProcMidiFile( _cmTl_t* p, _cmTlObj_t* op, cmMidiFileH_t mfH ) // 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)); // count the note-on messages - if( mp->status == kNoteOnMdId ) + if( cmMidiIsNoteOn(mp->status) ) { durSmpCnt = mp->u.chMsgPtr->durTicks; ++mfp->noteOnCnt; } + if( cmMidiIsCtl(mp->status) && cmMidiIsSustainPedal(mp->status,mp->u.chMsgPtr->d0) ) + durSmpCnt = mp->u.chMsgPtr->durTicks; + // allocate the generic time-line object record if((rc = _cmTlAllocRecd2(p, NULL, refOp, begSmpIdx, durSmpCnt, kMidiEvtTlId, mfp->obj.seqId, recdByteCnt, &meop)) != kOkTlRC ) goto errLabel;