fbpx


The MIDI Forum

  Friday, 19 November 2021
  25 Replies
  11K 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
1 year ago
·
#12178
1
Votes
Undo
Ahh, and the "Tempo" in the spc2midi screenshot is actually the pitch.

And I would like to know how I can add a fade to the end of each MIDI file, as that option was never implemented in the converter, and most songs should fade out at the end.
1 year ago
·
#12187
1
Votes
Undo
Hmm, and it seems there is still an issue I need to work around for a few of the tracks (songs).

Some things have volume too low (track 7a) so pieces of the music are missing (tuba) because the volume ends up becoming zero. To compensate, I raised the volume of all the instruments to 70 in the converter, which until a short while ago seemed to be a good solution. I am finding now, however, that doing so loses many volume differences that SHOULD be present, because all of the volume levels now get pegged at max instead of having variation. I tried backing it off, but even back down at 30 some instruments are maxing out and being squashed, so losing dynamic range, and any lower and I lose that one instrument again. It appears to be a problem with the emulation that occurs in the converter. The missing tuba sound should be mostly center-balanced in the stereo signal, but only the left side makes noise on part of it, at maybe half volume of the other tuba part that plays properly.

Is there some way I can use an editor (and recommendations) on fixing this tuba part? I'm guessing I'd need to isolate the instrument somehow and boost the volume and pan the sound more to center only on that part.

I can mute all of the other instruments in the converter and have a MIDI file that only plays the tuba, but combining it back in to the other file is not something I think I am currently skilled enough to be able to do, unless perhaps I put it on a new track in the MIDI file?
9 months ago
·
#13662
0
Votes
Undo
Hi Jason, I'll be interested to hear how much success you have converting SPC to MIDI. That is a hero's journey. :D
It seems your questions are mostly about finding a powerful MIDI file editor, which is strangely hard to come by.
If you are on Windows, I recommend Domino or Sekaiju. These are old Japanese programs from the DTM era, but with some modern English translations.

Here is Domino in English:
https://github.com/Hans5958/Domino-English-Translation/releases

This program takes some getting used to, but it is very powerful with MIDI. You'll have access to the raw MIDI event list and can perform batch operations.

For getting the notes to line up to a note grid, your best bet is to just guess and check by doing a very precise Time Stretch (see attachment) until notes line up, and then do a quantize.

As for the fade out... this should be as simple as automating the Channel Volume (CC 07).
9 months ago
·
#13664
0
Votes
Undo
Hi Jason, I'll be interested to hear how much success you have converting SPC to MIDI. That is a hero's journey. :D

Haha, don't I know it :p

I currently have the instrumentation selection for 14 games 90-100% complete, and working on another 5, plus others I haven't started yet.

I created full MIDI file sets for 3 games so far (Axelay, Battletoads & Double Dragon, and Prince Of Persia), plus a handful of random ones here and there that were either too short to reliably "decipher" in the converter, or ones I wanted to listen to more extensively. (The only playback options it has are PLAY and PAUSE, so if the track doesn't loop, the only way to hear it "some more" is to save it or reload the file, and reloading resets all instruments to piano and bass drum. Boooo.). I haven't done any cleanup on them yet. I may still tweak the instrument choice a bit after I listen to them some more, and might have to re-do a few where I messed up the song length (generally trying to get in 2 loops of the song plus a 10 second fade, where appropriate).

A few things I've noticed as I've been going through all the tracks:
- Some games, mostly older/first gen SNES games have music that was most likely composed using MIDI and then converted to run in that particular game. I can tell by listening to the percussion, where certain very MIDI-specific things are present, such as a Low and High (Short and Long) Whistle. Super Mario Kart is a good example of this.
- Some games clearly were not scored using MIDI. There are a few metallic melodic percussion sounds that I am having difficulty replicating, particularly melodic snares and melodic cymbals. Currently many of the melodic snare sounds are being semi-replicated using Gunshot, usually pitch-shifted.
- Many newer games use memory swapping to replace sounds between tracks, so a memory address that might point to a trumpet in one track could be an organ in another.
- Some games use sound effects as part of the music, and those are generally difficult to replicate. One that I am actually quite surprised I was able to have sound fairly accurate is some of the higher pitched monkey sounds in the music for Donkey Kong Country. I believe it is the shamisen, along with whatever they did with note manipulation for the monkey sound. Donkey Kong Country, by the way, the most complicated one I have done, with 103 total memory addresses for instruments, and some of those having 2, 3, 4, 5, 6, 7, or 10 variations.
- I was hoping I'd be able to choose an instrument set and then just be able to use it for each track from a game, but usually at least one or more tracks (but not all) will require changing the pitch of at least one instrument for it to be correct. A lot of times it's a single octave (+12 or -12) but there are also a lot of -19,-24, -66, and random numbers of semi-tones, like -7, +5, and... err... -106. That's nearly 9 octaves lower than the pitch it auto-assigns, and lemme tell you, a tune being played 9 octaves too high ain't great!
- A few games I will definitely need to use some GS sounds, as the standard GM banks just can't give me satisfactory results. I may also need to use a few different soundfonts, as Timbres Of Heaven has a few sounds that are too harsh for certain soundtracks. My biggest "missing sound" for now if the EuroHit, which is a GS sound. OrchstralHit just can't cut it, a LOT. At least my MIDI instrument switcher (quattj's MIDIMIS) can change the GM reset that spc2midi puts in the file in to a GS reset.

spc2midi has opened every file I have tried. Super Turrican is giving me some weird volume issues because of how they made the instrument sounds in the game. If I enable the attack and decay, the main instruments all lose about 60% of their volume. However, VGMTrans will not open any file from this game so I can not compare the two version of midi files created from it.

I've decided that I will be creating mp3s of the final MIDI files and uploading soundtracks on YouTube. I also plan on having the MIDI file collections available for download for anyone who wants them. (I seem to have already mentioned this in the original post :p) I'll probably have a GM version of all of them, plus a better sounding GS version for those games that need it. I'm going to call it "The Great SNES MIDI Project", or similar.

I do already have Seikaiju, though I have thus far only used it for event viewing. I'll check out Domino. Looks promising. Anvil Studio has some cool features, but never seems to really be able to do what I actually need. I may request help from people in the future once I've got all of my MIDI files created.
9 months ago
·
#13678
0
Votes
Undo
I'm attaching those three aforementioned complete MIDI file sets, in case you're interested, plus other random files I have saved recently.

You can listen to some of the "challenges" towards the end of the Credits tracks in Axelay. It is a non-looping track, with only a single instance of one of the instruments, which is a "spaceship blasting off sound". The only way I could test variations was to save it and hope for the best. The first it just comes across as a "click". The second the pitch is wayyyyy too high. The third is as close as I can get it using GM.

I have one GM/GS test in the Super R-Type folder. The GM version uses Orchestral Hit. The GS version uses Euro Hit, as that is what it needs to be.

All SNES music makes extensive use of pitch bend, so your playback will need to support pitch bend (portamento) or it will sound awful.

For reference, I am playing back (and making all of my instrument selections) using Coolsoft VirtualMIDISynth with the Timbres Of Heaven SF2 3.94 soundfont.
You can compare to the original SNES music here (track names vary as I am using a different game dump to make most of them):
https://www.zophar.net/music/nintendo-snes-spc/axelay
https://www.zophar.net/music/nintendo-snes-spc/battletoads-double-dragon-the-ultimate-team
https://www.zophar.net/music/nintendo-snes-spc/prince-of-persia

plus the other random ones you can search for the specific game on
https://www.zophar.net/music/nintendo-snes-spc

(Oops, file is too big, splitting!)
9 months ago
·
#13679
0
Votes
Undo
Part 2 of split file
9 months ago
·
#13681
0
Votes
Undo
- Some games, mostly older/first gen SNES games have music that was most likely composed using MIDI and then converted to run in that particular game. I can tell by listening to the percussion, where certain very MIDI-specific things are present, such as a Low and High (Short and Long) Whistle. Super Mario Kart is a good example of this.

Except... I just found out the whistles are combined in to a single instrument, so I will have to painfully go through and re-assign 50% of the whistles in the MIDI file if I use the normal percussion whistle. *sigh*
9 months ago
·
#13768
0
Votes
Undo
I gave Domino a quick whirl to test it out. Still a lot to figure out with it, but it seems to have a fair amount of features that should be very useful for me. I particularly like the event list with corresponding parameter graphs that you can show on the bottom to easily adjust things like velocity, just by drawing a line where the notes are. I also found that you can easily switch an instrument track to percussion and vice versa, which is cool for some of the things I am doing.
9 months ago
·
#13784
0
Votes
Undo
[quotePost id="13678"]

All SNES music makes extensive use of pitch bend, so your playback will need to support pitch bend (portamento) or it will sound awful.


Jason, just a point I noticed in the above post, pitch bend is a controller that changes the pitch of the note up or down, whilst portamento is a feature that blends one note into the next.
Singers often use portamento to blend one note into another.
In MIDI implementation the effect is often used to cut off the attack portion of the waveform from the notes following the first.
Make sense?

JohnG.
9 months ago
·
#13785
0
Votes
Undo
Yes, perfect sense. I swear I knew that :p Now I'll have to check if it's actually using both, or just pitch bend. I was looking at a bunch of sound engine specs the other day that showed exactly what parameters they allowed, at least in the particular games that used said engines.

EDIT:
Looking at the specs didn't help :p
In the particular engine N-SPC, they have three commands for variable pitch.
Pitch envelope to
"do pitch slide for all of the following notes" starting on normal and ending on new pitch
Pitch envelope from
"do pitch slide for all of the following notes" starting on new pitch and ending on normal
Pitch Slide
"do pitch slide for current note only" starting on normal and ending on new pitch

So it's probably up to the converter to decide how to handle it, which means I am now loading up one of the MIDI files to see what's in there.

I see a lot of pitch bend, no CC 5, 65, or 84, so no portamento in the resulting MIDI files.
9 months ago
·
#13786
0
Votes
Undo
the effect is often used to cut off the attack portion of the waveform from the notes following the first.

Hmmmmm, does it work on percussion channels as well? In my post about playing a partial sound, that would actually be the exact effect I need to get rid of the sharp hit on subsequent repeated snare hits... maybe.
9 months ago
·
#13787
0
Votes
Undo

Hmmmmm, does it work on percussion channels as well? In my post about playing a partial sound, that would actually be the exact effect I need to get rid of the sharp hit on subsequent repeated snare hits... maybe.


It's not the channel that's the key, portamento can be applied on any channel whether it's being used for percussion or not.
It's the sample player that responds to the portamento on command and starts playback after the attack phase (or so I'm led to believe).
9 months ago
·
#13827
0
Votes
Undo
Aye aye aye. So the converter leaves all percussion expression on the original channel it was on in the game (somewhere on 1 to 8). I haven't noticed too many issues with that (but maybe I just didn't pay enough attention? Could fix some issues I am having with the game I just finished mapping out instruments for). I'm testing out converting a game now where there's lots of volume control on the percussion, and without it it just sound like a big pile of noise. Luckily with this particular game (this testing music track anyway) the percussion is all on channels 2 and 5. I tried several different editors to see if I could successfully move the percussion events on to the percussion channel.

Domino broke other things unrelated to it (seems to have lost pitch bending, maybe some other stuff, but the percussion sounds good).

Anvil Studio couldn't do it (except for repairing the track to prepare for use in the other editors).

Sekaiju... did it! After a lot of trial and error, I figured out:

- first I have to start with a file repaired by Anvil Studio, otherwise some invalid data that the converter creates causes Sekaiju to not save the percussion channel after the edits are made, even though it will play everything fine up until you save

- click on a MIDI track that contains the percussion expression events
- go to the edit menu
- Edit Event's Track
- Enter the actual percussion channel's track number
- Viola! And not the musical kind!

Here are 3 tests so you may listen to the difference. I must say, I'm not looking forward to this part of the process, and it may be next to impossible for some games where percussion is mixed together with melodic instruments rather than having it on its own fixed channels, but I'm glad I found a way to do it that will work at least sometimes.

The 3 files are the original conversion, the Domino effect, and the Sekaiju version.

Original SPC version can be heard at
https://www.zophar.net/music/nintendo-snes-spc/super-mario-world-2-yoshis-island
107 Flower Garden
8 months ago
·
#14356
0
Votes
Undo
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


Figured I'd give an update as I am progressing. As usual, the more I know, the harder things get.

The converter does a pretty bad job with percussion. Running a converted file through Sema's test-midi-files shows invalid (255) values whenever there should be a Note Off for percussion. While investigating the cause, I discovered that the ONLY thing it moves to the percussion channel is the Note On event. All other items (note off, velocity, etc) are all left on their original channels. I have been trying to find workarounds for it for a while now. I added custom code in to my MIDI editor to try to automatically re-assign the Note Off events, but it is not really accurate. I can only set the Note Off to the same value as the most recent Note On, so some things get multiple offs while others get none.

I just found a very slow, painful, but ultimately quality solution!

All standard melodic instruments are converted correctly, including the full ADSR envelopes. So I thought "What if I mute all percussion, and export just a MIDI file of the melodic portion?" So far, so good. "Okay, what if I mute all of the melodic portion, and export just the percussion? But! ... Set each percussion sound to a unique melodic sound instead, and change it later?" So I just tried it out. It's very time consuming. But here's the new "current process" (with bonus of no longer needing to run the Anvil Studio repair because there are no longer any invalid percussion values, because as far as the converter is concerned, there is no percussion!)

0 - Figure out all of the instrumentation/pitch/etc
1 - Export melodic only MIDI file using spc2midi
2 - Export percussion (*set as melodic) only MIDI file using spc2midi
3 - Modify percussion MIDI file using Sekaiju (so far, unless I find a better option) to re-map all sounds on to percussion channel
4 - Adjust key of each "instrument" (using Sekaiju) to be on its correct percussion sound
5 - Load melodic only MIDI file in to Anvil Studio
6 - Merge the modified now-fully-percussion MIDI file in to the melodic file
7 - Delete all extra unused channels from the MIDI file in Anvil Studio

I've done one track so far, and it came out loads better than any attempt prior to now. I just need to come up with a more streamlined way of keeping track of which percussion instruments are which, as things start to get messy when you move them over from a melodic channel, and I think some of the ones in the track are incorrect (proof of concept, but I can easily change them later with my editor). An added bonus to this method is that for things with "combined" percussion (for example, the high/low whistles in Mario Kart) I can now see both high and low in the note display and reassign the high to high and low to low, where previously I would have had to manually figure out what was what if I didn't just give up and make them all the same.

I'm attaching my first "successful" percussion transplant, plus my previous version of the same track (with the caveat that some percussion sounds may be incorrectly chosen, I just fixed the cowbell :p)
4 months ago
·
#15188
0
Votes
Undo
Hi Jason, I'll be interested to hear how much success you have converting SPC to MIDI. That is a hero's journey. :D

I think I've come as close to perfecting the technique as I can, though I still need to find a solution for...

As for the fade out... this should be as simple as automating the Channel Volume (CC 07).
I really thought the Pro Mix accessory for Anvil Studio was going to let me do this easily, but so far I am running in to a brick wall with it. I can't seem to apply a volume control to all channels simultaneously, and the graph it gives you to edit each channel individually is not precise. It only lets you view the track volume graph in fractions of the total track length instead of by time duration (you can see 1/1, 1/2, 1/3, 1/4, etc). None of my other editors seem to want to let me do it either.

The close to final process (as of July 23, 2022):

0 - Figure out all of the basic instrumentation/pitch/etc (using SPCPLAY, Winamp, spc2midi, and my ears), save in a spreadsheet
1 - Export "all melodic instruments only" as a GM MIDI file using spc2midi at normal length +10 seconds for fade out (if a looping track)
2 - Export multiple "individual percussion only" (*set as melodic, Grand Piano) GM MIDI files using spc2midi at normal length +10 seconds for fade out (if a looping track)
3 - Edit melodic file with Anvil Studio to repair (if needed) and delete all empty channels
4 - Edit all individual percussion files with Anvil Studio to repair (if needed) and delete all empty channels, then switch channel type from melodic to percussion
5 - Edit all individual percussion files with MIDI-MIS to assign the correct percussion sound to each file
6 - Load melodic only MIDI file in to Anvil Studio
7 - Merge each modified now-fully-percussion MIDI file in to the melodic file to create a complete file including all instruments and percussion
8 - (fade out last 10 seconds of each looping track... somehow)
9 - Load the complete GM MIDI file in MIDI-MIS
10 - Convert from GM to GS, and assign GS instruments as necessary

This process will work for most games that I want to do. Some, as mentioned above, are much more complex so will require a ton of extra work applying effects and stuff to get them as close to the originals as I can. The oldest games are generally the easiest, because the programmers hadn't yet figured out how to fully exploit the sound hardware. I am not going to worry about tidying up the "viewability" of the final MIDI files. My biggest concern is that they play properly and sound how I want them to.

I have Super Castlevania 4 and Super R-Type nearly complete using the new process. The WIP files from earlier are all being redone, so they are forever frozen in time as a stepping stone to where the new ones will be.

See the attachments for a sample. I included the "building blocks" of Super R-Type "Solo Sortie", the combined GM file (WIP) and the nearly final GS file (WIP2). The final file is tuned specifically to the soundfonts I am using, which can be seen in screenshot 5.

Hear the original song:
https://www.zophar.net/music/nintendo-snes-spc/super-r-type
Track 2 Solo Sortie

Hear my versions as I hear them:
GM version
https://drive.google.com/file/d/1xMX_a5hSOk2tSgHwknsERxcwHavKnFjv/view?usp=sharing

"Final" GS version
https://drive.google.com/file/d/1PvioL4ofN5v2X89XgvnjuGQS37I8hEID/view?usp=sharing

I am open to any suggestions on how I can fade out the last 10 seconds of each finished MIDI file without killing myself doing it :p
4 months ago
·
#15189
0
Votes
Undo
Fade outs can be done with Volume (CC7) or Expression (CC11), as long as your MIDI sound source responds to Volume or Expression.

It is very easy to do in Cakewalk. Here's an example:

1. In the track list window, drag over the the last two measure numbers at the top of the right pane to select the last two measures in all tracks.

2. Go to the Insert menu and select the "Series of Controllers" command.

3. Fill in the options to insert type Controller, Number 11 Expression, Value Range Begin 127 to End 0. (The time range is already filled in based on the selected range. The MIDI Channel doesn't matter*.) Click OK.

*Cakewalk will insert all the controllers for the same channel. But when you opened the MIDI file, Cakewalk recognized that each track has only one channel in it and set a "channel number" property for each track. When you save the MIDI file, the events in each track get changed to the channel number property for the track.

View: cakewalk-fadeout.png
4 months ago
·
#15190
0
Votes
Undo
Fade outs can be done with Volume (CC7) or Expression (CC11), as long as your MIDI sound source responds to Volume or Expression.

It is very easy to do in Cakewalk. Here's an example:

Thanks, I tried it out and it seems to do the trick, with a caveat. The files don't line up nice with editors, so it doesn't line up with the measures at the top. I was able to switch the view to hours:minutes:seconds:frames, which is what I would like to use, but the "Series Of Controllers" and selection snapping seems to only display in measures, so it may take some finagling to get it to line up exactly where I need it, unless there's a way to turn off snapping to measures? So far, 1000% more track fade-out than I had before. :D
4 months ago
·
#15195
0
Votes
Undo
Oh. I must have changed the default snap setting. The snap tools are to the left of the the play / pause / stop buttons in the toolbar:

https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fstatic.cakewalk.com%2Fdocumentation%2FCakewalk%2FEN%2Fimages%2FTools.19.2.png&f=1&nofb=1
You can click the snap button (A) to turn off the snap to grid function.
Or
You can right-click on the snap amount (D) to choose a different snap setting.

For more information about various buttons and things, you can go to the View menu and choose "Help Module". This will open a window that will explain anything you hover over.
4 months ago
·
#15198
0
Votes
Undo
I've messed around with it some more. I am able to do exactly what I need, but now it is messing up the beginning of my songs after I add the expression fade out to the end. The tracks are getting misaligned starts, with some of them being delayed about 3.5 to 3.8 seconds. I've posted on the Cakewalk forum to see if anyone has any suggestions on why that might be happening. In the meantime, is anything inherently wrong with the order of these events from the first track (technically track 2)? No testers find any errors.

[ 156] MTrk:
[ 165] 0: b1 00 12 -- Bank Select MSB
[ 169] 0: b1 20 00 -- Bank Select LSB
[ 173] 0: c1 75 -- Program Change (Jungle Snare Drum)
[ 176] 0: ff7f -- Sequencer Specific: 05 0f 09 08 40
[ 185] 0: ff7f -- Sequencer Specific: 05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49 20 2d 20 56 69 72 74 75 61 6c 4d 49 44 49 53 79 6e 74 68 20 23 31
[ 226] 0: ff03 -- Sequence Name: 02 Solo Sortie USE.mid
[ 252] 0: ff02 -- Copyright: Converted by spc2midi
[ 277] 0: b1 7b 00 -- All Notes Off
[ 281] 0: b1 7f 7f -- Poly Mode On
[ 285] 0: b1 79 00 -- Reset All Controllers
[ 289] 0: b1 65 00 -- Registered Parameter Number MSB
[ 293] 0: b1 64 00 -- Registered Parameter Number LSB
[ 297] 0: b1 06 0c -- Data Entry MSB (RPN 00 00: Pitch Bend Sensitivity)
[ 301] 0: b1 26 00 -- Data Entry LSB (RPN 00 00: Pitch Bend Sensitivity)
[ 305] 0: b1 07 43 -- Channel Volume MSB
[ 309] 0: b1 27 54 -- Channel Volume LSB
[ 313] 0: b1 0a 1b -- Pan MSB
[ 317] 0: b1 5b 1e -- Effects 1 Depth
[ 321] 0: b1 5d 0a -- Effects 3 Depth
[ 325] 0: e1 38 3e -- Pitch Wheel
[ 329] 0: 91 49 64 -- Note On
[ 333] 1: b1 0b 7f -- Expression Controller MSB
[ 337] 1: b1 2b 7f -- Expression Controller LSB
[ 341] 2: 81 49 14 -- Note Off


Here's what I'm left with after Cakewalk has a go. You can see that events have been re-arranged, and timing has been modified.

[ 667] MTrk:
[ 676] 0: ff03 -- Sequence Name: 02 Solo Sortie USE.mid
[ 702] 0: ff7f -- Sequencer Specific: 05 0f 09 08 40
[ 711] 0: ff7f -- Sequencer Specific: 05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49 20 2d 20 56 69 72 74 75 61 6c 4d 49 44 49 53 79 6e 74 68 20 23 31
[ 752] 0: b1 7b 00 -- All Notes Off
[ 756] 0: b1 7f 7f -- Poly Mode On
[ 759] 0: b1 79 00 -- Reset All Controllers
[ 762] 0: b1 65 00 -- Registered Parameter Number MSB
[ 765] 1: b1 64 00 -- Registered Parameter Number LSB
[ 768] 2: b1 06 0c -- Data Entry MSB (RPN 00 00: Pitch Bend Sensitivity)
[ 771] 3: b1 26 00 -- Data Entry LSB (RPN 00 00: Pitch Bend Sensitivity)
[ 774] 3: b1 27 54 -- Channel Volume LSB
[ 777] 3: b1 5b 1e -- Effects 1 Depth
[ 780] 3: b1 5d 0a -- Effects 3 Depth
[ 783] 3: e1 38 3e -- Pitch Wheel
[ 788] 241: b1 00 12 -- Bank Select MSB
[ 792] 242: b1 20 00 -- Bank Select LSB
[ 795] 242: c1 75 -- Program Change (Jungle Snare Drum)
[ 798] 242: b1 07 43 -- Channel Volume MSB
[ 802] 242: b1 0a 1b -- Pan MSB
[ 806] 960: 91 49 64 -- Note On
[ 810] 961: b1 0b 7f -- Expression Controller MSB
[ 814] 961: b1 2b 7f -- Expression Controller LSB
[ 817] 962: 91 49 00 -- Note Off
4 months ago
·
#15213
0
Votes
Undo
Oh no! I don't use Cakewalk very often, I forgot it can rearrange and move events like this. It looks like Cakewalk decided there wasn't enough time at the beginning to send all of the initial setup events, so Cakewalk moved all the notes one measure later. Additionally, when you open a MIDI file, I think Cakewalk likes to store things in its own kind of internal format. So when you save back to the MIDI file, events can get rearranged or moved compared to the original MIDI file.

As an alternative for you, I'm thinking of posting how to do a fade-out in Sekaiju. It's a little more work, but it shouldn't rearrange or move events in your MIDI file.

The rest of this post is technical discussion, mainly about what Cakewalk rearranged.


Anything wrong?

is anything inherently wrong with the order of these events [...]?

My only recommendation is to put the track name at time zero and before any events that would get sent out to the MIDI port (that is, before any event with a MIDI channel number or any System Exclusive event). I remember reading somewhere that some MIDI file software might only search for a track name until it reaches an event for MIDI output or it encounters a non-zero delta time. So if the track name comes after an event for MIDI output, some software might not show the track name.


First track

the first track (technically track 2)

You should be aware that in a Format 1 MIDI file, in the actual bytes of the file, the first track (the first MTrk chunk) is used for events like tempo, time signature, and key signature, and can't contain any notes.

Often, MIDI file editors (including Cakewalk) do not show this first track in their track list window. They reserve their track list window for tracks that can contain notes. You might have to use another window or a timeline header to see things like the tempo, time signature, or key signature events. For example, in Cakewalk, in the View menu, you can open the windows called Markers, Tempo, or Meter/Key to view things that are stored in the first track of the MIDI file.

Any time you or other people use different kinds of software to examine a MIDI file, you have to be careful when discussing which track you are referring to. In my comments below I will call the actual first track in the MIDI file "the conductor track", and I will call the tracks after that "the first note track", "the second note track", and so on.


Cakewalk view notes

As mentioned above, Cakewalk will put various events from the conductor track into their own special windows: Markers, Tempo, and Meter/Key.

Cakewalk will put the Track Name from the conductor track, Copyright events from any track, and Text events at time zero from any track into its Notes window (View menu, Browser command, Notes tab). It won't show them as events in the Event List window.

Cakewalk will consider the Track Name and initial Bank and Program Change events in a note track as a track property. It won't show them as events in the Event List window, only as values for the track in the Track List window.

Cakewalk will combine note start and note end events into a single "Note" event that has a start time, velocity, and duration.

Cakewalk will combine the Control Change events used for sending a RPN or NRPN into a single "RPN" or "NRPN" event the Event List.


With your MIDI file

Cakewalk rearranged many of the initial setup events.

It looks like Cakewalk decided there wasn't enough time at the beginning to send all of the initial setup events, so Cakewalk moved all the notes one measure later.

Some of the tracks have volume events before the first note event. In general, Cakewalk didn't move volume events before the first note event (except if it was very close to the beginning, it might move it one beat later). But at the point the first note event happens, Cakewalk moved the first note and every following event in the track one measure later.

In particular, 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.


More details

It looks like Cakewalk rearranges the order of initial setup events when you open the file, but at this point the events still have the same measure:beat:tick timestamps, they've just been rearranged into a different order within the events at same timestamp.

Once you save the file and re-open it in Cakewalk (or look at it in other MIDI file software), you will see Cakewalk has moved some events to a new measure:beat:tick timestamp:

Some of the initial setup events were moved around 1 to 3 ticks later.

Some of the initial setup events were moved 1 beat later.

All of the note events were moved 1 measure later, and any event after the first note event in each track was also moved 1 measure later.

Any other event before the first note event in each track was not moved.

It moved the Copyright event from the first note track to the conductor track.


Example pictures

I used Sekaiju to look at the file "02 Solo Sortie WIP2.mid" before and after I edited it with Cakewalk.

Note: In Sekaiju I changed the setup options to number the tracks starting with 0. So the "conductor track" is shown as track 0 and "the first note track" is shown as track 1.


1-event-lists.png

These event lists show the beginning of the 1st note track before and after saving the file in Cakewalk.

The Copyright event (marked with an asterisk) was moved to the conductor track.

The initial setup events were rearranged, and some of them moved 1 to 3 ticks or 1 beat later.

The first note and everything after it was moved one measure later.


2-piano-rolls.png

These piano rolls show the 10th note track notes (the very small lines in the top panes) and Volume events (bottom panes). The left window is before and the right window is after saving the file in Cakewalk. You can see Cakewalk moved the note events and the volume events after the first note event one measure later. The volume events before the first note event weren't moved.


3-track-lists.png

These track lists show the 8th to 11th note tracks.

In the right pane of the Track List, Sekaiju draws vertical lines to represent events like Control Change or Pitch Bend. The height represents the value, or a little circle represents zero. In your MIDI file these vertical lines are usually Volume messages.

In the right pane of the Track List, Sekaiju draws horizontal lines to represent notes.

If you look closely, you can see where the first note and other events were moved 1 measure later.

8th note track: there's a new gap at measure 1.
9th note track: there's a new gap at measure 27.
10th note track: there's a new gap at about measure 31.
11th note track: there's a new gap at measure 1.

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.


Slightly related - Reordering simultaneous note start and note end

Previous threads here have mentioned rearranging the order of simultaneous note start and note end events for the same pitch and channel:

Reordering simultaneous events
SMF Format 1 Tracks and Channels

I now think this is an artifact of how some MIDI editors store notes. If a MIDI file editor combines the note start and note end events that are in the MIDI file into an internal format "note" event that has a start time and duration, then when it saves that back to a MIDI file, it will put the note end before the note start at the same time on a track. If there's a note start and note end for the same pitch and channel on different tracks, then the re-saving doesn't rearrange the file events, but when it plays the notes, it will play the note ends on every track before the note starts at the same time on every track.
  • Page :
  • 1
  • 2
There are no replies made for this post yet.