MIDI (.mid) files

About PR usage and development, and about the POP format.

Moderator: English Moderator Team

Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3082
Joined: April 9th, 2009, 10:58 pm
Contact:

MIDI (.mid) files

Post by Norbert » September 8th, 2012, 4:11 pm

[Edit: Changed my post.]

I've been trying to replace the MIDI files, but most of them either don't play, are too long, or sound different outside the game.
It seems that PoP1 (v1.0) only accepts type 0 MIDI files.
This program can convert type 1 and 2 files to type 0 files:
http://www.blitter.com/~russtopia/MIDI/ ... ditype.exe
It requires:
http://www.blitter.com/~russtopia/MIDI/ ... difile.exe

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3082
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: MIDI (.mid) files

Post by Norbert » September 9th, 2012, 2:39 pm

A lot of the MIDI files I'm trying out sound warped inside the game.
An octave lower or something, or with different instruments.
Not sure what exactly the problem is.

programmer, how did you get the MIDI files to work in your mods?
Did you create the MIDI files yourself, or did you edit them in some way?

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3082
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: MIDI (.mid) files

Post by Norbert » September 16th, 2012, 3:01 pm

[This was a reply to a post that forum user "programmer" has since removed.]

Interesting, and you did a pretty good job.
I think that maybe PR isn't 100% properly exporting/importing MIDI files, and that that's making it so difficult to create custom tunes.

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: MIDI (.mid) files

Post by elmaton » November 8th, 2015, 2:53 pm

Hey guys, hallo Norbert,

Just tried to replace the "meet JAffar Theme, which is Midi File with a length of 5 seconds.
Like I always do, I experimented a little bit just replaced it with an other midi file which was 1minute 32 seconds long.

I entered Jaffars room and the whole song played since i killed jaffar, what was pretty cool :D

BUT it wouldn't be me if there wasn't a problem. ;)
As I tried to replace the original "meet Jaffar" Theme with a midi which is also 5 seconds long, No TUNE is played as I entered Jaffars Room. :(

Why is that?
Sometimes things seem to easy to be true.
Thanks

User avatar
doppelganger
Vizier
Vizier
Posts: 113
Joined: April 24th, 2015, 9:04 am
Location: India

Re: MIDI (.mid) files

Post by doppelganger » November 8th, 2015, 4:23 pm

I think the game can only play CERTAIN types of MIDI files. Your second MIDI file, I think, does not come under the 'certain type'.

Please note this is just what I THINK is the cause. Maybe this is not the reason why your second file did not work.
Doppelgänger
Hmm.. These mortals know about me.. :evil:

Download 'Hell of A Palace' now from Popot!

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3082
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: MIDI (.mid) files

Post by Norbert » November 8th, 2015, 5:01 pm

doppelganger wrote:I think the game can only play CERTAIN types of MIDI files.
Yes, I think so too.

By the way, I've merged the two MIDI related forum threads.

elmaton
Sheikh
Sheikh
Posts: 26
Joined: October 6th, 2015, 7:52 am

Re: MIDI (.mid) files

Post by elmaton » November 8th, 2015, 6:40 pm

Ok Guys thanks. For support, but how can I find out which type of midi file I'm working with. Tried to figure out a difference but didn't find one.
:(

David
The Prince of Persia
The Prince of Persia
Posts: 1447
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MIDI (.mid) files

Post by David » November 15th, 2015, 3:18 pm

elmaton wrote:but how can I find out which type of midi file I'm working with
You could try the programs linked in the first post.

User avatar
musa
Vizier
Vizier
Posts: 111
Joined: March 27th, 2011, 2:06 pm
Location: Nairobi, Kenya

Re: MIDI (.mid) files

Post by musa » December 20th, 2015, 5:32 pm

I've discovered a funny thing in the MIDIs of PoP1 v1.0 and the other versions. The v1.0 MIDIs are in type 1 format but the others are in type 0 format. My theory as to why that is: the track 0 of v1.0 MIDIs contain sysex in track 0, presumably to specify how long the song lasts, though if you use a type 0 MIDI the game will play it the same length as the real MIDI. Probably when MT-32 support was added they made the MIDIs type 0 because they needed to use the sysex to configure the instruments.
-- Michael, the boy who makes Shaw's Nightmare.
Visit here to download Shaw's Nightmare: http://shawsnightmare.ucoz.com

User avatar
kj-5349
Vizier
Vizier
Posts: 115
Joined: January 26th, 2010, 11:43 am

Re: MIDI (.mid) files

Post by kj-5349 » January 20th, 2017, 9:33 pm

Been trying out the steps in the first post by Norbert and it works!
It's unfortunate that in v1.0 the sounds are distorted and totally different from the original midi.

However if by using v1.3, the music is fairly better - in Setup you need to set Roland MT-32 for Music Synthesizer. Using SoundBlaster is still distorted unfortunately. Do take note the game would start a little slower due to some Roland loading time...
Not sure yet about v1.4 but it may just be the same.
With this, it's inspired me for a new mod like KX out of time, all of Musa's mods and Jakim's A Place of Despair :D

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3082
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: MIDI (.mid) files

Post by Norbert » January 21st, 2017, 12:50 am

kj-5349 wrote:Been trying out the steps in the first post [...]
A good alternative nowadays is to use either SDLPoP (OGG files in data/music/) or MININIM (OGG files in data/audio/).
More options to mod and also easier to mod. :)

User avatar
kj-5349
Vizier
Vizier
Posts: 115
Joined: January 26th, 2010, 11:43 am

Re: MIDI (.mid) files

Post by kj-5349 » January 24th, 2017, 10:57 am

Thanks Norbert.
Perhaps I would try these out in the future as for now I'm accustomed to the DOS version :)

Btw would the midi sounds be the same when converted to OGG form and not warped like in Dosbox soundblaster?

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3082
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: MIDI (.mid) files

Post by Norbert » January 24th, 2017, 1:22 pm

kj-5349 wrote:Btw would the midi sounds be the same when converted to OGG form and not warped like in Dosbox soundblaster?
It depends on how you convert to OGG. For instance, if you record straight from (digital) audio output, then the OGG is as you hear the music. Which, in turn, means the soundfont (e.g. Freepats) you pick influences the result. If only PoP1 1.3 set to Roland plays the MIDI files exactly as you want to hear them, then you could record and convert PoP1 output. That is: record with DOSBox to AVI, extract audio from the AVI to WAV,(*) use Audacity to cut the WAV to just what you need, then convert the WAV to OGG.(**)

(*) vlc in.avi --no-video --sout '#transcode{acodec=fl32}:std{mux=wav,access=file,dst=out.wav}' -vvv
(**) oggenc -q 10 -o out.ogg in.wav

David
The Prince of Persia
The Prince of Persia
Posts: 1447
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: MIDI (.mid) files

Post by David » January 28th, 2017, 4:33 pm

Norbert wrote:That is: record with DOSBox to AVI, extract audio from the AVI to WAV,(*)
DOSBox has a command to record sound only, so you don't have to make an intermediate AVI:
http://www.dosbox.com/wiki/Special_Keys wrote: CTRL-F6 Start/Stop recording sound output to a wave file (goes to capture folder).

Post Reply