Sonic and Sega Retro Message Board: Green Hill on a TX81Z - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked Forum

Green Hill on a TX81Z

#1 User is offline saxman 

Posted 29 July 2011 - 02:53 AM

  • Oldbie
  • Posts: 2625
  • Joined: 08-April 04
  • Gender:Male
  • Location:United States of America
  • Wiki edits:136

This is the classic Green Hill Zone playing on a Yamaha TX81Z. I hand-ported each voice from the game, used ValleyBell's SMPS2MID program to create a MIDI sequence of the song, and then played it through the TX81Z.

Some problems that occur:
- TX81Z timing is apparently slower, making attack and decay times slower than that of the YM2612
- The modulation in the MIDI file is a bit too much
- The TX81Z doesn't change voices instantly, so everytime a voice has to be set, you hear a stutter in the music
- There's no PSG or DAC for obvious reasons

UPDATE: Conversion guide is here!


How to Play Sonic 1 Music on a Yamaha TX81Z
Written by Damian Grove


It has been long established that a directly relationship exists between the
YM2612 and the Yamaha DX synthesizer series. I happen to be an owner of two
such synthesizers -- a Yamaha DX7 II-FD, and the Yamaha TX81Z. Technically
they're not mine (they're my dad's), but he doesn't really use them anymore.

I created Sonic QX after discovering that the YM2612 worked very similar to
the DX7. Upon further examination, I realized that while the DX7 had a total
set of 32 algorithms and 6 operators, the YM2612 had 8 and 4 respectively.
I then realized I owned one such synthesizer, but it wasn't the DX7.

As I started learning the voice format in Sonic 2, started matching all of the
registers in the YM2612 to the TX81Z. Some register names were the same, and
some weren't. What was absolutely clear however was the envelope generator was

When I released Sonic QX back in 2003, it was capable of converting voices
from the TX81Z over to Sonic 2. I intended to create a way to convert the
other direction, but I never got around to it, and eventually I abandoned
Sonic QX altogether.

Recently, I decided it would be a cool thing to witness the TX81Z playing back
a Sonic tune. So I downloaded a couple tools to help read voice data from the
first Sonic the Hedgehog game so I could port the data over. The process was
supposed to be relatively easy, but due to some bugs in SOME (Sonic One Music
Editor) and some minor differences between the TX81Z and YM2612, it took me a
good while to figure out exactly how to get the conversion process working.

I posted a video on YouTube demonstrating the end result. I wanted to write a
guide explaining how I did everything in hopes that it would increase some
awareness of the TX81Z and how it can be used as a music editor for music in
the Sonic series. If anything, it can be a useful guide to anyone interested
in writing software to convert Sonic voices to the TX81Z and other DX series

Basic TX81Z setup

Before we do anything, we need to unprotect the memory. To do that, press
UTILITY button. Then navigate through the options using the PARAMETER buttons
until you see "Mem Protect:" displayed following either "on" or "off". If it
is on, press the DEC button to turn memory protection off. The TX81Z is now
ready to have data written to it.

Next we will need to ensure the TX81Z can process MIDI input data correctly.
While still in Utility Mode, scroll to "Midi Control?" and press INC. Now
scroll to "P.Change" and use the DATA ENTRY buttons to set it to "ind". Then
scroll over to "Init P.Cng Tbl?" and press INC twice.

Porting a voice

We need to be in Play Single mode for this part of the tutorial. Enter this
mode by pressing the PLAY/PERFORM button. It will have the words "PLAY SINGLE"
on top.

Next, we'll initialize a voice so we can start fresh. While in Play Single
mode, use the DEC and INC buttons to set the voice number. We need to use a
voice from bank I since the other banks are ROM, so any voice from I01 to I32
will do (however, to ensure proper playback of music I strongly recommend you
use I01 for your first voice, I02 for your second, and so on). Now go into
Utility Mode using the UTILITY button and use the left and right PARAMETER
buttons to scroll until you see "Init Voice?". Press the INC button twice.
This will automatically put you into Edit Mode (which can also be accessed via
the EDIT/COMPARE button).

Before we go any further, let's open SOME. Go to File->Open and select your
Sonic the Hedgehog ROM. Now go to Tools->Voice Editor. Select the track and
voice number you wish to port over. There are a few bugs to take note of. This
guide will point them out as needed to ensure all voices are ported correctly.

On the TX81Z, you will use the PARAMETER buttons to scroll between pages, the
CURSOR buttons to move to different parameters on a page, and the DATA ENTRY
buttons to change the data. Below is a chart of the values that need to be
changed on the TX81Z. Any values not listed should be left alone.

    TX81Z                   SOME
    ALG                     ALG
    Feedback(OP4)           FBL
        AMS [1-4]           AME
    "Edit Frequency?"
        CRS(RATIO) [1-4]    MUL [1-4]
    DET [1-4]               DET [1-4]
    "Edit EG?"
        AR [1-4]            AR [1-4]
        D1R [1-4]           D1R [1-4]
        D1L [1-4]           D1L [1-4]
        D2R [1-4]           D2R [1-4]
        RR [1-4]            RR [1-4]
    OUT [1-4]               TL [1-4]
        RS [1-4]            RS [1-4]
        Poly Mode
        Middle C

One problem (not necessarily with SOME, but instead with the documentation
from Sega that was used to make SOME) is the operators are numbered backward.
An order of 1, 2, 3, and 4 on the TX81Z would be 4, 3, 2, and 1 in SOME. Where
SOME messes up is the order in which it presents some of it's data -- the
second and third operators are actually swapped for all values except DET. The
first and fourth operators are swapped for DET.

Out of anticipation for possible confusion, I have provided a simplified
breakdown of how the conversion process should go.

    For DET values:

    TX81Z                   SOME
    OP 1                    OP 1
    OP 2                    OP 3
    OP 3                    OP 2
    OP 4                    OP 4

    For all other values:

    TX81Z                   SOME
    OP 1                    OP 4
    OP 2                    OP 2
    OP 3                    OP 3
    OP 4                    OP 1

Some things to pay attention to:

* The ALG values range from 0 to 7 in SOME and 1 to 8 on the TX81Z. Whatever
the value is in SOME, add 1 to it for the TX81Z.

* MUL values are equal to CRS values, but without the extra precision to the
right of the decimal. When MUL is 0, just use 0.50 for CRS.

* TL values are backwards from the OUT values. In addition, TL values have a
128 value range, whereas OUT values have a 100 value range. Luckily, the
volume intervals are identical despite the different ranges. OUT should be 99
minus whatever TL is.

* D1L is also backwards between SOME and the TX81Z. D1L on the TX81Z should be
15 minus the D1L value in SOME.

* SOME presents the RR data on a larger scale, but with the same number of
selectable values. Subtract 1 from the value and divide it by 2 to create the
RR value for the TX81Z. Note however that Yamaha introduced a very slight
compatibility issue in the DX series with the TX81Z in that RR cannot be 0.
Yamaha's solution is to make RR equal 1 instead of 0. So if you come up with
0 after your math, you should do the same.

* The Poly Mode can be changed to Mono Mode if you want to ensure that only a
single note is played (meeting the limitation of the YM2612). However, it is
not necessary since our performance data will ensure correct playback anyhow.

* Middle C should be set to C4 so SMPS2MID conversions are played at the right

* Name can be whatever you decide it should be. Obviously I would recommend
you incorporate the level name in there somehow.

It should be noted that the timing of the YM2612 versus the TX81Z is not the
same. Attack and decay rates will be slower on the TX81Z. I do not have a
definite solution for this other than playing around with the RS values and
individual attack/decay values.

Once all the data has been converted, go back into Play Single mode, but DO
NOT change the voice selection or your changes will be lost. To preserve our
changes, hold the STORE/EG COPY button and press INC one time. The two voice
numbers displayed should match. Release the buttons and press INC again. The
data should now be saved.

Creating a performance

Performance Mode is meant to be used when playing a song. It allows multiple
voices to be used on the TX81Z (up to 8). We create a performance to properly
patch the SMPS2MID sequence we will generate so it plays with the instruments
from the game.

Enter Performance Mode using the PLAY/PERFORM button. You will see "pF" with
a number displayed when in Performance Mode. Use the INC and DEC buttons to
select the performance number you wish to use.

We will want to initialize the performance. To do so, press UTILITY and use
the PARAMETER buttons to scroll to "Init Perfrm?". Press INC twice. It will
put you in Edit Mode.

Use the left PARAMETER button to scroll back to "ED MAX NOTES". Set each of
the eight values to 1 using the DATA ENTRY buttons. Use the CURSOR buttons to
move to change the selections.

We will be able to use this performance for any SMPS2MID generated file.
Therefore, we could scroll over to "Name" and call it "PlayYM2612" if you so

Now press PLAY/PERFORM to go back into Performance Mode. We need to save our
changes before going further, so hold down the STORE/EG COPY button and press
INC one time and release. The two performance numbers showing should match.
Press the INC button once more to save the performance.

Converting a song

For this step, we will need SMPS2MID, a neat utility created by ValleyBell.
This program will take SMPS sequence data from a Sonic game and convert it
into a General MIDI sequence file. While the program isn't perfect, it is
currently the best option out on the internet.

To begin, run the program and click "Open File". Select the Sonic the Hedgehog
ROM. Change SMPS Type to Sonic 1. Now click SMPS2MID, type the name of the
General MIDI file you wish to create and click "Save".

Open the MIDI sequence file in a MIDI editor (such as SONAR). We will have to
configure our channels to properly interface with the TX81Z.

Set the FM tracks to use channels 1, 2, 3, 4, and 5 respectively. Mute all
other tracks. Set the output on each channel to the port you have connected
to the TX81Z.

To play the song properly through the TX81Z, ensure that the TX81Z is set to
Performance Mode and using the performance you created before starting the
MIDI sequence.

It is important to understand that the TX81Z doesn't switch voices quite as
quickly as the Sonic games, so the music may stutter when voice change events
occur. This is an unfortunate limitation to the hardware. However, the fewer
voice change events that occur in a short period of time, the better it will
be and the less noticeable any stuttering will be.


There you have it! I hope someone out there gets something useful from this
guide. I learned a lot from this experiment, and I hope you did too. I want to
give special thanks to Fuzzbuzz and ValleyBell for your tools that helped make
this experiment possible.

This post has been edited by saxman: 30 July 2011 - 02:55 AM

#2 User is offline MarkeyJester 

Posted 29 July 2011 - 10:19 AM

  • The architect of the universe, didn't build a stairway, leading nowhere.
  • Posts: 1832
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
Ah I see the modulation is slightly off, this is pretty cool though, sounds rather accurate too =D

#3 User is offline saxman 

Posted 30 July 2011 - 02:56 AM

  • Oldbie
  • Posts: 2625
  • Joined: 08-April 04
  • Gender:Male
  • Location:United States of America
  • Wiki edits:136
Update: conversion guide posted! See top post.

#4 User is offline ValleyBell 

Posted 30 July 2011 - 02:14 PM

  • Posts: 228
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
To begin, run the program and click "Open File". Select the Sonic the Hedgehog
ROM. Change SMPS Type to Sonic 1. Now click SMPS2MID, type the name of the
General MIDI file you wish to create and click "Save".

I you want to note that it is not neccessary to change the SMPS Type to Sonic 1. The autodetection works fine as long as you don't use a hacked ROM. (e.g. Sonic 2 with Sonic 1 sound driver)

Also smps2mid knows currently just modulation on or off. (That's why the modulation is way too strong.) It will be better in the next smps2mid.

Page 1 of 1
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users