SMPS status ?

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
KanedaFr
Administrateur
Posts: 1128
Joined: Tue Aug 29, 2006 10:56 am
Contact:

SMPS status ?

Post by KanedaFr » Thu Oct 23, 2014 2:16 pm

Hi,

Since it seems to be mainly used on Sonic hack scene, I'm not really aware of what is SMPS.
From what I understood, it was a Gems like : some sort of universal sound driver used in several games (Sonic series and others)

What is not clear for me is the several versions floating around
68k version, 68k+Z80 version, z80 version

Is there an exploitable version (please, tell me the z80 version) and how could use it for song (composer ?) and fx (pcm, psg...) ?

How does it compare to GEMS, VGM and Echo ?
there is no (official) driver for SGDK, so is it something to be added ?

If you have some pointers, just let me know.

thanks

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Thu Oct 23, 2014 3:07 pm

You'll have to go dive into the Sonic hack scene to learn much about it. I don't think there is anything really special about the driver other than it was used for Sonic and lots of Japanese productions. As far as I know, the 68k/68k+z80/z80 versions are an evolution of the driver, the 68k only being the oldest and the z80 one coming around Sonic 2. I could be wrong there.

There are tools out there for it, again, the Sonic hack scene, where I think you can convert MIDI and XM files to SMPS driver binary. I think the tools are kind of primitive and targeted at replacing music in Sonic hacks.

As far as comparison to other sound drivers I don't think it is particularly good or bad. I would consider Echo for example to be every bit as good or better (and at least right now, very similar in how you create music for it). I don't know of any SMPS sound effect tools; I think everyone so far just rips from other games.

I do know that the 68k version is popular with Sonic hackers for ease of use and that it has been disassembled and "back ported" to later Sonic games to ease the music hacking, it may be worthwhile for homebrew in this context.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Re: SMPS status ?

Post by r57shell » Thu Oct 23, 2014 3:44 pm

All following information "as far as I know":

It's called Simple Music Playback System. It was example for developers how to drive sound. So it was widely copy-pasted and modified. And that's why there is enormous variety of modifications. It doesn't even have common commands format. Identical among modifications only "play note" comand and durations/delays.
KanedaFr wrote: What is not clear for me is the several versions floating around
68k version, 68k+Z80 version, z80 version
Yes, it has all possible three types of drivers. I want to talk about Z80-only driver. As it called Simple Music Playback System, it can't doo much of stuff. All playing music keeped in Z80 memory, so you have restriction on size of sequence. But you may load music in Z80 before playback, so it's kinda "ok". It has some allocation for sfx, but again, very simple. Format of sequences is like VGM-trial version: patch change,note, pitch, delay/duration only. Hmm I don't remember about loops, but it must support them.
KanedaFr wrote:Is there an exploitable version (please, tell me the z80 version) and how could use it for song (composer ?) and fx (pcm, psg...) ?
I don't know about any SMPS SDK, it seems like nothing available.
For sonic hacks, people are using third party utilities like mod->smps and other stuff, for conversion from tracker formats into smps format. Interesting fact: even format of SMPS FM Patches is different between different parts of Sonic.

I think, first you must read Sonicretro pages about Music Hacking/Editing in Sonic. Also, you may join some #irc channels about sonic, and ask them. This is not sonic retro site :D You're on wrong forum :D

KanedaFr wrote:How does it compare to GEMS, VGM and Echo ?
For me, GEMS is completely different:
1) It's official: developed by Sega
2) It's complete: It has all tools that is need for developing music of those years.
3) It was supporting with Sega: bug fixes and so on...
4) It has Dinamic Voice Allocation (SMPS does not)
5) Its sequences format is common among versions.
6) PSG ASDR emulation. (correct me, if it's implemented in SMPS)

As I said before, SMPS is more like VGM, but stripped version. I don't think that you can do all stuff that can be done in VGM: change of any parameter of YM2612 or PSG at any time moment. But honestly, who will ask for changing detune of FM channel during playback? Fact: Time Trax music using this method :D. It's changing many of FM settings during None ON, but it's unusual. It needs only for professional music composers.

You may think that SMPS is VGM with stripped off "professional features" like changing FM Operator settings on fly :). But you may add them.

From this point of view, SMPS is suitable for many games. If you want to go beyond SMPS restrictions, then you need to write your own sound driver, or patch existed SMPS.

In VGM format there is timing for each event, and any register change is separated. That's why size of VGM is usually big.

When you making music, you think about it like: play this note at this time with this duration using this instrument. When driver need to load instrument: it writes several registers in some order. In VGM format each write is separated, and it has timestamp (delay actually). So in VGM format instrument loading looks like many separate commands with timestamps (delays actually). Each time when you change instrument for channel, you're increasing size of VGM. So first size reduction is: keep instruments in separate "instruments bank", and make very small command for loading of instrument.

Next step of size reduction: old versions of VGM was using separate commands for each byte of playing sample. But latest VGM supports Sample bank, so if you use this feature, your VGM will be much smaller.

SMPS separate Samples from sequences, so it's small format.

What I was talking about? I was trying to say that SMPS is stripped VGM, and it's actually how must be implemented simplest sound driver for Sega Genesis.
KanedaFr wrote:there is no (official) driver for SGDK, so is it something to be added ?
Do you mean "official" SMPS driver? Because There is several drivers for SGDK, including VGM. Or, am I wrong?

<end of long post>
Image

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Thu Oct 23, 2014 5:28 pm

ValleyBell is the guy to ask about SMPS, either on SonicRetro/SegaRetro, SMS Power, or vgmrips. He's also written many tools for processing it.

Gigasoft
Very interested
Posts: 89
Joined: Fri Jan 01, 2010 2:24 am

Post by Gigasoft » Fri Oct 24, 2014 6:28 pm

All playing music keeped in Z80 memory, so you have restriction on size of sequence.
No, most games that use SMPS keep the music in ROM. The only game that I know of that loads it into Z80 RAM is Sonic 2.
6) PSG ASDR emulation. (correct me, if it's implemented in SMPS)
Yeah, SMPS supports volume envelopes. The details differ somewhat between versions.

Sound effects in SMPS work the same way as music and are in the same format.

SMPS can not be compared with VGM as SMPS is a music/SFX engine while VGM is a type of log file for recording existing Mega Drive music. It is silly to use VGM for composing new music.

As for Echo, this is extremely limited compared to SMPS while at the same time being more verbose. The only nice thing about it is that it, like GEMS, tries to continue playing PCM sounds while doing other processing, to avoid the scratchy sound that many Mega Drive games are known for.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Fri Oct 24, 2014 8:59 pm

Gigasoft wrote:
6) PSG ASDR emulation. (correct me, if it's implemented in SMPS)
Yeah, SMPS supports volume envelopes. The details differ somewhat between versions.
Strange, no info about ASDR here. I see that there is coordination flag for changing volume of PSG channel, but it's not ASDR support. May be it's another custom modification of SMPS?
Gigasoft wrote:Sound effects in SMPS work the same way as music and are in the same format.
Really? Same? In sonicretro there are three different tables for three different SMPS versions for coordination flags. I know it for sure, because there was people who made converters of sequences, to convert coordination flags between versions.
Gigasoft wrote:SMPS can not be compared with VGM as SMPS is a music/SFX engine while VGM is a type of log file for recording existing Mega Drive music.
No, you can compare. Also, there is VGM driver with SFX support. But yes, you're right, VGM for game music is bad choice because of its size.
Image

Gigasoft
Very interested
Posts: 89
Joined: Fri Jan 01, 2010 2:24 am

Post by Gigasoft » Fri Oct 24, 2014 10:56 pm

Strange, no info about ASDR here. I see that there is coordination flag for changing volume of PSG channel, but it's not ASDR support. May be it's another custom modification of SMPS?
Well, not exactly ADSR, but there's something they call the "flutter table" which is just an arbitrary curve. And, I guess there is no release phase, it just cuts the note abruptly.
Really? Same? In sonicretro there are three different tables for three different SMPS versions for coordination flags.
What I mean is that within any one of these versions, the format for music and sound effects is the same (except for the extra byte in the track header for which channel to use).

KanedaFr
Administrateur
Posts: 1128
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Oct 27, 2014 9:42 am

thanks for all your input.
I'll see how to handle this soon.

ho, and I though ValleyBell was the VGM guy, not SMPS !

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Mon Oct 27, 2014 10:20 am

Gigasoft wrote:
Strange, no info about ASDR here. I see that there is coordination flag for changing volume of PSG channel, but it's not ASDR support. May be it's another custom modification of SMPS?
Well, not exactly ADSR, but there's something they call the "flutter table" which is just an arbitrary curve. And, I guess there is no release phase, it just cuts the note abruptly.
Is it supporing loops within this table while sustain? Otherwise you can't implement ASDR with this feature.

Gigasoft wrote:
Really? Same? In sonicretro there are three different tables for three different SMPS versions for coordination flags.
What I mean is that within any one of these versions, the format for music and sound effects is the same (except for the extra byte in the track header for which channel to use).
What do you call by music format then? Coordination flags = different, patch formats - different. Headers = music format? Or may be "flutter table". Say strict what is same. As I said, I know that only: note, patch change, delays/durations are same.
Image

Stef
Very interested
Posts: 2982
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Oct 27, 2014 11:06 am

Gigasoft wrote:SMPS can not be compared with VGM as SMPS is a music/SFX engine while VGM is a type of log file for recording existing Mega Drive music.
No, you can compare. Also, there is VGM driver with SFX support. But yes, you're right, VGM for game music is bad choice because of its size.
Actually VGM is convenient as it does not ask much cpu resource to decode and translate in YM and PSG commands.
Because of that you can use it and play PCM at same time on the Z80.
I'm currently developing a new driver which will use a custom format similar to VGM for music. I called it XGM for "eXtended Genesis Music" (ok not really a good name :p). Extended because this format allow 5FM + PSG + 4PCM where others drivers generally allow 1 PCM channel. Also compared to VGM the format is optimized for Sega Genesis Music so the size is lower than VGM (depend from the music but usually between 50% and 80% of an optimized VGM file).
To give an idea with Streets Of Rage 2 - Go Straight :
VGM 1.50 = ~1MB
optimized VGM 1.6 (i wrote my own tool) = ~100KB
XGM = ~75KB

So even if that is still bigger than SMPS, GEMS or Echo format, i believe it's really acceptable in term of size and of course the big advantage is the 4 PCM which allow richer musics or/and more SFX at same time.

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Mon Oct 27, 2014 5:26 pm

KanedaFr wrote:ho, and I though ValleyBell was the VGM guy, not SMPS !
He does both, conveniently enough, and has even written a SMPS+MIDI-to-VGM converter as part of his work :D

Gigasoft
Very interested
Posts: 89
Joined: Fri Jan 01, 2010 2:24 am

Post by Gigasoft » Mon Oct 27, 2014 10:00 pm

r57shell wrote:
Gigasoft wrote:
Really? Same? In sonicretro there are three different tables for three different SMPS versions for coordination flags.
What I mean is that within any one of these versions, the format for music and sound effects is the same (except for the extra byte in the track header for which channel to use).
What do you call by music format then? Coordination flags = different, patch formats - different. Headers = music format? Or may be "flutter table". Say strict what is same. As I said, I know that only: note, patch change, delays/durations are same.
Those three tables are for three different versions of SMPS. I'm not talking about different versions. I am talking about sound effects and music within the same version (in response to someone's comment about not knowing of any SMPS sound effect tools).

Post Reply