If you use a MT32 and a SC for DOSBox gaming, then you probably have one MIDI to USB cable and daisy chain the units using MIDI THRU. You mute one device to let the other play.
This trick however is for those with multiple MIDI USB cables. Each roland unit is connected to its own midi/usb cable. In that case you would select the midi device (through Control Panel or a 3rd party tool) before running DOSBox. If you want to save yourself the trouble of manually changing the default midi device everytime you switch games then this is what you do:
First open up a dosbox window and type "
mixer /listmidi". You will get a listing of midi devices. Write down the number next to each one:

In my case I have two USB cables, named "USB Audio device" and "USB Audio device (2)". The first one is attached to my SC unit, the other to my Roland MT32.
Now go and open the CONF file of your favorite DOSBox game with a text editor. Look for a line that says "midiconfig=". Write the number of the midi device you wish to permanently set. For example:
[midi]
mpu401=intelligent
mididevice=default
midiconfig=2
Save and close your CONF file. That's about it. Next time you launch your game DOSBox will automatically connect to the proper Roland unit without you making a trip to Window's Control panel.
NOTE: If you use a front end to run DOSBox, then it is possible the setting is available there. For example, D-Fend Reloaded has a field called "Additional Settings" (under the MIDI section in the profile editor). You type the number for your midi device there and it works the same.
This tip will also work on systems using MIDI cables through their sound card's joystick port, multiple software synths (Yamaha SXGY50, Roland Virtual SC) or any combination.