|
|
@ -1225,18 +1225,20 @@ This is not unlike multiway merging used for tape sorting algoritms in the 50's! |
|
|
|
unsigned long long temp; |
|
|
|
unsigned long long temp; |
|
|
|
temp = ((unsigned long long) delta_time * tempo) / ticks_per_beat; |
|
|
|
temp = ((unsigned long long) delta_time * tempo) / ticks_per_beat; |
|
|
|
delta_msec = temp / 1000; // get around LCC compiler bug
|
|
|
|
delta_msec = temp / 1000; // get around LCC compiler bug
|
|
|
|
if (loggen) |
|
|
|
if (delta_msec) { |
|
|
|
fprintf (logfile, "->Delay %ld msec (%ld ticks)\n", delta_msec, delta_time); |
|
|
|
if (loggen) |
|
|
|
if (delta_msec > 0x7fff) |
|
|
|
fprintf (logfile, "->Delay %ld msec (%ld ticks)\n", delta_msec, delta_time); |
|
|
|
midi_error ("INTERNAL: time delta too big", trk->trkptr); |
|
|
|
if (delta_msec > 0x7fff) |
|
|
|
/* output a 15-bit delay in big-endian format */ |
|
|
|
midi_error ("INTERNAL: time delta too big", trk->trkptr); |
|
|
|
if (binaryoutput) { |
|
|
|
/* output a 15-bit delay in big-endian format */ |
|
|
|
putc ((unsigned char) (delta_msec >> 8), outfile); |
|
|
|
if (binaryoutput) { |
|
|
|
putc ((unsigned char) (delta_msec & 0xff), outfile); |
|
|
|
putc ((unsigned char) (delta_msec >> 8), outfile); |
|
|
|
outfile_bytecount += 2; |
|
|
|
putc ((unsigned char) (delta_msec & 0xff), outfile); |
|
|
|
} else { |
|
|
|
outfile_bytecount += 2; |
|
|
|
fprintf (outfile, "%ld,%ld, ", delta_msec >> 8, delta_msec & 0xff); |
|
|
|
} else { |
|
|
|
outfile_items (2); |
|
|
|
fprintf (outfile, "%ld,%ld, ", delta_msec >> 8, delta_msec & 0xff); |
|
|
|
|
|
|
|
outfile_items (2); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
timenow = earliest_time; |
|
|
|
timenow = earliest_time; |
|
|
|