IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
foo_midi and MUNT issue, MUNT just sounds wrong
Nahkranoth
post Dec 13 2012, 16:21
Post #1





Group: Members
Posts: 60
Joined: 12-March 08
Member No.: 51973



I guess it's a question to kode54 biggrin.gif

It sounds wrong compared to MUNT in DOSBox-SVN-Daum or the commandline encoder here.

I have all the needed ROMs ant the path is set up correctly.

MIDI file for comparison is here.




Any clues?

Go to the top of the page
+Quote Post
kode54
post Dec 14 2012, 01:39
Post #2





Group: Admin
Posts: 4231
Joined: 15-December 02
Member No.: 4082



Your MIDI file does not contain any MT-32 System Exclusive messages. There is the problem right there.

My version of MUNT is modified with enhancements. In enhanced mode, it supports playing back up to 256 voices worth of polyphony, and mapping a virtual set of extended channels to the 7 MIDI channels not already mapped to normal MT-32 channels.

Any MIDI file detected as a particular system type by its System Exclusive messages will display a $info(midi_type) variable, visible in the Properties tab of the file's Properties dialog as MIDI_TYPE. In the case of MT-32 files, detected by one or more MT-32 System Exclusive messages, this variable will be set to "MT-32".

foo_midi will automatically use MUNT in basic 9 channel 32 polyphony mode if a file has midi_type = "MT-32", regardless of whatever MIDI output mode you have set in preferences. So you don't need to select MUNT specifically if you're playing any MT-32 files. It's enough to add a MT-32 reset message at the start of the file, and/or insert any requisite SYX dump's messages.

If you play MIDI files which are not detected as MT-32 with MUNT selected as the driver, it will initialize MUNT in the 16 channel extended mode, and pre-upload a General MIDI emulation instrument set. I designed this specifically for supporting a retro feel with normal MIDI files, as well as also providing a GM mode which requires a minimal amount of download and disk space.

So, for future reference, any MT-32 MIDI files you wish to play with foo_midi should have the bare minimum of an MT-32 reset message at the start, and you won't need to select MUNT as the MIDI synthesizer for it to be able to play them.

EDIT: I have added a notice about this to the components information page for foo_midi.
Go to the top of the page
+Quote Post
Nahkranoth
post Dec 14 2012, 10:28
Post #3





Group: Members
Posts: 60
Joined: 12-March 08
Member No.: 51973



QUOTE (kode54)
foo_midi will automatically use MUNT in basic 9 channel 32 polyphony mode if a file has midi_type = "MT-32", regardless of whatever MIDI output mode you have set in preferences. So you don't need to select MUNT specifically if you're playing any MT-32 files. It's enough to add a MT-32 reset message at the start of the file, and/or insert any requisite SYX dump's messages.

Thanks, it wasn't obvious.

As I've got it the problem was that those midi files were written especially for MT-32, though in GM format blink.gif . Only your version of MUNT played it differently so it was confusing.

Now I'll get a bunch of proper MT-32 midis to test.
Go to the top of the page
+Quote Post
kode54
post Dec 14 2012, 21:27
Post #4





Group: Admin
Posts: 4231
Joined: 15-December 02
Member No.: 4082



You can easily fix those MIDI files. All you need to do is use a MIDI sequence editor to insert a MT-32 reset message. For simplicity, I suggest using mf2t to convert them to text files, then insert the reset command into the first track, then convert back to MIDI. Well, at least that step won't require a complete MIDI sequencer, and it won't mess with the files in any other way than changes you make to the text files.

I have since renamed the MUNT mode in preferences, and added a notice that regular MT-32 emulation will be used automatically on detected files.

EDIT: If you have downloaded mf2tsrc.zip before now, I suggest redownloading it. I have fixed some serious errors in the original code that prevented it from compiling on modern systems, and also broke reading variable length events, such as meta and System Exclusive messages.

Anyway, outlining the process of fixing that file:

1) Convert <file.mid> to text:
CODE
mf2t file.mid > file.mid.txt


2) Open file.mid.txt in your preferred text editor.

3) Insert an LA Reset message with timestamp 0 after the first MTrk line, maybe after the Tempo command:
CODE
0 Sysex f0 41 10 16 12 7f 00 00 00 01 f7


4) Save the result.

5) Convert it back over the original MIDI file:
CODE
t2mf file.mid.txt > file.mid


And you're done.

This post has been edited by kode54: Dec 16 2012, 01:53
Go to the top of the page
+Quote Post
Nahkranoth
post Dec 18 2012, 01:45
Post #5





Group: Members
Posts: 60
Joined: 12-March 08
Member No.: 51973



Thanks for clarification, made myself a sticky with your answer biggrin.gif Will try to convert those bastards to real MT-32.
Go to the top of the page
+Quote Post
kode54
post Dec 18 2012, 02:20
Post #6





Group: Admin
Posts: 4231
Joined: 15-December 02
Member No.: 4082



It would also help for a real MT-32, since then your player won't need to know to reset the device between files. Adding any SYX dumps to the individual files also helps, although if you're going to play them on an actual device, you'll need to bump up the delay before the song starts and add a small delay between each part of the dump. There is no such requirement for MUNT.
Go to the top of the page
+Quote Post
Nahkranoth
post Dec 20 2012, 15:55
Post #7





Group: Members
Posts: 60
Joined: 12-March 08
Member No.: 51973



Tried many times but still can't compile mf2t (I'm definitely not skilled in this). Downloaded mf2tXP, which works but the midi it produces (with sysex chunk) can't be opened. Could you provide a compiled binary?
Go to the top of the page
+Quote Post
kode54
post Dec 21 2012, 22:08
Post #8





Group: Admin
Posts: 4231
Joined: 15-December 02
Member No.: 4082



Here you go.

The syntax supports output file names as well:

mf2t in.mid out.txt
t2mf in.txt out.mid
Go to the top of the page
+Quote Post
Nahkranoth
post Dec 22 2012, 12:38
Post #9





Group: Members
Posts: 60
Joined: 12-March 08
Member No.: 51973



Thanks, now everything works like it should! beer.gif
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th June 2013 - 11:32