VOGONS

Common searches


First post, by johnbear

User metadata
Rank Newbie
Rank
Newbie

Howdy,

I was looking for a way to get soundfonts working in OS X 10.6 Snow Leopard DosBox, and came across a thread here on Vogons about configuring FluidSynth to get soundfont MIDI music in DosBox games. After some further playing around, I found another way (actually, two ways) to get DosBox using soundfonts that doesn't involve FluidSynth, which looked a bit messy to me (I'm lazy!).

There's a free OS X app called SynthTest, that's designed to be a quick and easy way to load a software synthesizer and effect for test purposes. You can download it here:

http://www.manyetas.com/creed/synthtest.html

First you need to make sure the IAC (inter-application connection) MIDI driver is configured in OS X, you only need to do this once:

1. Run Audio MIDI Setup (/Applications/Utilities/Audio MIDI Setup)
2. Window > Show MIDI Window
3. Double-click on IAC Driver
4. Make sure the box is ticked for "Device is online"
5. If there is nothing listed in the "Ports" section, click the + button to add some bus ports
6. Close Audio MIDI Setup

Next, you'll need to configure your DosBox session to direct MIDI to the first MIDI output device configured in OS X. Again, you should only have to do this once:

1. Edit your DosBox .conf file
2. If it doesn't exist, add a section called [midi]
3. Add a line to the MIDI section (or change it if it already exists) that says "mididevice=coremidi" (without the quotes)
4. Add a line to the MIDI section (or change it if it already exists) that says "midiconfig=0" (without the quotes). The 0 is the MIDI device number configured in OS X - if you only have the IAC driver enabled, this will be 0; if you have other MIDI devices connected to your system, this number might be different - experiment!

Finally, we set up SynthTest to listen on the IAC bus for MIDI data, and get it to pass the data to OS X's built in soundfont player, DLSMusicDevice:

1. Run SynthTest
2. From the MIDI Source list at the top, pick "IAC Driver: <bus name>" (bus name is whatever was listed in "Ports" in Audio MIDI Setup, for me it was called "Bus 1")
3. In the Synthesizer section, select Apple > DLSMusicDevice
4. In the Synthesizer section, click the "Edit" button to show DLSMusicDevice's parameters. Here you can choose the soundfont ("Sound Bank"), as well as set a few other options. If you want to add soundfonts to the list, store the files in ~/Library/Audio/Sounds/Banks.
5. In the Effect section of SynthTest, tick the "Bypass Effect" box to get the dry output from the DLSMusicDevice; or if you like, you can play around with adding reverb and so on be leaving this unticked and choosing an effect from the "Select Effect" list 😀
6. Finally, up at the top press the play button - SynthTest will now be listening for MIDI data on the IAC bus, and will pass it to the Apple provided soundfont player (DLSMusicDevice).

That's it! Run your game, make sure it's configured to use general MIDI output and you should be good to go!

If you don't want to use SynthTest, you can achieve the same effect using only Apple provided software that comes with your Mac. If you install the developer tools (Xcode) that came on your OS X disc, you'll get an application installed in /Developer/Applications/Audio called AU Lab. AU Lab is a more powerful (and slightly less friendly) version of SynthTest, and is designed to help developers test software synthesizers that they might be developing. Here's how to set AU Lab up to achieve the same thing:

1. Follow the steps above for configuring Audio MIDI Setup and DosBox
2. Run AU Lab
3. When the "Document Configuration" window appears, select the "Stereo Out" factory configuration
4. In the "Input Settings" section, select "None" as your "Audio Input Device"
5. Click "Create Document", and the main AU Lab window appears.
6. Click Edit > Add Audio Unit Instrument
7. For "MIDI Input Source" select "IAC Driver <bus name>", and for "Instrument" select Apple > DLSMusicDevice, then click OK
8. In the main AU Lab window, you should see a new column has appeared in the workspace, and you might have gotten a little pop-up window called "Stereo Mix: DLSMusicDevice" or something similar. If not, click on the little piano-keyboard icon on the new column in the main AU Lab window.
9. In the little pop-up window, you can choose your soundfont from the "Sound Bank" drop down list
10. In the blue bar at the very top of the pop-up window, at the right hand side, there's a drop down list that says "Apple's D...evice View" or something similar. Click this and choose "MIDI Editor"
11. The pop-up window will change to show what MIDI events are being listened to. By default, only MIDI channel 1 is being received, so click and hold down on the first "Channels" box (1) and drag to the right until all 16 boxes turn dark grey

That's it! Run your game and AU Lab will be providing the MIDI output using your chosen soundfont. I did notice some problems with stuck notes in Rise Of The Triad when using AU Lab that I didn't get with SynthTest, so your mileage may vary - but at least you can have DOS games + soundfonts using only software included with your Mac 😀

One plus point in AU Lab's favour is that you can save your configuration (including the specific soundfont you picked) to a file, and then opening the file in the future will do all of the above for you automatically, so you can literally be up and running in seconds with no messing about.

I hope this info was useful to someone!

Cheers,

John

Reply 1 of 6, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Hmm, there is a simple patch in the tracker that aklows using a soundfont via coreaudio directly 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 3 of 6, by johnbear

User metadata
Rank Newbie
Rank
Newbie

Howdy,

True, but the way I worked out for myself doesn't involve compiling anything, can be used with official releases of DosBox, and can be extended to any other application that can be configured to output MIDI to CoreAudio.

Different strokes for different folks, I guess!

John

Reply 4 of 6, by JCZorkmid

User metadata
Rank Newbie
Rank
Newbie

Sorry John! I didn't mean to imply there wasn't value in what you did. I tried to do something similar, but never got to to work reliably enough, so good job figuring it out.

In the end looked into patching DOSBox, which turned out to be pretty simple. I also submitted the same (or a very similar) patch to a few other projects, where it was accepted. I'm hopeful this will end up in DOSBox someday, at which point it'll be straightforward to use SoundFonts in OS X, but until then I agree that it's nice to have a way to do it now without recompiling.

JasonPenney.NET

Reply 6 of 6, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Yes, sorry, same for me, didn't meant your how to was unappreciated.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper