Browse Source

cmMidiFilePlay.c : Updates to use amicro instead of dtick in MIDI msg.

master
kevin 9 years ago
parent
commit
136cb97800
1 changed files with 4 additions and 16 deletions
  1. 4
    16
      cmMidiFilePlay.c

+ 4
- 16
cmMidiFilePlay.c View File

148
   p->mtime      = 0;
148
   p->mtime      = 0;
149
   p->closeFileFl= false;
149
   p->closeFileFl= false;
150
 
150
 
151
-  //if( p->msgIdx > 0 )
152
-  //  p->mtime = p->msgV[0]->tick * p->microsPerTick;
153
-
154
   return kOkMfpRC;
151
   return kOkMfpRC;
155
 }
152
 }
156
 
153
 
213
   // sent and the end of the time window for this mfpClock() cycle
210
   // sent and the end of the time window for this mfpClock() cycle
214
   p->etime += dusecs;
211
   p->etime += dusecs;
215
 
212
 
216
-  //printf("init e:%i d:%i\n",p->etime, p->mtime);
217
-
218
   // if the elapsed time (etime) since the last msg is greater or equal
213
   // if the elapsed time (etime) since the last msg is greater or equal
219
   // to the delta time to the next msg (mtime)
214
   // to the delta time to the next msg (mtime)
220
   while( p->etime >= p->mtime )
215
   while( p->etime >= p->mtime )
221
   {      
216
   {      
222
-    //printf("e:%i d:%i\n",p->etime, p->mtime);
223
 
217
 
224
-    if( mp->status == kMetaStId && mp->metaId == kTempoMdId )
225
-      _cmMfpUpdateMicrosPerTick(p,mp->u.iVal );
226
-    
227
-    
218
+    // send the current message
228
     p->cbFunc( p->userCbPtr, p->mtime, mp );
219
     p->cbFunc( p->userCbPtr, p->mtime, mp );
229
 
220
 
230
-    unsigned atick0 = mp->atick;
221
+    unsigned amicro = mp->amicro;
231
     
222
     
232
     ++(p->msgIdx);
223
     ++(p->msgIdx);
233
 
224
 
235
       break;
226
       break;
236
 
227
 
237
     // get the next msg to send
228
     // get the next msg to send
238
-    mp        = p->msgV[p->msgIdx];
229
+    mp   = p->msgV[p->msgIdx];
239
 
230
 
240
-    assert( mp->atick >= atick0 );
241
-    unsigned dtick = mp->atick - atick0;
242
 
231
 
243
     // we probably went past the actual mtime - so update etime
232
     // we probably went past the actual mtime - so update etime
244
     // with the delta usecs from the msg just sent and the current time
233
     // with the delta usecs from the msg just sent and the current time
245
     p->etime -= p->mtime;
234
     p->etime -= p->mtime;
246
 
235
 
247
     // calc the delta usecs from the message just sent to the next msg to send
236
     // calc the delta usecs from the message just sent to the next msg to send
248
-    //p->mtime  = (mp->tick - p->msgV[p->msgIdx-1]->tick) * p->microsPerTick;
249
-    p->mtime  = dtick * p->microsPerTick;
237
+    p->mtime  = mp->amicro - amicro;
250
 
238
 
251
   }
239
   }
252
 
240
 

Loading…
Cancel
Save