# SDL\_mixer: native\_midi\_mint: convert block times with uMIDI

**URL:** <https://discourse.libsdl.org/t/sdl-mixer-native-midi-mint-convert-block-times-with-umidi/69592>\
**Category:** SDL Commits\
**Created:** [October 18, 2026, 10:47am UTC](https://discourse.libsdl.org/t/sdl-mixer-native-midi-mint-convert-block-times-with-umidi/69592 "2026-10-18T10:47:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [October 18, 2026, 10:47am UTC](https://discourse.libsdl.org/t/sdl-mixer-native-midi-mint-convert-block-times-with-umidi/69592/1 "2026-10-18T10:47:11Z")

</div>

> <https://github.com/libsdl-org/SDL_mixer/commit/d0ced428604ee4e645e5a8813b3022cd20519d72>

```diff
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;

```
