mid2smps

Discussion in 'Technical Discussion' started by ValleyBell, May 22, 2011.

  1. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    Latest build:
    mid2smps 0.3.5 binary, source (Visual Basic 6), MIDI driver binary, source

    SMPSPlay with configuration files for SMPS preview


    Original post
    Today I present you the opposite tool of smps2mid: mid2smps.

    You can download the tool with some example files here.
    Demo songs are: FF4 Boss Theme, The Final Countdown, Tales Of Phantasia: Boss Theme

    Features:
    - full support for Pan, PitchBend and Tempo changes
    - support for volume changes via note velocity and Main Volume controller (no Expression-Controller)
    - support for ymx instrument files
    - per-channel looping (with Controller 111, value 0 is loop start, 1-127 is loop end)
    - force E7 flag between notes (Portatemento Controller 65, Off <=63, On >=64)
    - export to binary smps-file or directly into a ROM

    How to use:
    1. [optional] load a ROM (recommended for quick testing) and select the song you want to overwrite from the list
    2. load YMX Instrument file (must only be done once)
    3. set Tick/Qrtr and TempoDiv values, if wanted
    4. click MID2SMPS

    Notes:
    - The tool will NOT ask you if you want to save the ROM. It will just silently overwrite the data.
    - Instruments are assinged in order they are used.
    - You <I>can</I> convert files without loading any instruments. It just won't attach any instrument data to the smps file.
    - Currently the channel mapping is hardcoded. See table below:
    Code (Text):
    1. MIDI   SMPS
    2.  1-5  FM 1-5 (no 6th FM channel)
    3.   10  DAC and PSG Noise
    4. 11-13 PSG 1-3 (3rd channel used for noise)
    5.   14  PSG Noise (for additional controllers)
    -Drum mapping:
    DAC Drums: 2x Bass Drum, 2x Snare Drum, Clap, 2x Cymbal, all Toms
    Noise Drums: all Hi-Hats, 2xRide Cymbal, Ride Bell

    - PSG instrument selection is done with Bank Select LSB. An (ignored) patch change message must follow the Bank Select message to confirm it.
    - Modulation isn't yet implemented
    - only Sonic 1 support (will care about the others later)
    - The conversions are quite unoptimized. I'll write an optimized sometime in the future.

    Thanks to:
    - all the people who contributed to the Music Hacking Guide
    - nineko for the tempo calcuation algorithm
    - Oerg866 for the SMPS Player and info about the PSG envelopes (that helped me to make the example files)
    - Rob Jinnai for notes on SMPS flags
    - Tamkis for making a terrible FF4 Boss conversion that convinced me that I had to make a better one (that's why I wrote mid2smps)

    The Music Hacking Guide has quite some misinformation that caused me trouble.
    I took some notes and will correct these things.

    Now listen to the demo files, try the tool and comment! (tool and demo files)

    EDIT: Added notes about demo songs, volume change support and thanks to Tamkis
    EDIT2: Updated the tool with instrument editor.
    EDIT3: added link to mid2smps 0.3 bin+src+driver
    EDIT4: Added SMPS preview package.
     
  2. Tweaker

    Tweaker

    Misfits
    12,389
    0
    0
    Holy fuck. HOLY FUCK.

    I FUCKING LOVE YOU.

    EDIT: Will you be able to add velocity/volume change support? That would be fantastic.

    Also, re:the music guide, I haven't updated it in years and other people have discovered nuances in the SMPS engine that surely exceed my own knowledge. Anything you or anyone else could do to make that document more coherent, accurate and easy to understand is more than welcome in my eyes.
     
  3. Aerosol

    Aerosol

    FML and FU2 Member
    10,259
    2
    18
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Someone explain this to the layman.

    I can make a midi and it can go ingame just like that?
     
  4. amphobius

    amphobius

    where are the japanese shaman girls, lintahlo? Member
    FUCK FUCK FUCK.

    All I need is x3v and tfi support and I'll be game to move away from XM files forever.

    Oh, and .asm output. Certainly I'll want that.
     
  5. Spanner

    Spanner

    The Tool Member
    3,206
    0
    16
    United Kingdom
    Sonic Hacking Contest
    Well this'll certainly help for those who prefer MIDI over XM. Now, if you can produce a layout similar to XM3SMPS, this'll be a lot better.
     
  6. Oerg866

    Oerg866

    Tech Members Tech Member
    This is very nice indeed!

    Great to see new evolvements in this sector.

    And hopefully, this will spawn some more decent stuff finally :)

    Cheers!

    EDIT: Oh, and:

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->- Oerg866 for the SMPS Player and info about the PSG envelopes (that helped me to make the example files)<!--QuoteEnd--></div><!--QuoteEEnd-->

    Thanks, great to have (indirectly) helped :D
     
  7. Irixion

    Irixion

    Member Member
    Massive boner right now.
     
  8. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    I made some small edits to the first post. Volume changes work. (one of the things that caused me some headache)

    <!--quoteo(post=588680:date=May 22 2011, 10:51 PM:name=AerosolSP)--><div class='quotetop'>QUOTE (AerosolSP @ May 22 2011, 10:51 PM) <a href="index.php?act=findpost&pid=588680"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I can make a midi and it can go ingame just like that?<!--QuoteEnd--></div><!--QuoteEEnd-->Yes, that works, although it currently supports only plain Soinc 1 and the SMPS Player.

    <!--quoteo(post=588688:date=May 22 2011, 11:00 PM:name=SOTI)--><div class='quotetop'>QUOTE (SOTI @ May 22 2011, 11:00 PM) <a href="index.php?act=findpost&pid=588688"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Well this'll certainly help for those who prefer MIDI over XM. Now, if you can produce a layout similar to XM3SMPS, this'll be a lot better.<!--QuoteEnd--></div><!--QuoteEEnd-->I'll make a proper layout later. This version is enough for basic conversion, but I want it more customizable. (drum mapping editor etc.)
    nineko said he'd write a new YM2612 instrument editor. Until then you can use <a href="http://info.sonicretro.org/Sonic_One_Music_Editor" target="_blank">SOME</a>. It's quite buggy, but has a voice preview function.
     
  9. nineko

    nineko

    I am the Holy Cat Tech Member
    <!--quoteo(post=588696:date=May 22 2011, 11:31 PM:name=ValleyBell)--><div class='quotetop'>QUOTE (ValleyBell @ May 22 2011, 11:31 PM) <a href="index.php?act=findpost&pid=588696"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->nineko said he'd write a new YM2612 instrument editor<!--QuoteEnd--></div><!--QuoteEEnd-->I didn't start yet, but I will look into this soon. You should know I'm a terribly lazy person, my "yes I will do it" usually implies a procrastination of a couple of weeks.

    But seriously I'll try to get something done soon.

    *opens VB*
     
  10. Varion Icaria

    Varion Icaria

    He's waiting.... Tech Member
    1,010
    0
    0
    S4: Cybernetic Outbreak
    This is rather interesting it may make my deal with music a lot easier now. Yes this and other things have caused a slight preview of my return. Keep up the great work everybody!
     
  11. Oerg866

    Oerg866

    Tech Members Tech Member
    Valleybell: If you want you can use the Instrument editor I wrote in VB6 until nineko finishes his. Only thing missing is a proper preview function. (Right now, it uses Rob Jinnai's C Player for previewing, which is using a very incomplete and inaccurate YM2612 core).

    Cheers!
     
  12. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    0
    16
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    I can't wait to try this. Also, whats the deal with ymx? I don't even recognize that format. Is that for FM instruments? How do I make those? All I got are tfi and vopm formats.
     
  13. nineko

    nineko

    I am the Holy Cat Tech Member
    I can answer this.
    <a href="http://segaretro.org/YMX" target="_blank" style="background: url(http://segaretro.org/segaret_icon.png) right no-repeat; padding-right: 20px; border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">YMX</a> was the instrument format used by Saxman's <a href="http://info.sonicretro.org/Sonic QX" target="_blank" style="background: url(http://info.sonicretro.org/images/5/50/Reticon.png) right no-repeat; padding-right: 20px; border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">Sonic QX</a>, the first tool dedicated to music editing. It is indeed an outdated format, although still perfectly functional. You don't need to worry about that for much longer, anyway, as I am working on a new instrument editor specific for this converter (and my own mid2vgm), and it's coming along quite nicely, I can spoil some features here: it will let you create a bank of FM instruments, importing them from existing files in various formats (ymx, tfi, mvs, ... basically all the formats supported by xm3smps), and creating/editing them by hand. Once you have a bank of several FM instruments, you map them to the 128 General Midi instruments. Multiple General Midi instruments can be mapped to the same FM instrument so you won't need a complete bank of 128 FM instruments to convert your songs, even if that would be preferable to get more variety of course. I hope to have something releasable within a couple of days, stay tuned.
     
  14. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    0
    16
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    Well thank you nineko, that does answer my question, and I look forward to those conversion tools, except this mid2smps tool is completely useless since clearly there is no way to make ymx instruments or rip them from games/songs. Thus the ymx import button is a waste of space and all midis converted will result in silence.
     
  15. nineko

    nineko

    I am the Holy Cat Tech Member
    You can create YMX files with the aforementioned Sonic QX, and xm3smps has an option to export ymx files as well.
    Anyway, as I said, within a couple of days I'll release a powerful dedicated instrument editor.
     
  16. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    0
    16
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    Alright then I'll try to work with those. Thanks for the advice.
     
  17. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    I used the <a href="http://info.sonicretro.org/Sonic_One_Music_Editor" target="_blank">Sonic One Music Editor</a> to create ymx-files.
    It's voice preview feature is nice and comes with some instrument libs, but it has some bugs I had to learn about. (e.g. the button "Add to Bank" below the "Voices to Import"-list copies an empty instrument)
     
  18. Eduardo Knuckles

    Eduardo Knuckles

    Not a loved one, but the most hated person. Member
    409
    1
    18
    Someplace somewhere
    Project S.A.M.G.
    HOLY CRAP!! What the hell is this tool?? I think I'm inside a illusion. This is FUCKING, FUCKING GREAT. Finally my times working with XM files are gone. This is absolutely perfect!
     
  19. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    0
    16
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    Every time I use this tool, it seems to corrupt the rom. When loading via emulator, I get nothing but a red screen. (if I remember right, that's a problem with the checksum..?) I know my rom is clean. I even tried using just the example files, and it still does this.
     
  20. ValleyBell

    ValleyBell

    Tech Members Tech Member
    236
    0
    0
    researching SMPS sound drivers
    You can circumvent this if you make a save state at the Sega logo of a clean rom and load it with the modified rom.
    For some reason, the AutoFix Checksums feature of Kega Fusion doesn't work for me with Fusion 3.63. The checksum fix of Gens/GS r7 works, so I recommend to use this emulator.