Change song midi preserving its metadata

Have questions? Just saying hello? This is the place.
No explicit, hateful, or hurtful language. Nothing illegal.

Postby cmplays » 03-30-17 11:03 pm

I created a midi file to play for myself, imported it into Synthesia, split hands, added my fingering notes... in short, put it a bit of effort. But now I feel the need to change a few notes around, i.e. generate a new midi file and import it. Can I do that while preserving all the custom info that I added to the original version?

Version 10.3.4096 on Win 10.
cmplays
 
Posts: 58

Postby cmplays » 04-01-17 10:31 am

Let me ask more specifically:

If I get the song hash from recentSongs.xml, then find the entry for that hash in fingers.xml and save it, then replace the midi file, find the new hash for that file, then put the entry with the new hash back into fingers.xml, would it work? Does fingers.xml also contain the info on splitting the song between two hands, or is that in a separate file?
cmplays
 
Posts: 58

Postby Nicholas » 04-01-17 11:20 pm

Replacing the hash would re-associate the existing data with the new file. You'd have to replace it in a few files; fingers.xml being one of them.

It can get tricky though. Depending on your MIDI editor, all bets are off as to whether the new file has its notes in anything approaching the original order of the previous version of the song. You might get lucky -- some editors have a lighter touch -- and have everything line up nicely though.

(If you'd like to see the new hash, drag that file into the metadata editor, select the song from the list, and it will show the hash at the top of the window.)
Nicholas
 
Posts: 11836

Postby cmplays » 04-02-17 9:39 pm

Oh, I didn't know about the metadata editor. It made everything much simpler. I imported the metadata, saved it, then associated it with the new file, and it all worked like a charm.
cmplays
 
Posts: 58

Postby PowerFritz » 12-19-18 5:54 pm

Hi,

may I add a quick question on this, please..? I have the same problem from time to time, i.e. I do little changes in a song file.. I do maintenance with MuseScore2, then export it to MIDI file. I understood the file id on the filesystem changes since it is a new file.

I used metadata editor to find out both file ids (old MIDI file and new one).

I got to the \users\<user>\appdata\roaming\synthesia directory and GREPed for the old file's id.. found 4 or 5 xml files (not "scores.xml"), replaced old file id with new file id.. opened synthesia and.. scores are gone.

I just realize.. while typing this.. user cmplays did not ask for scores but finger etc. information.

I had a look into scores.xml, the hashes I saw there do not match file hashes.

So.. my question is.. is there a way to preserve score statistics when replacing a file on the file system? Or did I do something wrong? I use Synthesia 10.5 on Windows 7/64.

Thanks and kind regards,

PowerFritz
PowerFritz
 
Posts: 4

Postby Nicholas » 12-23-18 3:37 pm

The hashes in scores.xml are something a bit different than a file hash. Historically I've called them "configuration hashes" or "ConfigHash" and they're unique IDs based on which notes were selected to be played by the user for that performance. So, you'll get a different ConfigHash depending on which hand you choose, etc.

The way to link things back together is by looking at the leftHand, rightHand, and bothHands attributes in songInfo.xml. The "hash" attribute there is the file's MD5 like you'd expect. Then, the three other hashes are each the ConfigHash for the given part, which should match up with the values in scores.xml.
Nicholas
 
Posts: 11836


Return to General

Who is online

Users browsing this forum: No registered users

cron