Home Page
Posted By: Firehawke MAME Midi - 06/11/15 07:07 AM
Did a bit of digging, but didn't really find the documentation I need for this. Hopefully I didn't just miss something really obvious (and if I did, it's fodder for the MAME FAQ at least, right?)

How exactly does MAME's MIDI output work? How can I direct it to a Windows MIDI device so that I can have a MT-32 hooked up to my virtual machine?

I've been looking at this in QMC2 and I've got a Sound Blaster hooked up and a midi port attached as a result, but I'm not sure what to do next.
Posted By: R. Belmont Re: MAME Midi - 06/11/15 10:44 AM
On the command line, -listmidi shows available MIDI I/O ports on your machine. You then -midiout "name of port that's connected to the MT-32".

Not sure if QMC2 actually supports that properly or not - it's definitely a special case compared to normal slot devices.
Posted By: qmc2 Re: MAME Midi - 06/11/15 10:50 AM
Is "-midiout" documented somewhere smile? So no, QMC2 doesn't support this (yet).

EDIT: oh, if it's a slot-device it should work.
Posted By: R. Belmont Re: MAME Midi - 06/11/15 10:58 AM
When MIDI is available, it will appear in -listslots. For instance, "mame64 at486 -isa5 mpu401" will then have this in -listslots:

Code:
isa5:mpu401:mpu401:mdin   midiin          MIDI In port
isa5:mpu401:mpu401:mdout   midiout         MIDI Out port


The special case is that you have to parse the -listmidi output to get the actual values they accept, you can only determine their presence with -listslots. For instance, on my Linux machine:

Code:
MIDI input ports:
Midi Through Port-0 
KeyStudio MIDI 1 (default)

MIDI output ports:
Midi Through Port-0 (default)
M-Audio MIDI Out A
M-Audio MIDI Out B


The two listed under "input ports" are available for -midiin, and the "output ports" work with -midiout. Note that you must include the full name as listed, with the shortcut that the port listed as (default) can also be named as just "default".
Posted By: qmc2 Re: MAME Midi - 06/11/15 11:00 AM
OK, as I said in my edit, if it's a slot device it should work... but QMC2 doesn't use "-listmidi" to suggest actual MIDI output devices (yet).
Posted By: R. Belmont Re: MAME Midi - 06/11/15 11:01 AM
Ok. It's valid for there to be no MIDI devices of a type, so be careful parsing smile
Posted By: qmc2 Re: MAME Midi - 06/11/15 11:38 AM
I get this on my system:

Code:
MIDI input ports:
Midi Through Port-0 (default)

MIDI output ports:
Midi Through Port-0 (default)

Does this mean "Midi Through Port-0" is a valid string for "midiin" and "midiout" in my case?

If I understand your last post correctly you're saying that the output after "MIDI input ports:" and/or "MIDI output ports:" could also be empty? Right?
Posted By: R. Belmont Re: MAME Midi - 06/11/15 11:48 AM
Correct and correct. That Through port is a virtual pipe provided by ALSA.
Posted By: qmc2 Re: MAME Midi - 06/11/15 04:06 PM
Thank you! QMC2 SVN r6730 should support this now (despite possible bugs).
Posted By: qmc2 Re: MAME Midi - 06/12/15 05:29 PM
I wanted to test my implementation, and this is the command line QMC2 generates when I map the two MIDI interfaces to the midiin/midiout devices (which should be fine):

Code:
mame64 <...> at486 -isa5 mpu401 -midiin "Midi Through Port-0" -midiout "Midi Through Port-0"

I'm unable to test this, though, because MAME reports a missing ROM:

Code:
roland_6801v0b55p.bin NOT FOUND (tried in at486 ibm5170 mpu401)

However, the isa_mpu401 device doesn't have any ROMs:

Code:
<machine name="isa_mpu401" sourcefile="src/emu/bus/isa/mpu401.c" isdevice="yes" runnable="no">
  <description>Roland MPU-401 MIDI Interface</description>
  <chip type="cpu" tag=":mpu401:mpu6801" name="M6801" clock="4000000"/>
  <slot name=":mpu401:mdin">
    <slotoption name="midiin" devname="midiin_port" default="yes"/>
  </slot>
  <slot name=":mpu401:mdout">
    <slotoption name="midiout" devname="midiout_port" default="yes"/>
  </slot>
</machine>

Maybe I'm missing something, but how can it be expecting this ROM then?
Posted By: qmc2 Re: MAME Midi - 06/12/15 05:45 PM
Oh, even weirder... when I run -listxml on "at486 -isa5 mpu401" I get a second device/machine called just "mpu401", and THIS one wants the Roland ROM smile :

Code:
rene@thunder:~/src/mame-git> ./mame64 at486 -isa5 mpu401 -listxml
        ...
        <machine name="isa_mpu401" sourcefile="src/emu/bus/isa/mpu401.c" isdevice="yes" runnable="no">
                <description>Roland MPU-401 MIDI Interface</description>
                <chip type="cpu" tag=":mpu401:mpu6801" name="M6801" clock="4000000"/>
                <device type="midiin" tag=":mpu401:mdin:midiin:midiinimg">
                        <instance name="midiin" briefname="min"/>
                        <extension name="mid"/>
                </device>
                <device type="midiout" tag=":mpu401:mdout:midiout:midioutimg">
                        <instance name="midiout" briefname="mout"/>
                        <extension name="mid"/>
                </device>
                <slot name=":mpu401:mdin">
                        <slotoption name="midiin" devname="midiin_port" default="yes"/>
                </slot>
                <slot name=":mpu401:mdout">
                        <slotoption name="midiout" devname="midiout_port" default="yes"/>
                </slot>
        </machine>
        <machine name="mpu401" sourcefile="src/emu/machine/mpu401.c" isdevice="yes" runnable="no">
                <description>Roland MPU-401 I/O box</description>
                <rom name="roland_6801v0b55p.bin" size="4096" crc="65d3a151" sha1="00efbfb96aeb997b69bb16981c6751d3c784bb87" region="mpurom" offset="0"/>
                <chip type="cpu" tag=":mpu6801" name="M6801" clock="4000000"/>
                <device type="midiin" tag=":mdin:midiin:midiinimg">
                        <instance name="midiin" briefname="min"/>
                        <extension name="mid"/>
                </device>
                <device type="midiout" tag=":mdout:midiout:midioutimg">
                        <instance name="midiout" briefname="mout"/>
                        <extension name="mid"/>
                </device>
                <slot name=":mdin">
                        <slotoption name="midiin" devname="midiin_port" default="yes"/>
                </slot>
                <slot name=":mdout">
                        <slotoption name="midiout" devname="midiout_port" default="yes"/>
                </slot>
        </machine>
        ...

That looks like a bug to me, but I may be wrong... but the fact that the "mpu401" device isn't listed in -listxml (just the "isa_mpu401" w/o ROMs) makes it "hard to guess" (for any ROM manager) wink.
Posted By: R. Belmont Re: MAME Midi - 06/12/15 06:26 PM
That's correct, the "mpu401" device is the MPU-401 external box where the brains are, and the ISA card just interfaces it to the PC. In real life, the external box also worked with interfaces to the Apple II, C64, PC-98, and several other things. (All of those interfaces are unobtainium, although the MPU-401 technical manual helpfully describes how the Apple II version is wired).

Because the mpu401 device only appears as the child of a slot device, I assume that causes some issue with -listxml.
Posted By: qmc2 Re: MAME Midi - 06/12/15 06:35 PM
OK, thanks for the explanation.
Posted By: Lord Nightmare Re: MAME Midi - 06/12/15 08:23 PM
R.Belmont: There's also the Roland MPU-IPC-T card which integrated the 'MPU401' Module (with final version ?1.5A? firmware) and the isa card on a somewhat larger ISA card.
http://upload.wikimedia.org/wikipedia/commons/0/0b/Roland_mpu-ipc-t.jpg
If MESS emulated that I guess it would be roms loaded directly by the ISA card rather than a sub-device.

LN
Posted By: qmc2 Re: MAME Midi - 06/13/15 06:19 AM
Anyway, I still think the mpu401 should be listed in the "normal" -listxml output even though it's a "pure child" device... if possible smile.
Posted By: Firehawke Re: MAME Midi - 06/13/15 07:21 AM
Just wanted to thank you for the info while I can. I'm having some weird routing issues to this site that make it inaccessible from my home connection right now (constant timeouts) so I haven't been able to sit down and read everything to my satisfaction yet. Hope to do so soon.
Posted By: qmc2 Re: MAME Midi - 06/13/15 07:27 AM
Yeah, I had that once (last year) for about 2 months... I had to use an "open proxy" for this site only, but then suddenly it worked again. I have no idea what was causing it, and I've heard of more users suffering the same problem temporarily.
Posted By: Olivier Galibert Re: MAME Midi - 06/13/15 09:56 AM
Originally Posted By qmc2
Anyway, I still think the mpu401 should be listed in the "normal" -listxml output even though it's a "pure child" device... if possible smile.


There's no list of all devices in the source, afaict, which makes listing them all impossible. Something we may have to think about, but not entirely trivial to fix, if at all possible.

It shows if you do: mame at486 -isa5 mpu401 -listxml

OG.
Posted By: qmc2 Re: MAME Midi - 06/13/15 02:18 PM
Well, I know that it shows up this way (see my post on the top of this page), but that doesn't help a ROM manager because how should it know about that, or any other possible permutations? Thanks for considering this!
Posted By: R. Belmont Re: MAME Midi - 06/13/15 02:23 PM
Yeah, OG just repeated what I'd already said smile

ETA: I just noticed that as a side-effect of this, none of the relevant ROM sites or torrents have this ROM, so nobody was able to use the MPU-401. Whoops.
Posted By: qmc2 Re: MAME Midi - 06/13/15 02:47 PM
Originally Posted By R. Belmont
ETA: I just noticed that as a side-effect of this, none of the relevant ROM sites or torrents have this ROM, so nobody was able to use the MPU-401. Whoops.

The situation just changed on one of the sites at least smile...
Posted By: Olivier Galibert Re: MAME Midi - 06/13/15 04:22 PM
It may be possible to hack some kind of linked list through the device creator template... I need to find what I broken in robowres though.

OG.
Posted By: R. Belmont Re: MAME Midi - 06/13/15 06:59 PM
Yeah, it's not high priority, but obviously having a required ROM for a peripheral go unnoticed by CMP is not ideal.
Posted By: etabeta78 Re: MAME Midi - 06/15/15 05:10 AM
the reported problem has been worked around in current git tree.
unfortunately, the problem might resurface if e.g. a slot option enables a sub-slot option where one of the devices has a rom that is not used anywhere else... which is not happening at the moment and I hope it will never happen :-)

however, the issue is complex: current MAME core is heavily hierarchical, with the "central" machine requiring a driver to be attached as root_device, and then as many slot devices as you like that can be connected creating a (virtually) infinite tree of possible configuration. since a listing command as -lx cannot walk through the whole tree, it currently tries to be "creative" and simulate attaching each device to a driver and giving the corresponding output for both the attached device and its subdevices. It does not walk further down, though. I think no clean solution is really possible, until we impose a "machine neutrality" system that allows devices to be attached to the main machine without intermediate steps.

such advancement would also allow to clean up a few small inconsistencies of the -lx output for some devices across different releases: devices like disk controller can be configured differently in different systems, and thus their available slots or the format they support for loading depend on the system you are parsing. This is absolutely fine when you invoke "mame system -lx", but it's less pleasant in "mame -lx" because each device is output only at its first occurrence and thus you only detect the configuration of its first appearance (and this might change across releases when new drivers are added).
Posted By: Olivier Galibert Re: MAME Midi - 06/15/15 06:43 AM
Originally Posted By etabeta78
devices like disk controller can be configured differently in different systems, and thus their available slots or the format they support for loading depend on the system you are parsing.


Really? There are machine_config_fragments that are not constant?

I'd have thought that if (big if) we had a linked list of all possible devices, we could dump their complete config including what can be connected to them, making all the information available in one xml...

OG.
Posted By: qmc2 Re: MAME Midi - 06/15/15 07:31 AM
Thanks, etabeta78!

One issue is left though: mpu401 doesn't show up on -verifyroms even if it's in the ROM path. So probably a similar change is required for -verifyroms?
Posted By: etabeta78 Re: MAME Midi - 06/15/15 07:42 AM
to both replies: I have to dig a bit more into the code, and then I'll reply smile
© Forums