fbpx


The MIDI Forum

  Friday, 19 November 2021
  25 Replies
  10.8K Visits
37
Votes
Undo
  Subscribe
I have been working on a project for a while. I am converting Super Nintendo (SNES) SPC audio files in to MIDI files, mainly using a program called spc2midi 0.023j

It creates the MIDI files by interpreting the input to the SNES sound chip (SPC700) in to MIDI data. An SPC file is a rip of a specific game's sound code and samples packaged to be playable in an audio player. This is not a direct 1:1 MIDI conversion, as the SPC700 uses custom sound programs per game, so spc2midi has to do some wizardry to get decent results, like running a FFT transform on the audio samples in an SFC file to make a best guess at the correct pitch for instruments. It also does its best to determine if a sound should be a melodic instrument (more than one pitch in the original file) or percussion (single, repeated pitch). Fortunately, many other things do generally match up, like volume control, attack, decay, and, perhaps very helpfully, the audio is placed on a maximum of 8 channels.

The process is not perfect, and the conversion software is old and hasn't been updated since 2004. I have to load each game audio file individually, make notes of which memory addresses each file uses for instruments, then cross-reference with the actual SPC file in my player of choice (Winamp, Timbres Of Heaven soundfont) to try to find a MIDI instrument that best matches up with the sound from the game. I have a spreadsheet of most of the games I wish to convert, with 7/13 complete for data. Some games the instruments need the pitch manually adjusted per track (one track the pitch might be fine, another might require a drop of 60 semitones). A few games I have a tossup between which instrument to use for a particular address. It has been a very time-consuming process. Each SNES instrument needs to be properly selected as MIDI instrument or percussion (not always correctly auto-determined), its attack and decay enabled, actual MIDI instrument assigned, pitch and/or volume set (if required), and the song length needs to be set for the export. Nothing can be saved as a preset for the next file, so it all has to be manually redone every time.

Now to the actual question:

** Recommendations on what I can do to clean up these files, and make them more presentable in a MIDI editor?

My current process will be as follows:
0 - Figure out all of the instrumentation
1 - Export MIDI file using spc2midi
2 - Repair MIDI file using Anvil Studio's repair option
This removes some unnecessary note off events, fixes some out of range values, and a few other things
3 - Delete all extra unused channels from the MIDI file in Anvil Studio

And that's what I have at the moment. The resulting files sound good, but they are visually not ideal for editing, as they do not line up to normal measures on a piano roll in an editor. I tried using Anvil Studio's "quantize" option, but it didn't seem to make a difference. There was a comment when I posted a work-in-progress file in a previous thread about an excessive amount of pitch bending, but that is inherent to the way that particular game sound engine was programmed, and may be a common "feature" of these files when they are finished.

This process also kicked off my desire to write my MIDI instrument changer, quattj's MIDI-MIS (which I started working on in March, and still have some work to do on, since I went back to work full time over the summer so it fell by the wayside. And my actual ORIGINAL intent was to write my OWN spc to MIDI utility, but then I learned what I didn't know :p ). I will be using my instrument changer to make further instrument changes on the "finished" files, as spc2midi can only assign GM instruments, and I have found I can get better results using GS or XG instruments. For example, many SPC tracks use a Euro Hit sound, which is only available on higher bank numbers in place of the standard Orchestra Hit, and some games will sound a lot better using alternate drum kits. (This will require me to finish my GS/XG SYSEX Reset insertion code)


I'm including a screenshot of spc2midi English translation (I'm using the Japanese version because it is newer) and my spreadsheet so you can see some of the process. The numbers on the left are the memory addresses of the instruments. The numbers in the grid are manual pitch settings. I'll also follow up with a set of MIDI files if I finish one of the games any time soon. I've included the first track from the game from the spreadsheet so you can see the current "end result" (both SPC and MIDI). When all is said and done, I plan on creating mp3s from the finished files and uploading them to YouTube, plus uploading the actual MIDI files (and maybe spreadsheet) on my Google Drive for other people to use/modify/enjoy.


If you are interested to see the inner workings of an SPC file, this player is very nice/accurate, and has a bunch of different display modes that can show you pretty much everything real-time, and you can visually see while it's playing how things can be interpreted in to MIDI.
https://github.com/dgrfactory/spcplay
with a huge archive of SPC files at
https://www.zophar.net/music/nintendo-snes-spc

And if you want to get Super in to it (see what I did there??)
spc file specs
http://snesmusic.org/files/spc_file_format.txt
and SPC700 specs and reference
https://en.wikibooks.org/wiki/Super_NES_Programming/Loading_SPC700_programs
https://wiki.superfamicom.org/spc700-reference
4 months ago
·
#15215
0
Votes
Undo
I found a Cakewalk INI file setting that will avoid most of the note movement issue. I posted a reply in your Cakewalk Forums thread.

The attached text file has some steps to do a fadeout in Sekaiju. (How to draw a fadeout line in one track and duplicate it to the other tracks, or just draw a fadeout line in each track.) If you are only doing one file, the Sekaiju steps are a little more work than the Cakewalk method. However, I reviewed this entire thread to get up to speed on your project, and I see you want to edit many MIDI files. Using the Sekaiju steps to make a fadeout in many MIDI files might be not fun.

sekaiju-fadeout.txt
4 months ago
·
#15216
0
Votes
Undo
Very thorough breakdown indeed!

As mentioned previously, in your MIDI file, the 8th to 11th note tracks are all for Channel 10 percussion sounds. Some of these tracks contain various volume events before the first note. Perhaps those volume events were originally intended to affect Channel 10 notes found on the other tracks.


For this particular one, those were all part of the original in-game Track 8, which is why they all bear the same name. Because of the way I have to save the percussion separately to retain the dynamics, it looks like the volume events (mostly?) duplicate between all of the former pieces of Track 8. I thought Anvil Studio would compensate when merging them together. Perhaps it has a "merge track" option that might neaten it up a bit.

I actually wouldn't mind Cakewalk adding a measure of "silence" at the beginning, if it could be proven that it was consistent across all tracks, but I'm not sure all notes and dynamics ended up where they should be, just shifted by one measure? I'd have to give it a realllll careful listen...
4 months ago
·
#15217
0
Votes
Undo
I found a Cakewalk INI file setting that will avoid most of the note movement issue. I posted a reply in your Cakewalk Forums thread.

[...]

Using the Sekaiju steps to make a fadeout in many MIDI files might be not fun.]

I'll check out the Cakewalk file when I get a chance.

As for the Sekaiju method, I wish it were easier ;) I was originally using Sekaiju to do the percussion portions, but even for that it was roughly the same process and number of steps to grab the percussion from the "old track", move it to the percussion track, and convert it in to actual percussion (not to mention all the additional times I would forget a key step and have to redo it all over again when I messed it up). For the amount of times I have to do this, a more efficient method is a must. I'm glad I figured out how to do that part in Anvil Studio at least.
4 months ago
·
#15253
0
Votes
Undo
Given that Cakewalk adds a setup measure to a file on purpose (Thanks for checking, Bavi) I may end up leaving them mostly as is after running them through Cakewalk. I know that currently, it usually takes my softsynth a split second to load all of the appropriate patches and whatnot, so my tracks don't always play smooth/correctly at the very beginning, so this added "setup measure" may actually be a good thing. Additionally, since I am first creating the files with a very incomplete piece of software, and then editing it multiple times with various other pieces of software, it seems maybe having Cakewalk rearrange the events may be helpful as well to make the file more... logical? It also appears that Cakewalk makes it easy to rename tracks and other naming info, like song name, album, etc. So I will probably end up using it as the second-next to last step in my process. I ran a repair check with Anvil Studio on the resulting file after Cakewalk was done with it, and it found and removed some extra unneeded stuff created by Cakewalk (I forgot what specifically, but I think a few pitch bends, some expressions that ended up after the last note of the song, maybe a few other little things). And then Sekaiju as the final step to remove all of the sequencer specific meta data that Anvil Studio insists on putting all over every file.

So I guess my next step is to try it out on the whole soundtrack and see if I can make my first official release for the SNES MIDI Remaster Project!

Stay tuned...
4 months ago
·
#15344
0
Votes
Undo
Feel free to check out my first SNES MIDI Remaster Project WIP video upload!

I am playing my WIP MIDI files back using a program called MIDITrail, and recording the video with XBox game bar set at the highest settings it will allow. I'll probably have this up until I release my first officially complete soundtrack.

Currently, there are still a few issues with the ends of some of the tracks. I'm using Bavi's script to add the fadeouts.
https://midi.org/forum/15301-applying-expression-to-expression

A couple of them I must not have dragged the expression controllers far enough, because there is a quick burst of sound at the very end. I'm also having an issue where certain tracks are getting extended past the point where I am snipping them. I'm hoping it's just a setting in Cakewalk that I have to turn on or off. Most of the time it doesn't make much difference, but one track is 5 seconds longer than it should be. I also need to update track names and such in the MIDI files, and do some miscellaneous cleanup. One song I had to use a combination of Bavi's expression-fadeout script on 5 of the tracks and manually selecting three tracks and applying the expression controllers, otherwise those three tracks never faded out.

I will be uploading a complete soundtrack video to my YouTube account for each game I finish. I will also be hosting the finished MIDI soundtrack files on my Google Drive, along with an instrument list for each song (via a screenshot from MIDI-MIS) and a description of the process used to create the MIDI files and video from start to finish.

SNES MIDI Remaster Project Test Super R-Type WIP
https://www.youtube.com/watch?v=1eELPMK-NcU
  • Page :
  • 1
  • 2
There are no replies made for this post yet.