Ver código fonte

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

master
kevin 10 anos atrás
pai
commit
e581d54cc0
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4
    1
      app/cmTimeLine.c

+ 4
- 1
app/cmTimeLine.c Ver arquivo

@@ -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;

Carregando…
Cancelar
Salvar