Index: music_gui.c
===================================================================
--- music_gui.c	(revision 2040)
+++ music_gui.c	(working copy)
@@ -109,8 +109,11 @@
 static void DoPlaySong(void)
 {
 	char filename[256];
-	snprintf(filename, sizeof(filename), "%sgm_tt%.2d.gm",
-		_path.gm_dir, midi_idx[_music_wnd_cursong - 1]);
+	if (_patches.midi_mode == 0) {
+		snprintf(filename, sizeof(filename), "%sgm_tt%.2d.gm", _path.gm_dir, midi_idx[_music_wnd_cursong - 1]);
+	} else {
+		snprintf(filename, sizeof(filename), "%s9_tt%.2d.fm", _path.fm_dir, midi_idx[_music_wnd_cursong - 1]);
+	}
 	_music_driver->play_song(filename);
 }
 
Index: lang/german.txt
===================================================================
--- lang/german.txt	(revision 2040)
+++ lang/german.txt	(working copy)
@@ -1008,6 +1008,10 @@
 STR_CONFIG_PATCHES_NEW_TRAIN_PATHFIND				:{LTBLUE}Neuen Algorithmus für die Züge zur Wegfindung benutzen: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL				:{LTBLUE}Neue globale Wegfindung (NWF, ersetzt NTP): {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_MIDI_MODE					:{LTBLUE}Midi Modus: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MIDI_MODE_GM					:General Midi (GM)
+STR_CONFIG_PATCHES_MIDI_MODE_FM					:Frequenz Modulation (FM)
+
 STR_CONFIG_PATCHES_SMALL_AIRPORTS				:{LTBLUE}Kleine Flughäfen immer erlauben: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_LOST_TRAIN_DAYS				:{LTBLUE}Ein Zug ist verloren, wenn kein Fortschritt seit: {ORANGE}{STRING} Tagen
Index: lang/english.txt
===================================================================
--- lang/english.txt	(revision 2040)
+++ lang/english.txt	(working copy)
@@ -1008,6 +1008,10 @@
 STR_CONFIG_PATCHES_NEW_TRAIN_PATHFIND				:{LTBLUE}New algorithm for train pathfinding (NTP): {ORANGE}{STRING}
 STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL				:{LTBLUE}New global pathfinding (NPF, overrides NTP): {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_MIDI_MODE					:{LTBLUE}Midi Mode: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MIDI_MODE_GM					:General Midi (GM)
+STR_CONFIG_PATCHES_MIDI_MODE_FM					:Frequency Modulation (FM)
+
 STR_CONFIG_PATCHES_SMALL_AIRPORTS				:{LTBLUE}Always allow small airports: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_LOST_TRAIN_DAYS				:{LTBLUE}A train is lost if no progress is made for: {ORANGE}{STRING} days
Index: variables.h
===================================================================
--- variables.h	(revision 2040)
+++ variables.h	(working copy)
@@ -202,6 +202,8 @@
 	uint32 npf_rail_curve_penalty; /* The penalty for curves */
 
 	bool population_in_label; // Show the population of a town in his label?
+
+	uint8 midi_mode; // Midi Mode
 } Patches;
 
 VARDEF Patches _patches;
@@ -236,6 +238,7 @@
 	char *game_data_dir; // includes data, gm, lang
 	char *data_dir;
 	char *gm_dir;
+	char *fm_dir;
 	char *lang_dir;
 	char *save_dir;
 	char *autosave_dir;
Index: win32.c
===================================================================
--- win32.c	(revision 2040)
+++ win32.c	(working copy)
@@ -2131,6 +2131,7 @@
 	_path.autosave_dir = str_fmt("%s\\autosave", _path.save_dir);
 	_path.scenario_dir = str_fmt("%sscenario", cfg);
 	_path.gm_dir = str_fmt("%sgm\\", cfg);
+	_path.fm_dir = str_fmt("%sfm\\", cfg);
 	_path.data_dir = str_fmt("%sdata\\", cfg);
 	_path.lang_dir = str_fmt("%slang\\", cfg);
 
Index: os2.c
===================================================================
--- os2.c	(revision 2040)
+++ os2.c	(working copy)
@@ -583,6 +583,7 @@
 	_path.autosave_dir = str_fmt("%s\\autosave", _path.save_dir);
 	_path.scenario_dir = str_fmt("%sscenario", _path.personal_dir);
 	_path.gm_dir = str_fmt("%sgm\\", _path.game_data_dir);
+	_path.fm_dir = str_fmt("%sfm\\", _path.game_data_dir);
 	_path.data_dir = str_fmt("%sdata\\", _path.game_data_dir);
 
 	if (_config_file == NULL)
Index: unix.c
===================================================================
--- unix.c	(revision 2040)
+++ unix.c	(working copy)
@@ -520,6 +520,7 @@
 	_path.autosave_dir = str_fmt("%s/autosave", _path.save_dir);
 	_path.scenario_dir = str_fmt("%sscenario", _path.personal_dir);
 	_path.gm_dir = str_fmt("%sgm/", _path.game_data_dir);
+	_path.fm_dir = str_fmt("%sfm/", _path.game_data_dir);
 	_path.data_dir = str_fmt("%sdata/", _path.game_data_dir);
 
 	if (_config_file == NULL)
Index: settings.c
===================================================================
--- settings.c	(revision 2040)
+++ settings.c	(working copy)
@@ -831,6 +831,8 @@
 
 	{"population_in_label",	SDT_BOOL,		(void*)true,	&_patches.population_in_label,	NULL},
 
+	{"midi_mode", SDT_UINT8, (void*)0, &_patches.midi_mode,	NULL},
+
 	{NULL,									0,					NULL,					NULL,																						NULL}
 };
 
Index: settings_gui.c
===================================================================
--- settings_gui.c	(revision 2040)
+++ settings_gui.c	(working copy)
@@ -14,6 +14,7 @@
 #include "network.h"
 #include "console.h"
 #include "town.h"
+#include "hal.h"
 
 static uint32 _difficulty_click_a;
 static uint32 _difficulty_click_b;
@@ -587,6 +588,13 @@
 	return 0;
 }
 
+void ResetMusic(void);
+static int32 ResetMusicDriver(int32 p1)
+{
+	if (_music_driver->is_song_playing()) ResetMusic();
+	return 0;
+}
+
 /* Check service intervals of vehicles, p1 is value of % or day based servicing */
 static int32 CheckInterval(int32 p1)
 {
@@ -652,6 +660,8 @@
 
 	{PE_INT32, 0, STR_CONFIG_PATCHES_MAP_X, "map_x", &_patches.map_x, 6, 11, 1, NULL},
 	{PE_INT32, 0, STR_CONFIG_PATCHES_MAP_Y, "map_y", &_patches.map_y, 6, 11, 1, NULL},
+
+	{PE_UINT8, PF_MULTISTRING | PF_PLAYERBASED, STR_CONFIG_PATCHES_MIDI_MODE, "midi_mode", &_patches.midi_mode, 0, 1, 1, &ResetMusicDriver},
 };
 
 static const PatchEntry _patches_construction[] = {

