MIDI at the wrong tempo (BPM) in sequencer?

Discuss modding questions and implementation details.
Post Reply
miyalys
Posts: 5
Joined: Sat May 23, 2020 4:14 pm

MIDI at the wrong tempo (BPM) in sequencer?

Post by miyalys »

Hi!

Has anyone else experienced that when they import the Daggerfall music into a sequencer, it's in the wrong BPM?
This effectively means that it plays back at the right speed, but it doesn't align to the grid of the sequencers at all.
Maybe it's just my MIDI files specifically I wonder?
If not does anyone have a good solution, preferably sequencer agnostic, like a third party tool, python script or something?

I imagine I'm not the first to run into this, and maybe the issue is the same in some other games using MIDI too.

If this isn't the correct sub forum feel free to move it.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: MIDI at the wrong tempo (BPM) in sequencer?

Post by BadLuckBurt »

I think what you're looking for is quantization. Most MIDI sequencers can do that for you. It will not sound the same though.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
pango
Posts: 3357
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: MIDI at the wrong tempo (BPM) in sequencer?

Post by pango »

Yeah they're all 1605631 microseconds per quarter note (or 37.37 BPM) and 192 PPQN.
Tracks are stored in a different format in game (HMI), so I suspect some info was lost in translation (either it's in HMI format and was not translated, or HMI only contains absolute timing and the info is not present to start with)
I wonder if people working on music remasters have fixed versions?
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

miyalys
Posts: 5
Joined: Sat May 23, 2020 4:14 pm

Re: MIDI at the wrong tempo (BPM) in sequencer?

Post by miyalys »

Thanks for chiming in!

The ones I've imported had BPM at 120, maybe that's what the combination of microseconds per quarter node and PPQ turn into?
Just slowly starting to learn about MIDI tempo as well.

I'm also beginning to think it might be related to either the HMI files themselves not having tempo,
or the conversion to MIDI not including it.

Some info I gathered:

HMI files for daggerfall can be found here:
http://www.vgmpf.com/Wiki/index.php?tit ... fall_(DOS)

...and it seems there are several tools for playing them back or converting them:
- MIDI Processing (used for playback in foobar as well): https://github.com/kode54/midi_processing
- WinRipper: https://en.uesp.net/wiki/Daggerfall:Files
- HMI2MID: http://www.ttdpatch.net/midi/games.html
- HMI2MID (in Rust): https://gitlab.com/spearman/hmi2mid-rs
- PlayHMI: http://web.archive.org/web/200502051532 ... nloads.asp
...and possibly WildMIDI, where they also talk a bit about the format: https://github.com/Mindwerks/wildmidi/issues/75
...and there's also info about the format in the comments here: https://github.com/Xenoveritas/abuse/bl ... rt/hmi.cpp
...another converter- midiplex - which also seems to have XMI support based on looking at the source: https://github.com/stascorp/MIDIPLEX/
...another converter - scanxmi: https://sourceforge.net/projects/midi-c ... i-to-midi/

Wish I was better at hex editors to get an idea where the tempo is handled.

Good info:
https://moddingwiki.shikadi.net/wiki/XMI_Format
https://forum.zdoom.org/viewtopic.php?f=7&t=32004

Spec for XMI / Miles Sound System can be found here(!!!):
http://www.thegleam.com/ke5fx/misc/AIL2.ZIP

I've only done one music remaster so far, but yes maybe those having done many would've had them!
On the other hand for those who don't change much besides which instruments are used it's not that important.

Even just a list of BPM's for all songs could be convenient, as then I imagine it wouldn't be too hard to fix in the MIDI's directly.
Last edited by miyalys on Wed Dec 28, 2022 1:04 am, edited 4 times in total.

User avatar
pango
Posts: 3357
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: MIDI at the wrong tempo (BPM) in sequencer?

Post by pango »

For completeness, some player reverse-engineering attempt: https://github.com/nukeykt/HMIPlay
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

Post Reply