Sonic and Sega Retro Message Board: mid2smps - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 5 Pages +
  • 1
  • 2
  • 3
  • 4
  • 5
    Locked
    Locked Forum

mid2smps with proper PitchBend support, and MIDI driver

#31 User is offline ICEknight 

Posted 08 June 2011 - 06:58 AM

  • Posts: 11051
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
Does that instrument assignment mean that it will be possible to have this program automatically choose the instruments that sound more similar, each time you convert from one format to the other?

Not sure if I understood that one correctly...
This post has been edited by ICEknight: 08 June 2011 - 06:59 AM

#32 User is offline nineko 

Posted 08 June 2011 - 07:24 AM

  • I am the Holy Cat
  • Posts: 5648
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251
No; let me try to explain it again.
You know that the General MIDI standard defines 128 instruments: Acoustic Grand Piano, Bright Acoustic Piano, and so on. These instruments are used in MIDI files, and are selected by "Program Change" events (MIDI event $Cx). Of course newer standards such as the Roland GS and the Yamaha XG expand the instrument selection by using two MIDI controllers, but this doesn't matter for what we're going to do here (e.g. we can consider Roland GS's Synth Bass 3 to be instrument 38 just like Synth Bass 1); if you want to know more about this I'll be glad to talk about it, but I don't want to make things harder than what they are.
Back on topic, this fixed set of instruments is different than what we have in XM files, where everyone can use random instruments numbered in any way, which means that all the instrument mappings can be done once and for all instead of being redone every time you convert a file like you did with XM files, which is why the instrument assignments are now stored in the GYB file itself unlike X3V files which only contained instruments without any assignment.
So, once you create a GYB file, you might as well keep it forever and forget about it. What you have to do, once, is to populate it with your FM instruments, importing them from various formats such as TFI, and then you manually assign those FM instruments to one (or more) GM instruments.
Say that one of the instruments you imported is "My super happy Synth Bass!.TFI"; of course you want it to be used for Synth Bass, so you select "Synth Bass 1" from the GM instruments list, and then you select "My super happy Synth Bass!.TFI" from the FM instruments list. In this way, every time you'll convert a MIDI file which uses Synth Bass 1 (or Synth Bass 3, or any other GS/XG variations over that), you'll get an SMPS file which uses My super happy Synth Bass!.TFI
Of course you don't need to assign all the 128 GM instruments to something, as some of them are rarely used if at all, and I doubt you're going to convert a MIDI file which uses the Helicopter instrument or something; focus on the ones you're more likely to need, and keep in mind that you can use the same FM instruments for several GM instruments if you're lazy (you can assign My super happy Synth Bass!.TFI to Synth Bass 2).
Vice versa, the fact that you can store 255 instruments in a GYB file also allows you to keep spare ones in case you need more variety, so if you feel like using "Another great Synth Bass!!!.MVS" for a particular conversion, all you have to do is to change the assignment from the aforementioned comboboxes.

I hope this is a bit more clear.

edit: here you are a couple of screenshots of the instrument editor:

The normal view. You can create new instruments, or import them from files. When you click on an instrument from the list (in this case, "Pan Flute"), it shows you all the parameters (detune, multiple, ...) for that instrument, which can be edited and previewed on the fly. This screenshot also shows that the GM instrument "Electric Bass (pick)" has been assigned to the FM instrument "Picked Bass" (which you can't see on the list because it's somewhere offscreen, but it's there, otherwise it wouldn't show up in the assignment combobox).


When you import an instrument, you can view its parameters and preview it, but you can't edit it until it's imported. You have the option to mass-import all the instruments from an YMX or a X3V file.

This is basically it. I am going to upload those pictures on the wiki and write a small article about the editor as soon as the site will be responsive enough to let me preview the page in a decent amount of time.
This post has been edited by nineko: 08 June 2011 - 08:51 AM

#33 User is offline Mr Lange 

Posted 12 June 2011 - 09:59 PM

  • A wise guy eh. I know how to DEAL with wise guys.
  • Posts: 1287
  • Joined: 27-August 10
  • Gender:Male
  • Location:The Land of Waldos
  • Project:Sonic Utopia, Sonic Overture
  • Wiki edits:1
You've created the most useful program for another program ever.

#34 User is offline TmEE 

Posted 13 June 2011 - 03:29 AM

  • Master of OPL3-SA2/3
  • Posts: 1726
  • Joined: 06-January 08
  • Gender:Male
  • Location:Estonia, Rapla City
  • Project:T-04YBSC-A !
  • Wiki edits:11
Nineko, you said you wanted all the parameters to be very descriptive.... have TL use decibels instead of just number. 1 step is 0.75db starting from zero. But other number alone values should be sliders to maximize productivity.

#35 User is offline ValleyBell 

Posted 22 October 2011 - 10:52 AM

  • Posts: 234
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
Posted Image

#36 User is offline ValleyBell 

Posted 07 September 2012 - 08:39 AM

  • Posts: 234
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
I doubt that I'll work in it soon, so I'll just leave this here: mid2smps 0.3 beta

Updates:
- I rewrote some parts of the code and fixed many bugs v0.2 had.
- There is now a mappings editor (including FM drums), an editor for the DAC sound list and a PSG editor.
- There's a nice tempo calculator that shows you all tempi of the currently loaded MIDI and their respective value + BPM of the converted SMPS.
- The tempo calculator window features a frame calculator. (You'll need that, if you want to play with NoteFill and Modulation Delay controllers.)
- I integrated 2612edit (it can import VGMs/VGZs now, btw)
- You can use MIDI Controllers to make custom Modulation effects now. (See the included controller txt file and the Music Hacking Guide for reference)
- I added a range limiter for SMPS notes (to prevent reading frequency values from the code section)

Bugs and Notes:
- The range limiter may limit too much, depending on the transpose value of the instruments. (will be fixed in final version)
- The instrument editor doesn't share its instrument data with mid2smps yet. (will be fixed in final version)
- If you have FM drums on a channel, you can't have normal notes on it. (Well, you can, but you need to use extra instrument changes.)
- The MID2SMPS button is a shortcut for File->Open + File->Save after each other.

Also included:
- Midi Splitter: Helps you to split accords into multiple tracks.
- SMPS Optimizer: I recommend to run this on finished songs, because mid2smps writes unoptimized files. This should also work on xm234smps output.

I recommend SMPSPlay to test the songs, btw.

Have fun!

#37 User is offline redhotsonic 

Posted 08 September 2012 - 06:38 PM

  • Also known as RHS
  • Posts: 1584
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24
Nice work, it's good to see you're still working on this and making an alternative way from using XM's. I'm still going to use you for the music in S2R though, don't think you can escape that easily =P

#38 User is offline n00neimp0rtant 

Posted 25 January 2013 - 02:48 PM

  • EYES ONLY
  • Posts: 262
  • Joined: 24-January 08
  • Gender:Male
  • Location:South Park, PA
  • Project:Creation Kit (Skyrim mods and patches)
  • Wiki edits:1
I've spent all day searching for an answer but I can't find one: I'm completely new to music hacking and I have no idea where to inject the output .bin file into the ROM

#39 User is offline ValleyBell 

Posted 26 January 2013 - 12:21 PM

  • Posts: 234
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
In an older version you could inject the songs directly in a ROM, but since the exported files are very large, I removed that feature. (The chance of overwriting sound driver code was too high.)

I recommend using a disassembly and replacing one of the sound\music##.bin files. That works fine and you don't need to care about the ROM checksum either.

#40 User is offline n00neimp0rtant 

Posted 29 January 2013 - 10:41 AM

  • EYES ONLY
  • Posts: 262
  • Joined: 24-January 08
  • Gender:Male
  • Location:South Park, PA
  • Project:Creation Kit (Skyrim mods and patches)
  • Wiki edits:1
Thanks VB. It seems that I'm catching onto this music hacking thing relatively fast thanks to your (and Nineko's) tool. Got a couple more questions for you, if you don't mind:
  • I was able to use a tool called "Sonic One Music Editor" to dump all of the voices for any S1 song into a single .ymx file. How can I do this with S2 and S3K? Or, better yet, are there pre-dumped voice banks available around anywhere? (I've looked everywhere I could but couldn't find any)
  • I've got mapping MIDI instruments to FM/DAC channels totally figured out, but I'm quite clueless about the PSG channels. How do I map these to a MIDI instrument?


#41 User is offline ValleyBell 

Posted 05 February 2013 - 04:57 PM

  • Posts: 234
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
xm3smps/oerg comes with a large instrument library in x3i format, which you can import in 2612edit.

In the current version you need to use the Bank Select LSB controllers (number 32) to set the PSG instrument you want to use and a normal instrument change directly after it to confirm the selection.
In the version working on it's a bit easier, because the instrument number sets the PSG instrument, but I don't plan to do additional remapping features.

#42 User is offline ShadowsofYesterday 

Posted 22 June 2013 - 03:17 PM

  • I have no idea what's going on.
  • Posts: 169
  • Joined: 16-June 08
  • Gender:Female
  • Location:Fort Wayne, IN
  • Project:Sonic and the Magic Hat
I noticed that with this tool, my "DAC" was just shoved onto the FM6 pointer in the header, and the actual DAC pointer was essentially told to go eff itself. If only DAC instruments are being used on FM6, shouldn't it just use the proper DAC pointer? It doesn't make a whole lot of difference unless you want to go tweaking it in a hex editor, in which case it's just a bit of an annoyance.

All around a rather useful tool though, it's what really got me into music hacking, before I learned how to hex.

EDIT: What'd really be nice is if I could just choose what channels to toss everything on, rather than it being automated. Perhaps with an option of automation, for those less gifted in the ways of the SMPS.
This post has been edited by ShadowsofYesterday: 22 June 2013 - 10:14 PM

#43 User is offline ValleyBell 

Posted 23 June 2013 - 03:11 PM

  • Posts: 234
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
Sorry, I don't understand your exact problem with the DAC/FM6 pointer.

If you set the mappings correctly, the DAC notes end up on the first track. (The pointer to that track is at $06.)
The only difference to most other SMPS files is, that the actual data of all tracks are sorted by their position in the header, so it is DAC, FM1..6, PSG1..3.
I most SMPS files (especially the ones of most MD games), it's FM1..6, PSG1..3, DAC.


About channel mapping: If I would want to add a decent channel mapping feature, I would need to care about chords. (which can be compilated to handle and may generate messy SMPS files.)
Like I did in my mid2vgm tools, I decided to keep it simple and hardcode the MIDI channels to certain SMPS channels. (I know that's a questionable choice.) You'll need to use a MIDI editor in 99% of all cases to take care of making all channels (except for the drum channel) monophonic anyway.

#44 User is offline ShadowsofYesterday 

Posted 23 June 2013 - 10:10 PM

  • I have no idea what's going on.
  • Posts: 169
  • Joined: 16-June 08
  • Gender:Female
  • Location:Fort Wayne, IN
  • Project:Sonic and the Magic Hat

View PostValleyBell, on 23 June 2013 - 03:11 PM, said:

Sorry, I don't understand your exact problem with the DAC/FM6 pointer.

If you set the mappings correctly, the DAC notes end up on the first track. (The pointer to that track is at $06.)

For me, that's not the case. Bytes 06 and 07 lead to one byte before where bytes 01 and 02 lead to, to an F2 instruction (basically nullifying the DAC channel), and then bytes 1E and 1F (the FM6 pointers) go to the place where my drums play, as if it's an FM channel. This also has the effect of canceling out the percussion if the 1up jingle ever plays, due to the obscure bug already present in the games.

EDIT: Disregard, there IS a way to put drums on the DAC channel using Mid2SMPS. I just wasn't noticing it. Well, proceed with the thread as normal then.
This post has been edited by ShadowsofYesterday: 24 June 2013 - 05:06 PM

#45 User is offline ValleyBell 

Posted 04 July 2013 - 03:49 PM

  • Posts: 234
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
Well, many months have passed since I released the mid2smps 0.3 beta. Many months where I actively used mid2mps, fixed lots of bugs and added a few new features.

But here it is: mid2smps 0.3 final
You can download the binary or the source (Visual Basic 6). Or both :P
Also there's something I wrote in October 2012 - a MIDI driver that runs a recreation of an SMPS sound engine including all of its possibilities and limitations: the mid2smps MIDI driver, compatible with every MIDI sequencer you have.

The mid2smps package also includes 2612edit, Midi Splitter and SMPS Optimizer.
For further information and a detailed feature list, read the readme.

Enjoy!

  • 5 Pages +
  • 1
  • 2
  • 3
  • 4
  • 5
    Locked
    Locked Forum

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