Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Community created YouTube tutorials, interviews and helpful online information guides.
User avatar
jrronimo
Posts: 77
Joined: Sat Jul 04, 2020 6:03 pm
Has thanked: 26 times
Been thanked: 9 times

Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by jrronimo »

I wrote this up in the ao486 section, but it should be applicable to any core that can use Midilink should work with this. I couldn't find all the answers in one place, so hopefully this will help in the future:

This guide will allow you to set up Munt, the Roland MT-32/CM-32L emulator, on a Windows PC and have a MiSTer core send its data over the network to that computer, which will play MIDI sounds. If your game/program also has sound generated by the Sound Blaster card at the same time, you will need to combine the inputs. For example, you can use the audio out of an HDMI to VGA adapter to the Line In on the computer running Munt, then plug your headphones or speakers into that computer to hear both at the same time.

1. Get Tobias Erichsen's LoopMIDI from here
- Install it and run it.
- Once LoopMIDI opens, click the "+" at the bottom. It should add a line that says "loopMIDI Port"

2. Get bbond007's UDPMIDI.EXE from here -- Windows will complain the file isn't safe or commonly downloaded, but it's fine. Either that or bbond007's got all my credit card information now. 😆
- Run it
- On the line that says MIDI Device, click the dropdown arrow and choose the number that also says "loopMIDI Port"
-- Note: If you run UDPMIDI before LoopMIDI, UDPMIDI won't see the LoopMIDI port.

3. Download and install the Windows version of Munt, here
- Run it
- Select Options -> ROM Configuration and tell Munt where your CM-32L or MT-32 ROMs are.
- Click Tools -> New MIDI port...
- Select the line with "loopMIDI Port"

4. You need to edit the /media/fat/linux/MidiLink.INI file on your MiSTer. I prefer the editor 'nano' for things like this.
- Use PuTTy to SSH in to your MiSTer by putting in its IP address (From the MiSTer Main Menu, press F12, then the left arrow key and it will display your MiSTer's IP)
- Login with root/1
- Use the command: nano /media/fat/linux/MidiLink.INI
- Edit the line that says "UDP_SERVER" to have the IP address of your Windows computer
- Press "CTRL+X" to exit; press 'y' to save changes, then 'enter' to write the changes.

Now, fire up ao486 and change the UART MidiLink: setting to Remote (type is UDP, but that should be default).

Start up Space Quest 3 (or whatever!) and enjoy!
flynnsbit
Posts: 291
Joined: Sun May 24, 2020 8:07 pm
Has thanked: 39 times
Been thanked: 101 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by flynnsbit »

Thank you for this! I had MIDI on my list for this weekend.
User avatar
jrronimo
Posts: 77
Joined: Sat Jul 04, 2020 6:03 pm
Has thanked: 26 times
Been thanked: 9 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by jrronimo »

flynnsbit wrote: Fri Oct 16, 2020 11:45 pm Thank you for this! I had MIDI on my list for this weekend.
Happily! I've always dreamed of having an MT-32, and it took a little longer than I'd hoped to figure this all out, so I'm glad it helped. :D
JonnyTenebrous
Posts: 13
Joined: Tue May 26, 2020 11:27 am
Has thanked: 11 times
Been thanked: 2 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by JonnyTenebrous »

@ jjronimo

Huge thanks for this guide! I've been wandering around down the rabbit hole trying to figure out how to connect up all this stuff for the last few days... and I was already about halfway there, but this just lays it all out clearly. MT-32 emulation on my Windows PC with a great Amp/DAC, feeding some nice Sennheiser headphones, while the MiSTer handles the digital audio and gameplay... it's just amazing! The dream DOS experience!
User avatar
jrronimo
Posts: 77
Joined: Sat Jul 04, 2020 6:03 pm
Has thanked: 26 times
Been thanked: 9 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by jrronimo »

JonnyTenebrous wrote: Sun Nov 15, 2020 12:18 pm @ jjronimo

Huge thanks for this guide! I've been wandering around down the rabbit hole trying to figure out how to connect up all this stuff for the last few days... and I was already about halfway there, but this just lays it all out clearly. MT-32 emulation on my Windows PC with a great Amp/DAC, feeding some nice Sennheiser headphones, while the MiSTer handles the digital audio and gameplay... it's just amazing! The dream DOS experience!
You're most welcome! Glad to hear you're getting all the audio through and it's working great. I'm so happy with the way it sounds. I'd love a real MT-32, but this method is quite a bit cheaper. 🤣
User avatar
Caldor
Posts: 521
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 18 times
Been thanked: 37 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by Caldor »

I decided to make a video showing this.

https://youtu.be/jNTjbjOPMtI
ToothbrushThreepwood
Posts: 44
Joined: Sun May 24, 2020 8:39 pm
Has thanked: 6 times
Been thanked: 13 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by ToothbrushThreepwood »

What would I have to change if I want to run this in a portable setting without wifi/LAN? E.g. running munt on a RPi next to the MiSTer, is there a way to connect MIDI between the two with cables/connectors?
jca
Posts: 604
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 35 times
Been thanked: 115 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by jca »

ToothbrushThreepwood wrote: Sat Dec 12, 2020 5:13 pm What would I have to change if I want to run this in a portable setting without wifi/LAN? E.g. running munt on a RPi next to the MiSTer, is there a way to connect MIDI between the two with cables/connectors?
https://github.com/dwhinham/mt32-pi/wik ... connection
User avatar
jrronimo
Posts: 77
Joined: Sat Jul 04, 2020 6:03 pm
Has thanked: 26 times
Been thanked: 9 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by jrronimo »

ToothbrushThreepwood wrote: Sat Dec 12, 2020 5:13 pm What would I have to change if I want to run this in a portable setting without wifi/LAN? E.g. running munt on a RPi next to the MiSTer, is there a way to connect MIDI between the two with cables/connectors?
You could also do it using a crossover network cable. This would connect the MiSTer's network port directly to the Raspberry Pi's network port. You would need to set up each device with a Static IP. Normally you would use 169.254.xyz.xyz with a subnet mask of 255.255.0.0. xyz can be any number from 1-254.

...but then your MiSTer isn't on your local network for updates or anything.
Shogun
Posts: 32
Joined: Wed Jun 24, 2020 7:41 pm
Has thanked: 8 times
Been thanked: 7 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by Shogun »

I just have to say this is the coolest thing I've seen in a while. I am trying to explain how amazing it is to people that I am sending midi data over wifi and I'm just getting blank looks. Thanks for the guide!
Shogun
Posts: 32
Joined: Wed Jun 24, 2020 7:41 pm
Has thanked: 8 times
Been thanked: 7 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by Shogun »

Well it was neat for a bit but then I woke up one morning and UPMIDI.exe had a red "x" through the window. I was just leaving everything open on my computer so I thought maybe it just crashed but after that happened munt has stopped working. I tried running the tools munt provides to remove and reinstall everything, tried setting everything up again, and rebooting multiple times all to no avail. I don't get what happened it was working fine and then just stopped. I read around and it sounds like others have experienced similar instability with munt.

Screenshot of how everything is configured on my desktop and the ini file (confirmed the IP is correct):

qZGtIn0.png
qZGtIn0.png (318.77 KiB) Viewed 250 times

UART settings in AO486

bHyB4NT.png
bHyB4NT.png (327.74 KiB) Viewed 250 times

If anyone has seen this before or knows of something to try let me know.
bbond007
Posts: 240
Joined: Tue May 26, 2020 5:06 am
Has thanked: 19 times
Been thanked: 49 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by bbond007 »

The UDPMIDI app is not receiving any data, hence "Packets Received = 0"

This would suggest a networking problem, but it could be something else.

If you are using DHCP, Is it possible your IP was updated...

That has happed to me before, so now I use hostname (not IP).

I would first rule out networking problem by logging in via SSH and issuing the command:

Code: Select all

ping 192.168.0.170
ctrl-c to stop

If that is successful, I would suggest starting MidiLink manually via SSH to see if its having some other issue.

Code: Select all

uartmode 0
midilink BAUD 31520 UDP
Ideally (when MIDI is playing) you should see a stream of hex numbers like you are in the matrix

good luck!
Shogun
Posts: 32
Joined: Wed Jun 24, 2020 7:41 pm
Has thanked: 8 times
Been thanked: 7 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by Shogun »

Thanks for that. I was able to ping my IP and I ran the commands and can see the hex streaming. So everything is looking good functionality wise it looks like you said something network related. Is there anything else I can try?

zUQt924.png
zUQt924.png (247.24 KiB) Viewed 249 times

Code: Select all

MIDILINK_PRIORITY   = -20
MUNT_OPTIONS        = 
MP3_VOLUME          = -1
MUNT_VOLUME         = -1
MODEM_VOLUME        = -1
FSYNTH_VOLUME       = -1
MIXER_CONTROL       = Master
MUNT_ROM_PATH       = /media/fat/linux/mt32-rom-data
FSYNTH_SOUNDFONT    = /media/fat/linux/soundfonts/SC-55.sf2
UDP_SERVER          = 192.168.0.170
UDP_SERVER_PORT     = 1999
UDP_SERVER_FILTER   = FALSE
UDP_FLOW            = 0
TCP_SERVER_PORT     = 23
TCP_TERM_UPLOAD     = /media/fat/UPLOAD
TCP_TERM_DOWNLOAD   = /media/fat
TCP_TERM_MP3        = /media/fat/MP3
TCP_TERM_MIDI       = /media/fat/MIDI
TCP_TERM_SYNTH      = FluidSynth
TCP_TERM_ROWS       = 23
TCP_FLOW            = 3
TCP_SOUND           = TRUE
DELAYSYSEX          = TRUE
#USB_SERIAL_MODULE   = /media/fat/pl2303.ko

[AO486]
MIDI_BAUD           = 31250
UDP_BAUD            = 38400
#TCP_SOUND_CONNECT   = /media/fat/SOUNDS/connect_sav.wav
bbond007
Posts: 240
Joined: Tue May 26, 2020 5:06 am
Has thanked: 19 times
Been thanked: 49 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by bbond007 »

Shogun wrote: Thu Sep 23, 2021 7:17 pm Thanks for that. I was able to ping my IP and I ran the commands and can see the hex streaming. So everything is looking good functionality wise it looks like you said something network related. Is there anything else I can try?

That output looks wrong...

You should not be getting USOCK IN messages at all! UDPMIDI.EXE does not send anything.

And I also find it pretty suspicious that the USOCK IN data exactly matches previous USOCK OUT, almost like you have your MiSTer's IP set in the INI (UDP_SERVER) instead of your PC's IP :)

I think your MiSTer may be talking to itself...
Shogun
Posts: 32
Joined: Wed Jun 24, 2020 7:41 pm
Has thanked: 8 times
Been thanked: 7 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by Shogun »

I tell ya its always user error with these guys sheesh. :lol:

Thanks for the help I'm jamming out in full midi now!
bbond007
Posts: 240
Joined: Tue May 26, 2020 5:06 am
Has thanked: 19 times
Been thanked: 49 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by bbond007 »

Shogun wrote: Thu Sep 23, 2021 4:50 pm Well it was neat for a bit but then I woke up one morning and UPMIDI.exe had a red "x" through the window.
Yes, then red "X" is caused usually by minimizing the window, or quite possibly computer lock screen has same effect.

Anyway, I did the original UDPMIDI.EXE in C# which was perhaps a bad choice as the MIDI API is using a lot of older (unmanaged) API's. As a result the code is pretty hacky.

The simpler approach is to redo the app in c/c++, so I have started to do that and have something working now and will make it available soon...
bbond007
Posts: 240
Joined: Tue May 26, 2020 5:06 am
Has thanked: 19 times
Been thanked: 49 times

Re: Guide: Setting up remote MIDI emulation (Midilink, Munt, Windows)

Unread post by bbond007 »

Post Reply