OpenTTD supporting Roland MT32

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

User avatar
jez
Traffic Manager
Traffic Manager
Posts: 158
Joined: 23 Aug 2003 21:24

Re: OpenTTD supporting Roland MT32

Post by jez »

What format is the original sample.cat in? Presumably the game already decodes that so the same format could be read for new music files.
=== Jez ===
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: OpenTTD supporting Roland MT32

Post by jfs »

jez wrote: 29 May 2021 15:01 What format is the original sample.cat in? Presumably the game already decodes that so the same format could be read for new music files.
The sample.cat file (sound effects) is an entirely different format from the gm.cat/roland.cat (General MIDI and MT-32 music) files, and the adlib.cat file is yet again a slightly different format. The music in roland.cat also depends on the lapc1.pat file which contains some additional SysEx commands needed to set up the synth.
The sample.cat data format is just uncompressed PCM audio, nothing interesting, but it's definitely not suitable for adding new music. (It's uncompressed so the data size for music would be huge.)
The gm.cat data format is a not-quite-standard-MIDI thing, effectively giving a level of compression by having reusable parts. It's definitely possible to write a program to convert standard MIDI files into that format, but why bother? Standard MIDI files work just as well, and are much easier to work with.

I have already written code to read and play all these formats, and it exists in some (old) branches on my own fork of OpenTTD on GitHub. As I mentioned before, the actual blocker for supporting the MT-32 music is that the "OBM" (OpenTTD Baseset Music) music set definition format needs to be extended to have a decent way of supporting the lapc1.pat file, and that's actually kind of annoying with the way the baseset definition file parser is implemented currently.
There's also the question of what to do if the user switches music set between the MT-32 music and a General MIDI music set in-game, should the game be configurable to switch to a different output port somehow? Or should it just keep playing to the same output port and hope the user has a fancy setup that automatically sends the music to a different synth somehow? (Because a GM synth won't play the MT-32 music properly, and an MT-32 won't play the GM music properly.)

Supporting MT-32 music in OpenTTD is not actually about technical limitations, it's about usability and maintainability of the code.
User avatar
jez
Traffic Manager
Traffic Manager
Posts: 158
Joined: 23 Aug 2003 21:24

Re: OpenTTD supporting Roland MT32

Post by jez »

Which is why I'd just have wave-based playlists instead. The sample.cat format might end up being pretty big for music, but it'd be a start and require no extra libraries. I might have a go at patching it in.
=== Jez ===
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: OpenTTD supporting Roland MT32

Post by Eddi »

i don't think you understood the point.

sample.cat is just a simple file container. might as well use a .tar file. that doesn't address any of the mentioned problems.
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: OpenTTD supporting Roland MT32

Post by jfs »

There's actually also another concern for sampled music support: People will want to put those files on BaNaNaS, but they will be big, and likely cause a huge bandwidth consumption from downloads. Someone will have to pay the bill for that.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: OpenTTD supporting Roland MT32

Post by Eddi »

... have you looked at the size of some NewGRFs? that's barely a concern worth having.
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: OpenTTD supporting Roland MT32

Post by Taschi »

Eddi wrote: 30 May 2021 14:35 ... have you looked at the size of some NewGRFs? that's barely a concern worth having.
The biggest NewGRFs I could find at a glance are at ~20MB (e. g. Timberwolf's UK trains), and I reckon they're downloaded by a fairly low percentage of all players. At a reasonable bitrate of 256 Kbps, that equals about 10 minutes of music. At 192 Kbps, it gives you around 15 minutes of music. At 128 Kbps, it gives you 20 minutes of intense suffering.
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: OpenTTD supporting Roland MT32

Post by jfs »

As far as I know, the biggest single items on BaNaNaS are aBase and zBase, and they are so large they completely dominate the bandwidth usage statistics for the service.
An MP3 music pack with an hour of music would weigh in at the same size.
User avatar
jez
Traffic Manager
Traffic Manager
Posts: 158
Joined: 23 Aug 2003 21:24

Re: OpenTTD supporting Roland MT32

Post by jez »

Not really a reason to avoid wave-based music though. Just don't make it downloadable; give people instructions to copy over their music to their OpenTTD folder to play it.
=== Jez ===
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: OpenTTD supporting Roland MT32

Post by Eddi »

now that's just plain stupid...

why would we bother putting effort into programming a feature, to then not allow everyone the easiest accessibility to that feature?
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: OpenTTD supporting Roland MT32

Post by Taschi »

Eddi wrote: 31 May 2021 12:00 now that's just plain stupid...

why would we bother putting effort into programming a feature, to then not allow everyone the easiest accessibility to that feature?
Jez has repeatedly stated they don't want to listen to the official soundtrack, they just want VLC to be ontegrated into OpenTTD for reasons that deeply confound me.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: OpenTTD supporting Roland MT32

Post by Eddi »

which part of my question is that meant to be an answer to?
Last edited by Eddi on 01 Jun 2021 07:16, edited 1 time in total.
Auge
Director
Director
Posts: 633
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: OpenTTD supporting Roland MT32

Post by Auge »

Hello
Eddi wrote: 31 May 2021 23:31 which part of my question is that meant to be an anwser to?
Maybe you should bring your ironydetector to a repair store. Mine bayed loud and clear. ;-)

Tschö, Auge
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: OpenTTD supporting Roland MT32

Post by Taschi »

Eddi wrote: 31 May 2021 23:31 which part of my question is that meant to be an answer to?

You asked why you would bother to implement it that way, and the only reason why you would is because it fits Jez' usecase and nobody else's.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: OpenTTD supporting Roland MT32

Post by Eddi »

Taschi wrote: 01 Jun 2021 09:24 and nobody else's.
says you, and which representative survey?
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: OpenTTD supporting Roland MT32

Post by Taschi »

Eddi wrote: 01 Jun 2021 19:44 says you, and which representative survey?
Well, do you want a music player built into OpenTTD just so you can listen to your own music library, which you could also do through VLC, WinAmp (is that still a thing?), or even the Steam overlay? Because so far, I have heard from exactly one person who wants that.

Don't get me wrong, I can see the point of distributing an "official" in-game soundtrack as PCM audio instead of distributing it as MIDI. But Jez has explicitly stated that that is not what they want.

And in any case, the two questions we are discussing here, namely a) should the in-game soundtrack be switched to PCM audio and b) should OpenTTD include a music player for arbitrary player-controlled music, are wholly unrelated to the problem that OpenTTD does not currently support the Roland MT32 and/or software emulations thereof.
User avatar
jez
Traffic Manager
Traffic Manager
Posts: 158
Joined: 23 Aug 2003 21:24

Re: OpenTTD supporting Roland MT32

Post by jez »

If the official music were distributed as PCM, that would de facto give what I want because it could just be replaced with other wave data.
=== Jez ===
User avatar
jez
Traffic Manager
Traffic Manager
Posts: 158
Joined: 23 Aug 2003 21:24

Re: OpenTTD supporting Roland MT32

Post by jez »

My patch pack allows music to be supplied as WAV files, in case anyone else wanted that. I now enjoy high quality Roland MT-32 sounding music in-game. :) It can be found here: viewtopic.php?f=33&t=89118
=== Jez ===
Bobypin
Engineer
Engineer
Posts: 3
Joined: 06 Nov 2018 22:42

Re: OpenTTD supporting Roland MT32

Post by Bobypin »

t's a bummer when the tech doesn't quite mesh, though, especially with MIDI configurations. I haven't come across a direct solution within OpenTTD for switching to the proprietary Roland MT32 MIDI format over General Midi, but I'm also curious if there's a workaround or if the developers might address this in future updates.
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: OpenTTD supporting Roland MT32

Post by jfs »

Bobypin wrote: 07 Mar 2024 23:06 t's a bummer when the tech doesn't quite mesh, though, especially with MIDI configurations. I haven't come across a direct solution within OpenTTD for switching to the proprietary Roland MT32 MIDI format over General Midi, but I'm also curious if there's a workaround or if the developers might address this in future updates.
A workaround would be to extract all the MT-32 tunes to standard MIDI files, and prepend all the appropriate SysEx patches to each one, then play them as a regular base music set.

As for direct support for the original music, I will just refer to my previous replies in this thread.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 9 guests