Browse Source

cmMidiFile.c : Remove offset at beginning of each MIDI file by default.

master
kevin 8 years ago
parent
commit
9088a7bb22
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      cmMidiFile.c

+ 9
- 1
cmMidiFile.c View File

@@ -430,6 +430,7 @@ void _cmMidiFileSetAccumulateTicks( _cmMidiFile_t* p )
430 430
   cmMidiTrackMsg_t* nextTrkMsg[ p->trkN ]; // next msg in each track
431 431
   unsigned long long atick = 0;
432 432
   unsigned          i;
433
+  bool              fl = true;
433 434
   
434 435
   // iniitalize nextTrkTick[] and nextTrkMsg[].
435 436
   for(i=0; i<p->trkN; ++i)
@@ -449,6 +450,13 @@ void _cmMidiFileSetAccumulateTicks( _cmMidiFile_t* p )
449 450
     if( k == cmInvalidIdx )
450 451
       break;
451 452
 
453
+    if( fl && nextTrkMsg[k]->dtick > 0 )
454
+    {
455
+      fl = false;
456
+      nextTrkMsg[k]->dtick = 1;
457
+      nextTrkMsg[k]->atick = 1;
458
+    }
459
+
452 460
     // store the current atick
453 461
     atick = nextTrkMsg[k]->atick;
454 462
 
@@ -1243,7 +1251,7 @@ void cmMidiFileCalcNoteDurations( cmMidiFileH_t h )
1243 1251
         if( sustainPedalDownMsg != NULL )
1244 1252
         {
1245 1253
           // TODO:  the correct way to handle this is to maintain multiple sustain pedals 
1246
-          cmErrMsg(&p->err,kSustainPedalMfRC,"Sustain pedal down with no intervening sustain pedal up.");
1254
+          //cmErrMsg(&p->err,kSustainPedalMfRC,"Sustain pedal down with no intervening sustain pedal up.");
1247 1255
         }
1248 1256
         else
1249 1257
         {

Loading…
Cancel
Save