Toe Jam & Earl. Sound Engine

Talk about anything and everything about Sega's 16 Bit console and its addons here - hardware, games, memories. You name it.
Post Reply
User avatar
Delek
New Around Here
Posts: 2
Joined: Wed Oct 17, 2012 6:25 pm

Toe Jam & Earl. Sound Engine

Post by Delek »

Hi!, I just opened in DefleMask the track converted from the VGM and I was trying to understand why there's no a "channel dedication" for each one of the instruments. I mean, the bass is playing randomly on each one of the 5 FM Channels when it is needed. You can't simply "listen only to the bass".

I think that the sound engine used was made by using a priority queue or something like that, because it decides which channel to use dynamically depending how much time elapsed from previous note in that channel. It's pretty interesting.

If you don't understand what I'm talking about, please open the Toejam & Earl 2 - Theme Song vgm/deflemask module to mute some channels and try to separate a instrument. You will find that it is not done in a standard way.

Do you know any other game that uses this Technic? or the sound engine name?
User avatar
dissident93
Been Here for a Bit
Posts: 41
Joined: Mon Feb 21, 2011 2:06 pm

Toe Jam & Earl. Sound Engine

Post by dissident93 »

This has to do with the GEMS sound driver (which the game uses). There are other songs/games that do this too (Sonic Spinball comes to mind, and I'm sure many others)

I think it has to do with a main feature of GEMS, which was the ability for it to directly convert MIDI data into something the Genesis' sound hardware could read and play back without any knowledge of programming from the composer. The Japanese had hex editing, the Europeans had trackers, and the Americans had GEMS/MIDI convertors, lol

maybe Valleybell could answer the question in more technical detail though?
ValleyBell
Board Regular
Posts: 128
Joined: Mon Aug 30, 2010 7:10 am

Toe Jam & Earl. Sound Engine

Post by ValleyBell »

dissident93 wrote:and I'm sure many others
see the MD sound driver list

The GEMS sound driver is a MIDI playback engine. (It doesn't play raw MIDIs though, but a custom format that is optimized to be very small.)
It has 16 "virtual" MIDI channels, all of these channels can have a separate instrument. Also you can have overlapping notes and chords on a single channel, i.e. everything you expect from a MIDI engine.

When it has to play a new note, it loops through all channels (FM or PSG, depending on the MIDI instrument), searching for the first free one. Unlike most other MIDI engines, it tries to keep a monophonic MIDI channel on the same FM/PSG channel though.
This is called "dynamic channel allocation", btw.
User avatar
dissident93
Been Here for a Bit
Posts: 41
Joined: Mon Feb 21, 2011 2:06 pm

Toe Jam & Earl. Sound Engine

Post by dissident93 »

ahh, that makes sense. such a shame none of them could program or even use a tracker (like Matt Furniss and Jesper Kyd used, and their games sound amazing)

so what would happen if there wasn't a free space for an instrument? I guess it wouldn't play and the composer would have to re-work the song a bit?
ValleyBell
Board Regular
Posts: 128
Joined: Mon Aug 30, 2010 7:10 am

Toe Jam & Earl. Sound Engine

Post by ValleyBell »

In that case it would stop another instrument.
Every channel has a priority (usually set by a command at the beginning of a track) and it stops the note with the lowest priority.

This actually happens in a few well-known GEMS games.
Aladdin - Arab Rock 1 (AR 2, too) tries to play 1 note too much in the chords right before it loops back. (If you listen closely, you'll notice the missing bass strings between 2:00 and 2:04.)
Cool Spot - Rave Dancetune has the 2 of the 3 notes that raise from low to high cut, because it reaches the polyphony limit of the FM chip. (This happens in every loop at 0:42, but not at the beginning of the song.)
Post Reply