From d0ced428604ee4e645e5a8813b3022cd20519d72 Mon Sep 17 00:00:00 2001
From: Miro Kropacek <[EMAIL REDACTED]>
Date: Sat, 17 Oct 2026 10:41:59 +1000
Subject: [PATCH] native_midi_mint: convert block times with uMIDI
---
native_midi/native_midi_mint.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/native_midi/native_midi_mint.c b/native_midi/native_midi_mint.c
index d5f53505..6d869d2f 100644
--- a/native_midi/native_midi_mint.c
+++ b/native_midi/native_midi_mint.c
@@ -46,13 +46,6 @@ static int umidi_volume(int volume)
return volume * UMIDI_MAX_VOLUME / MIX_MAX_VOLUME;
}
-/* microseconds to uMIDI's timer periods, rounded up */
-static Uint32 umidi_periods(Uint32 us)
-{
- return us / 1000000 * UMIDI_TIMER_HZ
- + (us % 1000000 * UMIDI_TIMER_HZ + 999999) / 1000000;
-}
-
/* Builds the blocks of a song from the event list: channel messages only,
* their tick times turned into microseconds with the tempo changes applied.
* An empty block at the time of the last event (end of track) keeps the
@@ -145,7 +138,7 @@ static int convert_events(UMidiSong *song, const MIDIEvent *events, Uint16 divis
}
for (i = 0; i < numBlocks; i++)
- blocks[i].time = umidi_periods(blocks[i].time);
+ blocks[i].time = UMidiPeriods(blocks[i].time);
song->blocks = blocks;
song->data = data;