don't click here

MIDI player for the Sega Genesis

Discussion in 'General Sega Discussion' started by nineko, Jan 5, 2009.

  1. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    So I found this thread on spritesmind. It turns out that Davis Cup World Tour Tennis (from now on, I'll refer to it simply as "Davis") uses standard MIDI files. I checked, and guess what -- that's true.
    I quickly wrote yet another tool to extract those MIDIs, and here they are.
    They are standard MIDI files for the most part, but some players may refuse to open them because of some additional data at the end, like a lot of padding 00s I was too lazy to remove, and a chunk which probably contains the YM2612 voices in some format.
    So, they have a regular MThd midi header, and regular MTrk midi tracks; they seem to use channels from 1 to 6 or less (with 6 being the drums -- change it to 10 if you want to replay them on a normal GM player), <s>and from what I've seen they use MIDI instruments 0 to 5, which will all render as various kinds of piano in a normal midi player, but are probably replaced by proper voices when in-game</s>; additionally, most of those MIDIs seem to have all the instrument changes in a track separate from the main ones, which is somewhat uncommon to my knowledge, though perfectly legit. After those tracks, there's a weird chunk labeled as &quot;Nstr&quot;, &lt;s&gt;which I believe contains the voices in some format, but this is speculation&lt;/s&gt;.
    And yes, it is possible to put custom midis into this, with the obvious limit that each channel must be used monophonically; drum definitions seem to be compliant with the midi standard. This is a modified Davis rom with the Tetris song playing on the title screen. Keep in mind that the tempo and the instrument are completely fucked up, and that this is missing the PSG channels. But take it as a proof of concept.

    I don't plan to do much more research over this though.

    Update 1: I changed the test rom to use the Tetris song, much better.
    Update 2: The Nstr chunk doesn't contain voice definitions. It contains FM drums definitions, since drums aren't playing on DAC. Without that chunk, the drums don't play.
    Update 3: How voices are changed is still beyond me. But the MIDI instruments don't need to be in the 0-5 range.
     
  2. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Next: MP3 player for the Sega Genesis.

    I mean, seriously, another thread about a game using a standard music format? How many cases do you plan to find? =P
     
  3. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    The list is on the spritesmind thread I linked to in my first post. And I'm done, because nobody cares.
     
  4. muteKi

    muteKi

    Fuck it Member
    7,850
    131
    43
    Very interesting indeed -- I even see something like a standard wave player, though I'm not sure what to make of that fact's significance, since I thought all samples were in a PCM form anyway.



    I don't think that an mp3 player on Genesis would work though, because of the decoding involved -- rather processor and memory intensive. :P
     
  5. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    2
    18
    Estonia, Rapla City
    T-04YBSC-A !
    Glass Breaker MD for example uses plain WAV files for sound effects and voices. 8bit unsigned 8KHz mono WAVs.

    You can play MP3s on MD, just don't expect realtime playback, more like 1 second of sound, minute of silence and so on :v:
     
  6. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,218
    965
    93
    Long-term happiness
    It's not the best MIDI player in the world, but yup, it works. =P Nice work!
     
  7. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    I linked to a new rom in my first post, with a much better sample MIDI in it (Tetris).
    Apparently the midi interpreter is better than I thought.
    Also, the weird "Nstr" chunk isn't for the voices as I thought: it's for the drums, since they are on FM and not on DAC.
    This implies that now I don't have a single clue about where the voices are stored.

    edit: thanks Tweaker for splitting the PCM discussion out of this thread :)
     
  8. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,218
    965
    93
    Long-term happiness
    You're right, that IS much better. =P