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 - FM confusion

Reply to topic
Author Message
  • Joined: 27 Oct 2020
  • Posts: 7
Reply with quote
FM confusion
Post Posted: Tue Oct 27, 2020 10:37 am
Hello. This is my first post. I'm too new to post links so had to remove them from my post.

I wanted to clear up some confusion about the FM chip.

1. Sega Retro says "The FM Sound Unit contains a YM2413 FM chip that acts on top of the built-in SN76489 PSG chip, adding nine extra mono sound channels." The wording of this makes it sound like the usual 4 PSG channels always play, while 9 extra YM2413 channels are added on top. I believe however that the correct interpretation is that the YM2413 chip has 9 more channels than PSG (which has 4), meaning it actually has 13 channels. Is that correct?

2. This has been brought up a few times on this message board and I'm pretty sure I know the answer, but just to confirm, the YM2413 and PSG chips are never used at the same time, at least in official games, correct? Again, my confusion comes from that Sega Retro line. I also saw a video from Maxim (Space Harrier Main BGM) where the track labels mix PSG and YM2413. But I assume this is a glitch, as that doesn't seem to ever be the case in later videos.

3. Going back to Maxim's amazing SMS VGM channel — while the PSG tracks obviously always have the same labels (Square 1, Square 2, Square 3, Noise), the labels for the FM tracks vary. Since I know the process was fully automated, I assume the track names are included somewhere in the VGM files. If that's right, how can they be read?

Many thanks.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Oct 27, 2020 10:54 am
I'll reply to number 1. The YM2413 is an FM chip that has 18 'operators' that can work in two modes:
- 2 operators per channel => 9 channels "melodic mode"
- 12 operators at 2 operators per channel + percussion => 6 channels "melodic mode" plus drums
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 844
Reply with quote
Post Posted: Tue Oct 27, 2020 12:33 pm
gaetan wrote
2. This has been brought up a few times on this message board and I'm pretty sure I know the answer, but just to confirm, the YM2413 and PSG chips are never used at the same time, at least in official games, correct? Again, my confusion comes from that Sega Retro line. I also saw a video from Maxim (Space Harrier Main BGM) where the track labels mix PSG and YM2413. But I assume this is a glitch, as that doesn't seem to ever be the case in later videos.


The Mark III / FM unit combination cannot use both chips at the same time. The japanese Master System can. Since commercial games needed to be compatible with both the Mark III and the SMS, they went for the lowest common denominator and also only supported the chips mutually exlusively. The Space Harrier music you saw in that video is from the BIOS of the japanese SMS. Since it's built into the console, it doesn't have to be compatible with the Mark III, thus it can go all out and use both chips simultaneously. It's very much not a glitch.

gaetan wrote
3. Going back to Maxim's amazing SMS VGM channel — while the PSG tracks obviously always have the same labels (Square 1, Square 2, Square 3, Noise), the labels for the FM tracks vary. Since I know the process was fully automated, I assume the track names are included somewhere in the VGM files. If that's right, how can they be read?


Apart from one software-programmed custom instrument, the instruments of the YM2413 are hardwired and cannot be changed, thus they can be easily identified.
  View user's profile Send private message
  • Joined: 27 Oct 2020
  • Posts: 7
Reply with quote
Post Posted: Tue Oct 27, 2020 1:16 pm
Fascinating; thank you both.

Kagesan wrote
The Space Harrier music you saw in that video is from the BIOS of the japanese SMS. Since it's built into the console, it doesn't have to be compatible with the Mark III, thus it can go all out and use both chips simultaneously. It's very much not a glitch.


I see! So that would make this the one and only instance when both chips are used simultaneously then?

Kagesan wrote
Apart from one software-programmed custom instrument, the instruments of the YM2413 are hardwired and cannot be changed, thus they can be easily identified.


You could identify them by ear if you isolate each channel, but how can they be identified automatically? I see various labels in Maxim's videos (Violin, Acoustic Bass, Trumpet, Clarinet, Oboe, Organ, Harpsichord, Horn, Electric Guitar, Piano, Bass Drum, Snare Drum, Tom-Tom, Hi-Hat, Cymbal etc.) and I think these were automatically pulled. So I was wondering if there was a programme that could read that information?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Tue Oct 27, 2020 1:28 pm
I label the channels by parsing the VGM data and counting the amount of time each instrument is used (between key on and key off events), and then list by which instrument is used the most. I integrated this into my video renderer program’s command line mode.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Oct 27, 2020 1:40 pm
gaetan wrote
I see various labels in Maxim's videos (Violin, Acoustic Bass, Trumpet, Clarinet, Oboe, Organ, Harpsichord, Horn, Electric Guitar, Piano, Bass Drum, Snare Drum, Tom-Tom, Hi-Hat, Cymbal etc.) and I think these were automatically pulled. So I was wondering if there was a programme that could read that information?


The chip has 15 preset melodic instruments, the rhythmic instruments if used in rhythmic mode, and a single custom melodic one. Thus when you tell the chip which instrument number to play, you're actually choosing the instrument.

0   Original (custom)
1   Violin
2   Guitar
3   Piano
4   Flute
5   Clarinet
6   Oboe
7   Trumpet
8   Organ
9   Horn
10   Synthesizer
11   Harpsichord
12   Vibraphone
13   Synthesizer Bass
14   Acoustic Bass
15   Electric Guitar
  View user's profile Send private message Visit poster's website
  • Joined: 27 Oct 2020
  • Posts: 7
Reply with quote
Post Posted: Tue Oct 27, 2020 2:36 pm
Makes sense!

Maxim wrote
I label the channels by parsing the VGM data and counting the amount of time each instrument is used (between key on and key off events), and then list by which instrument is used the most. I integrated this into my video renderer program’s command line mode.


Gotcha. Great job with that programme, really cool initiative.
  View user's profile Send private message
  • Joined: 01 Oct 2020
  • Posts: 32
  • Location: Gummersbach, Germany
Reply with quote
Post Posted: Tue Oct 27, 2020 8:40 pm
sverx wrote
gaetan wrote
I see various labels in Maxim's videos (Violin, Acoustic Bass, Trumpet, Clarinet, Oboe, Organ, Harpsichord, Horn, Electric Guitar, Piano, Bass Drum, Snare Drum, Tom-Tom, Hi-Hat, Cymbal etc.) and I think these were automatically pulled. So I was wondering if there was a programme that could read that information?


The chip has 15 preset melodic instruments, the rhythmic instruments if used in rhythmic mode, and a single custom melodic one. Thus when you tell the chip which instrument number to play, you're actually choosing the instrument.

0   Original (custom)
1   Violin
2   Guitar
3   Piano
4   Flute
5   Clarinet
6   Oboe
7   Trumpet
8   Organ
9   Horn
10   Synthesizer
11   Harpsichord
12   Vibraphone
13   Synthesizer Bass
14   Acoustic Bass
15   Electric Guitar


Does that mean you can call each one of them separately, i.e. if programming the SMS in BASIC?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Tue Oct 27, 2020 10:54 pm
I’m not sure what you mean, you can use any instrument on any channel, but you have 6 (or 9) channels so you can only use that many at once.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Oct 2020
  • Posts: 32
  • Location: Gummersbach, Germany
Reply with quote
Post Posted: Wed Oct 28, 2020 2:43 pm
Ok, that answers my question.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!