Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - How to make YM2413 Music?

Reply to topic
Author Message
  • Joined: 06 Feb 2018
  • Posts: 4
  • Location: At my computer.
Reply with quote
How to make YM2413 Music?
Post Posted: Thu Mar 22, 2018 12:35 am
Is there a legit way to make YM2413 music via a MML Compiler or a tracker without using a soundfont?
I really wanna make legit YM2413 tunes.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Thu Mar 22, 2018 7:58 am
http://www.smspower.org/forums/16187-FMTrackers
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 396
  • Location: Spain
Reply with quote
Post Posted: Thu Mar 22, 2018 8:29 am
I was just the other day surfing through the FM topics in this forum (not doing anything now, but just for curiosity), and what we don't have a player for SMS, have we? Zipper has some custom player, but I think he didn't share the code yet...
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Thu Mar 22, 2018 9:01 am
My old VGM player does FM, although I'm not sure how well it works on a real system.
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 396
  • Location: Spain
Reply with quote
Post Posted: Thu Mar 22, 2018 9:11 am
Maxim wrote
My old VGM player does FM, although I'm not sure how well it works on a real system.


Problem with VGM player should be the massive size of VGM forma, isn't it? I remember the discussion regarding a new format for FM. Maybe we can take inspiration from XGM for Megadrive? It's smaller than using a VGM (but maybe not as much a diference compared with PSG)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Thu Mar 22, 2018 9:38 am
To get sane file sizes you need to track for a particular music engine, and modern trackers tend to have much more complex features which make them harder to play back. We have some information to varying degrees about some of the original music engines and in theory one could make a tracker to target them, or convert from a general tracker format - the last one I looked at (PSG only) was pretty much the MOD format specs with a tiny number of shared instruments and very few effects, for example.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1116
  • Location: italy
Reply with quote
Post Posted: Fri Mar 23, 2018 1:15 am
I'm still up to write a dedicated tracker (or a converter from the XM format), if a destination format is decided upon, either targeting an existing engine, or something new written altogether from scratch.

Many 16-bit games use an engine we call "SMPS", even some 8-bit games use a PSG version of it (e.g. Sonic 2, Chaos, and Triple Trouble), I wonder if a "SMPS-2413" exists somewhere, that would make things much easier since SMPS is well understood and several tools exist for it, it would be easy to adapt them.

If a "SMPS-2413" does exist, the most probable candidates in which it could have been used are important first-party Sega titles from the first half of the 90s. If you can think of some games which might fit with this criteria, feel free to suggest them and I'll look into their ROMS for data which might look like SMPS. Alex Kidd: The Lost Stars, for example, is a bit too early to qualify, but I might look into its ROM eventually anyway (even though it probably doesn't use SMPS).

On the other hand, a new proprietary engine would result into an easier integration with the devkit. Once the specs are laid down and the Z80 code is written, we can talk about trackers/converters.
  View user's profile Send private message Visit poster's website
  • Joined: 30 Jun 2016
  • Posts: 118
  • Location: Victoria, Australia
Reply with quote
Post Posted: Fri Mar 23, 2018 2:33 am
Why not settle on a 'temporary' file format that can be converted into more specialized formats later on by the developers of a particular game?
Or perhaps a branch of Deflemask's .dmf format?

A bit like how the TUME map editor has its .iff format standard, that developers translated into the actual file format the game engine uses later on.

I think many of us agree the problem is the lack of tracker at all in the first place.

EDIT: There's also those YM2413 trackers on the MSX. Perhaps their own output standard could be branched from?
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 396
  • Location: Spain
Reply with quote
Post Posted: Fri Mar 23, 2018 7:38 am
Tom, I think latest game to use FM was WonderBoy III in 1990, so there is no FM games in the mid-90's, I'm afraid
  View user's profile Send private message
  • Joined: 30 Mar 2009
  • Posts: 261
Reply with quote
Post Posted: Fri Mar 23, 2018 12:35 pm
Is the size difference so important?
I just did a quick and dirty test with something i am working on.

The same song, the PSG version is 3779 bytes and the FM version is (4872 bytes).

I mean it doesn't seem like it would be such a big deal?

I don't see the point in creating yet another file format, if we have one that is pretty workable and stablished already.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Fri Mar 23, 2018 12:51 pm
A tracked format would fit it in much less space, maybe under 500B.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1116
  • Location: italy
Reply with quote
Post Posted: Fri Mar 23, 2018 1:14 pm
Indeed, using vgm files as a source of music has been a bad idea to begin with, but since we can't change the past, we can at least try to handle the 2413 in a proper way.

Also, I mentioned SMPS only because it's popular in the 16-bit scene, but if a new/better engine can handle FM and PSG, by all means, let's go for it. I still think it's better to keep them separate, though, for a couple of reasons.

I don't mind to invent an intermediate format by my own as suggested by Flygon, but I know virtually nothing about what the Z80 can do (I mean, how to design a format which can be decoded in few CPU cycles, where to use bits, where to use bytes, things like that). Once again, give me the target specs, and I'll write a dedicated tracker or a converter from the XM format.

I'll also need to reread the docs about the 2413, to remember what it can and it can't do when it comes to instruments, volumes, panning, effects...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Fri Mar 23, 2018 5:54 pm
There's a very common engine, which may be the "pre-SMPS" one, which is dual PSG and FM. This does however mean it only supports three melody tracks. This is the one that gave us "hidden" FM soundtracks (by enabling FM mode with a hack).

In fact, I think only the FM BIOS engine supports all the channels (and simultaneous PSG). So some composers might want the larger channel count, and others may prefer the dual chip engine which plays the same source data on either chip.

But these engines impose restrictions on the effects and instruments they support. A tracker would like to minimise such restrictions. Personally, I think an existing engine is a good start (known good code, a lot of work to reverse engineer it though) and may be quite extensible. We just need someone to do the RE (again, I'm not familiar with the RE work that's already been done) and someone to build the tracker, ideally one which can run the engine under emulation for immediate feedback.

I did reverse engineer an engine a little while ago - from Micro Machines - and posted about making a little editor for it, but didn't get any takers. It's super limited.

YM2413 mostly does predefined instruments with just key events and channel volumes. You can have a single custom instrument so the music has to use the standard ones really. See http://www.smspower.org/Homebrew/SegaMasterSystemYM2413FMTool-SMS for a tool to try out all the features.
  View user's profile Send private message Visit poster's website
  • Joined: 30 Jun 2016
  • Posts: 118
  • Location: Victoria, Australia
Reply with quote
Post Posted: Sat Mar 24, 2018 2:26 am
This is why I was suggesting a gander at the MSX side of things, instead.

Illusion City is a game that drives all of the YM2413 channels, for example. Whilst also driving the MSX's PSG.
The issue is, of course, that the PSG on the MSX is AY based, not SN.

Never minding the already existent trackers for the machine bought up earlier. :)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Sat Mar 24, 2018 7:05 am
I've tried looking there before but it was confusing, it seems like trackers running on the system are quite common but that's off-putting for me.
  View user's profile Send private message Visit poster's website
  • Joined: 15 Sep 2009
  • Posts: 373
Reply with quote
Post Posted: Sat Mar 24, 2018 9:16 am
The FM/OPLL version of preSMPS isn't limited to 3 or 4 channels. It can use all channels - Phantasy Star and OutRun 3D prove that very well.
I disassembled the sound drivers of Phantasy Star and the FM BIOS some years ago. (You can get files for IDA here, folder is Drivers/Z80Drvs/SMS.)

Phantasy Star reserves 10 channels for FM (9x melodic + 1x rhythm), but it isn't able to disable the OPLL's rhythm mode. I remember OutRun 3D being able to do that though.
There are separate pointer tables and preSMPS song headers for the PSG and FM versions of the songs, but they are written in a way so that both versions share most of their data.

The FM BIOS does FM + PSG in a pretty interesting way: At first they set the driver to FM mode, then process 7 FM tracks, then they switch to PSG mode and process 4 PSG tracks. So it's pretty much just a cheap hack that allows FM and PSG to be used simultaneously.

If someone wants to get into preSMPS, feel free to ask. I haven't done as much research on the SMS sound drivers as I did on the MegaDrive versions, but I know enough to get a few songs done.
  View user's profile Send private message
  • Joined: 24 Mar 2018
  • Posts: 2
Reply with quote
Post Posted: Sat Mar 24, 2018 12:36 pm
Last edited by Grauw on Sat Mar 24, 2018 12:57 pm; edited 1 time in total
About YM2413 trackers for MSX;

The Trilo Tracker guys have an FM version and iirc some affinity for the SMS so they might be able to help out… also they’re working on a PC version of their tracker.

(Although the FM version of Trilo Tracker was still a bit beta last time I tried.)

Alternatively, good ol’ MoonBlaster 1.4.

p.s. Hi btw, first post here, I’m the author of VGMPlay MSX :).
  View user's profile Send private message
  • Joined: 30 Jun 2016
  • Posts: 118
  • Location: Victoria, Australia
Reply with quote
Post Posted: Sat Mar 24, 2018 12:55 pm
Since Grauw can't make links yet, here's one to the TriloTracker thread. :)
  View user's profile Send private message Visit poster's website
  • Joined: 06 Apr 2011
  • Posts: 225
  • Location: Netherlands
Reply with quote
Post Posted: Mon Mar 26, 2018 9:55 am
@Grauw:Hi!

I'm the coder of TriloTracker.
The FM version of the tracker is still beta. And even more beta I also have a version supporting SN+FM (instead of AY+FM).

I don't have a lot of time. But currently I am trying to port the MSX based tracker to a more generic platform (JAVA). This way no MSX (emulation) is needed to make music making it more accessible.

In the meantime you could use Moonblaster. Anyone interested in the replayer for SMS, please contact me. I have the source code for the re-player available for anyone interested (Will try to make a GitHub repository for it).
  View user's profile Send private message
  • Joined: 06 Apr 2011
  • Posts: 225
  • Location: Netherlands
Reply with quote
Post Posted: Mon Mar 26, 2018 10:09 am
Update: Source code is available on this forum here: http://www.smspower.org/forums/13677-MBPlayV02MusicRePlayerDemoForFM
  View user's profile Send private message
  • Joined: 29 Mar 2012
  • Posts: 396
  • Location: Spain
Reply with quote
Post Posted: Mon Mar 26, 2018 12:32 pm
Wow, I totally forgot about this old topic. I'll take a look!
  View user's profile Send private message
  • Joined: 06 Apr 2011
  • Posts: 225
  • Location: Netherlands
Reply with quote
Post Posted: Mon Mar 26, 2018 12:55 pm
Feel free to ask for info/details/help.
  View user's profile Send private message
  • Joined: 29 Mar 2012
  • Posts: 396
  • Location: Spain
Reply with quote
Post Posted: Tue Mar 27, 2018 8:32 am
I've found some commets on Ducth, :_) but apart from that, It looks really interesting!

Btw, what's the footprint of the MoonBlaster format? You have 10 songs in a 40k rom, so it's not bad at all, isn't it?
  View user's profile Send private message
  • Joined: 06 Apr 2011
  • Posts: 225
  • Location: Netherlands
Reply with quote
Post Posted: Tue Mar 27, 2018 8:39 am
I have hacked the replayer to work on the SMS and removed the MSX-AUDIO code.
Coder of Moonblaster is Dutch so that's why it contains dutch.

The footprint is quite low. Much much less than VGM.

More info on the format here: https://www.msx.org/wiki/Moonblaster_file_format
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12483
  • Location: London
Reply with quote
Post Posted: Tue Mar 27, 2018 9:08 am
To be fair, it is trading CPU for space. VGM based players can be very fast.

I'd love to see a tutorial for this for SMS. Integration into devkitSMS would help adoption too.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Apr 2011
  • Posts: 225
  • Location: Netherlands
Reply with quote
Post Posted: Tue Mar 27, 2018 11:12 am
Maxim wrote
To be fair, it is trading CPU for space. VGM based players can be very fast.


That shouldn't be a bad thing for games. For demos I'd recommend writing register logs (like VGM).
  View user's profile Send private message
  • Joined: 24 Mar 2018
  • Posts: 2
Reply with quote
Post Posted: Fri Mar 30, 2018 9:21 am
kusfo wrote
I've found some commets on Dutch, :_) but apart from that, It looks really interesting!


MoonBlaster manual translated from Dutch to English by Japanese MSX user Kumo:

mus.msx.click/index.php?title=TRACKERS_MOONBLASTER_EN

(sorry can’t post links yet so you’ll have to copy/paste)
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2298
Reply with quote
Post Posted: Tue Apr 03, 2018 12:59 pm
Tom wrote
Indeed, using vgm files as a source of music has been a bad idea to begin with, but since we can't change the past, we can at least try to handle the 2413 in a proper way.


Surely a bad idea, but the only that would work with my constraints. If Mod2PSG2 tracker could export SFXs, I would have used that - it comes with a replay library and I wouldn't have had to write PSGlib, which also has its limits, but made my collaborators work easier, as they could track the tunes and the effects using their tracker of choice, given that it can export VGMs.
Also, as noted, playing VGMs has a very very low CPU load requirement.
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 396
  • Location: Spain
Reply with quote
Post Posted: Tue Apr 03, 2018 1:16 pm
Grauw wrote
kusfo wrote
I've found some commets on Dutch, :_) but apart from that, It looks really interesting!


MoonBlaster manual translated from Dutch to English by Japanese MSX user Kumo:

mus.msx.click/index.php?title=TRACKERS_MOONBLASTER_EN

(sorry can’t post links yet so you’ll have to copy/paste)


I didn't notice that link, thanks Grauw!
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!