Making Old DOS Games Sound Better in DOSBox-X with Shan SGM-Pro V5 SoundFont

Old DOS games are already great, but let us be honest, MIDI music can sound very rough if it is played through the default Windows MIDI synthesizer. Some games still sound okay, but many of them lose a lot of character because the instruments sound thin, cheap, or just plain boring.

This is where SoundFonts come in.

A MIDI file does not actually contain recorded music like an MP3. It is more like a set of instructions. It tells the computer which notes to play, which instruments to use, how loud they are, and when they should start or stop. The final sound depends on the synthesizer and instrument bank used to play those instructions.

A SoundFont is basically an instrument bank, usually in .sf2 or .sf3 format. It gives the MIDI synthesizer better instrument samples to work with. So instead of your DOS game music sounding like basic Windows MIDI, it can sound fuller, clearer, and more dramatic.

For this setup, I used Shan SGM-Pro V40 SoundFont. It is based around the SGM-style General MIDI sound, which is popular among retro PC gaming users because it gives many DOS game soundtracks a bigger and more modern sound. More information about Shan SGM-Pro can be found at the VOGONS thread here:

Shan SGM-Pro SoundFont on VOGONS

Why Use DOSBox-X with FluidSynth

DOSBox-X already supports MIDI configuration properly, and it can use FluidSynth to play MIDI through a SoundFont. This is cleaner than routing MIDI into another external program.

The basic idea is simple:

  1. Put the SoundFont file somewhere permanent.
  2. Tell DOSBox-X to use FluidSynth.
  3. Point DOSBox-X to the .sf2 file.
  4. Configure the old DOS game to use General MIDI, Roland Sound Canvas, or MPU-401, depending on what the game supports.

For my setup, I placed the SoundFont here:

/home/mypapit/midi/shan.sf2

You can use another folder if you want. Just make sure the path in the DOSBox-X config matches the actual file location.

DOSBox-X MIDI Configuration

# fluid.soundfont: Soundfont (.SF2 or .SF3) to use with Fluidsynth.
#                  One must be specified, for example GeneralUser_GS.sf2.

mpu401          = intelligent
mpubase         = 330
mididevice      = fluidsynth
midiconfig      =
samplerate      = 48000
mpuirq          = -1
mt32.romdir     =
mt32.model      = auto

fluid.driver    = pulseaudio
fluid.soundfont = "/home/mypapit/midi/shan.sf2"
fluid.reverb    = 20
fluid.chorus    = 16

Game Setup

After changing the DOSBox-X config, you still need to configure the DOS game itself.

In the game sound setup program, choose something like:

Music device: General MIDI
Port: 330
IRQ: 9 or default

Some games may show it as:

Roland MPU-401
Sound Canvas
General MIDI

For many DOS games from the 1990s, General MIDI is the correct choice. Examples include games like Doom, Duke Nukem 3D, Descent, Warcraft II, TIE Fighter, and many LucasArts titles.

Do not choose MT-32 unless the game soundtrack was actually made for MT-32. MT-32 and General MIDI are not the same thing. If you choose the wrong one, the music can sound strange, with incorrect instruments.

TIE-FIGHTER DEMO with SHAN SGM-PRO SoundFont

TIE Fighter is a good game to test this because its MIDI soundtrack benefits a lot from a stronger SoundFont. The music becomes more cinematic and less flat compared to the default Windows MIDI output.

Here is a YouTube video showing TIE Fighter using the Shan SGM-Pro SoundFont:

Star Wars: TIE Fighter with Shan SGM-Pro SoundFont

The difference is clear. The brass, strings, and percussion sound much heavier. It does not sound like original hardware, but that is not the goal here. The goal is to make old DOS MIDI music sound better, fuller, and more enjoyable on a modern machine.

Notes:

Keep the SoundFont file in a fixed folder. Do not put it in a temporary download folder because DOSBox-X will fail to load it if the file is moved.

Use a full path in the config file, especially on Windows.

Restart DOSBox-X after editing the config.

Make sure the game itself is configured for General MIDI or MPU-401 music output.

If there is no music, check the file path first. Most problems come from a wrong SoundFont path or a typo in the filename.

yt-dlp – a verstatile video downloader tool

yt-dlp is a command-line tool for which allows a user to download audio/video from thousands of sites. The project is a fork of youtube-dl, which is based on the now inactive youtube-dlc.

yt-dlp can be installed using official releases or via package manager.

Unix-like operating system

curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp
chmod a+rx ~/.local/bin/yt-dlp  # Make executable

To update yt-dlp in Unix-like operating system

yt-dlp -U

Homebrew MacOS

brew install yt-dlp

Ubuntu

sudo add-apt-repository ppa:tomtomtom/yt-dlp # Add ppa repo to apt
sudo apt update # Update package list
sudo apt install yt-dlp # Install yt-dlp

Snap

sudo snap install --edge yt-dlp

Windows operating system

yt-dlp is also available for Windows operating system by using, winget:

winget install yt-dlp

Microsoft Windows binary package

The binary package for Microsoft Windows binary package can be downloaded from yt-dlp GitHub release page

Note that yt-dlp requires ffmpeg windows binaries which can be obtained from gyan.dev’s Codex FFMPEG Build

Please refer to this post for more information on the tips and tricks on using yt-dlp.

Semi-automatic bash script for triggering NVIDIA GPU fan in Linux

https://gist.github.com/mypapit/01770a1fa47826db1f50caf45f6a9035.js

Hello everybody. I’m sharing a handy script I use to semi-automatically check my GPU temperature and turn on the fan if things get a bit too warm.

I run this on my dedicated SoHo PC server, which hosts a modest LLM and a Minecraft server (yes, both at the same time).

Feel free to drop any suggestions or ideas in the comments. I’d love to hear how you’d improve it!

p/s: I’ve used GWE and CoolerControl, but it doesn’t fit my use case.

Install Tensorflow with RTX 50 series GPU acceleration with Python wheel for Ubuntu 24.04 (and Windows WSL2)

It seems that the Tensorflow acceleration is broken with the latest RTX50 series GPU, especially with the most cost effective RTX5060Ti 16GB card.

This is a guide to install Tensorflow with RTX50 (Blackwell) card GPU acceleration with the python wheel.

First you need to download this python wheel. It is compiled for Ubuntu 24.04 or WSL2 with Ubuntu 24.04.

https://github.com/mypapit/tensorflowRTX50/releases

Then you may need to create a python virtual environment for the wheel.

sudo apt install python3-pip
sudo apt install python3-venv

# replace tensorflow220 with your preferred env name
python3 -m venv tensorflow220

Then you need to activate the environment.

source tensorflow220/bin/activate

Then you may install the tensorflow wheel. To make it easier, you can also install it alongside other requirements.

pip install tensorflow-2.20.0dev0+selfbuild-cp312-cp312-linux_x86_64.whl seaborn pandas matplotlib opencv-python pillow imutils pydot graphviz librosa

Then, you must install CUDA 12.8.1 and CUDNN 9.8.0, please refer to these links:

Follow the instructions on the NVIDIA websites to install both cuda-12.8.1 and CUDNN 9.8.0

Install Nvidia Linux Driver (not required for WSL2)

Then you must install the latest NVIDIA Linux driver.

At the time of the writing, the latest driver is 570.169 (June 17, 2025)

The NVIDIA Linux driver is not required for Ubuntu 24.04 under WSL2. For that, you need to install Microsoft Windows NVIDIA driver available from NVIDIA App.

About the python wheel file:

The python wheel file is compiled in Ubuntu 24.04 with llvm and CUDA Toolkit 12.8.1. It supports compute_86, compute_89 and compute_120 cuda devices, which correspond to NVIDIA GPU card with Turing, Ada and Blackwell architectures (or in layman terms: RTX 30, RTX 40 and RTX 50) series.

The python wheel file also comes with AVX, AVX2 and FMA support for both Intel and AMD cpu acceleration.

The Tensorflow version installed is the Tensorflow 2.20dev edition, nightly from :

https://github.com/tensorflow/tensorflow

Finally you can test the Tensorflow binaries with the following command.

How to get Tensorflow acceleration with NVIDIA RTX 50 series GPU with docker ( RTX5060Ti 16GB) for Ubuntu and Windows WSL2

It seems that the Tensorflow acceleration is broken with the latest RTX50 series GPU, especially with the most cost effective RTX5060Ti 16GB card.

This is a how to guide to re-enable the Tensorflow acceleration with the official Tensorflow docker image from NVIDIA

Basically you need to install these four things:

  1. Docker (if you haven’t installed already)
  2. NVIDIA GPU drivers for Linux (only for Ubuntu)
  3. NVIDIA Container Toolkit
  4. NVIDIA Tensorflow Docker containers

Docker

apt -y install docker

Installing NVIDIA GPU Driver

After downloading the NVIDIA GPU drivers for Linux (only for fully Linux-based operating system). This step is unnecessary for Microsoft Windows WSL2

bash NVIDIA_Linux_x86_64 570.153.02.run

Installing NVIDIA Container Toolkit

Follow the instruction here: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

Do not forget to configure docker

sudo nvidia-ctk runtime configure --runtime=docker

Then restart docker to enable gpu driver integration

sudo systemctl restart docker

Test the nvidia driver under the container runtime

sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi

Install NVIDIA Tensorflow docker containers (basic)

docker run --gpus all -it --rm nvcr.io/nvidia/tensorflow:xx.xx-tfx-py3

Replace the xx with the actualy version of the tensorflow containers, at the time of the writing it is:

docker run --gpus all -it --rm nvcr.io/nvidia/tensorflow:25.02-tf2-py3

If you want to run it inside the docker, and link your /home directory with the /workspace directory inside the docker image, you can just run :

docker run --gpus all -it --rm -v /home/username:/workspace nvcr.io/nvidia/tensorflow:25.02-tf2-py3

BONUS: How to install Spyder, Jupyterlab and additional Tensorflow/Keras libraries in NVIDIA docker image

I’ve prepared a Dockerfile to rebuild the NVIDIA Tensorflow docker container with GPU acceleration. Download the dockerfile and run “docker build” with this parameter

docker build -t my-nvidia-tf-ds .

Then you can run the container with GPU acceleration

docker run --gpus all -it --rm -v /root:/workspace my-nvidia-tf-ds

You can also expose the port and run Jupyterlab within the docker image. Just follow this step:

docker run --gpus all -p 8888:8888 -it my-nvidia-tf-ds \
jupyter lab --ip=0.0.0.0 --allow-root

Additionally, you can run Spyder in the docker image by forwarding xhost :

xhost +local:docker

docker run -it --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \
-v /root:/workspace my-nvidia-tf-ds

spyder

Hopefully this would help you run GPU accelerated Tensorflow with RTX50 series GPU card.

This also works under Microsoft Windows 11 / WSL2 environment too!

If you want to install Tensorflow with RTX 50 series support directly inside your Ubuntu environment, then refer to this post: