SongCache Parser
- This topic is empty.
-
AuthorPosts
-
September 22, 2016 at 11:24 am #394354
I hope this is the appropriate place to post this.
I’m working on a queue software for a local Rock Band night I help out with, and since we have a massive song library (over 1000 customs, thanks guys) that’s continually being added to, I was hoping to build into the tool the ability to drop in the song cache from our XBox360 and parse it.
I’ve had no problems using a CSV exported from C3 CON Tools or this tool: http://pksage.com/ccc/cache2csv.php
however, I’d like to be able to just parse the song cache directly if possible. In a previous thread, pksage had mentioned he’d be willing to share the PHP script for cache2csv.php. Unfortunately, I noticed he’s not been around for a few months.
Does anybody else in C3 have access to that file, or at least give me some pointers on where to begin parsing the song cache?
Any help would be appreciated.
Thanks!
September 22, 2016 at 12:04 pm #475247What are you writing your software on? I might still be able to find the original Google doc pksage created when he figured out what each bit did, and you can go from there. But since then there’s been a ton of improvements made through the integration in C3 CON Tools, so that would be the best way to start I think…but that’s all in C#.
September 22, 2016 at 1:05 pm #475249I’m writing in Java at the moment. The syntax is fairly similar, so I don’t have much trouble reading C# and translating to Java.
So whether I have to go off the doc and figure it out myself, or you can share some of the C# code and I can use that as a jumping off point.
Thanks!
September 22, 2016 at 2:19 pm #475251https://docs.google.com/spreadsheets/d/1JSpPduG4KIFzEJPGwWS_N92s3szKW6DnH6n47ktGAlw/edit?usp=sharing
Haven’t touched it in years, hope it helps!
September 23, 2016 at 2:56 am #475260I don’t see a problem with providing the C# code I use in Setlist Manager. I went through it, nothing confidential in there. There’s a couple of functions called in it, I also included them in this text file.
That should be about 95% of what you need.
http://www.keepitfishy.com/rb3/c3contools/parse_cache.txt
And what I use to calculate the instrument difficulties:
September 23, 2016 at 2:17 pm #475271Sorry, just getting back to this as I’m a graveyard worker. This is great. Thanks so much for providing both. This should be exactly what I need to get started. I’ll let you know if I run into any issues.
Thanks!
September 28, 2016 at 3:58 am #475472Thanks for these: was just thinking about poking at this, myself.
September 30, 2016 at 3:12 am #475554Does the actual songcache data as documented always start at byte count 0xD000 in a 360/CON file?
September 30, 2016 at 4:08 am #475557Not sure, I just grab the cache file out of the CON file, then go from there using the code provided.
September 30, 2016 at 1:44 pm #475576Well yeah, I’m pretty much asking: “How do I just grab the cache out of the CON file?” ” src=”/wp-content/uploads/invision_emoticons/default_SA_wink.gif” />
Are you relying on another library to do this? As it comes into your ParseCacheFile() method, the cache known as “file” must be pre-stripped by your previous import. I only see in this example code how it skips extra Wii headers, so I figured I’d have to do something similar on 360.
From what I’ve seen, the CON header gunk is over after a static byte offset of 0xD000, but I only have two songcache files on hand to compare against (virgin post-RBHP build and my current working cache). It’s starts out working “somewhat” at this point, with song info filling in, but eventually breaks after only parsing 4 songs: my byte counts are wandering from expectation somewhere, so I’m adding more robust reporting to see where that happens.
Of course the CON spec is a whole other problem I’ll have to tackle, since I’m hoping to do round-trip modifications on a songcache. From initial poking, though, I anticipate some sort of checksum validation that will try to prevent that, but let’s just tackle one issue at a time!
Thanks for any additional help you can give.
September 30, 2016 at 1:49 pm #475577I extract the song cache file using the X360 library that is embedded in my tools, which is a modified version of the X360 library you can find online. I might make a version of my tools that can be shared and used by anyone using .NET…but I just don’t have the time now.
For now, you can extract it using C3 CON Tools, just drag/drop the CON file, and when you navigate the contents, the only file displayed will be the cache file, which you can then drag/drop out or right click to extract. That’s the file you want to go through with the code posted.
September 30, 2016 at 2:52 pm #475580Thanks for the clue! Using the C3CONToolified innards extract for initial testing, it appears that my parsing is solid: all songs processed!
So I went back and confirmed that my initial determination of 0xD000 was wrong. Using an offset of 0xF000 gives me correct parsing up toward 300 songs (maybe half of them) before crapping out, but it’s still not complete. Apparently there’s some non-contiguous chunking going on in the CON wrapper, perhaps using the byte expanse like some sort of virtual swap space that’s overwritten as needed.
I guess now it’s a matter of looking for that library. I’ll also share my project if it manages to come to anything: I’ve decided to go with C#, since I had a history with it long ago, but it should play nice enough with VB.
Thanks again for the help.
September 30, 2016 at 3:45 pm #475581If all you’re planning to use it for is STFS related stuff (CON/LIVE files), then just use my modified version.
http://keepitfishy.com/d.php?57ee87d68868f9.97997502
It removes all the fluff that’s not needed for STFS files, and it includes a few improvements and one major bug fix in the x360 code you’ll find on the net.
There’s nothing C3 specific there, so I have no problem with anyone who wants to, using this code.
But I offer no support for it. I might be able to answer your question(s), but I might not. Good luck!
September 30, 2016 at 4:47 pm #475587Great! Thanks so much. I’ll owe you one if I ever make it to Miami, or if you manage to track me to Tampa. ” src=”/wp-content/uploads/invision_emoticons/default_SA_biggrin.gif” />
September 30, 2016 at 4:49 pm #475588You’re in Tampa?! I was there in August for work and stayed the weekend for Tampa Bay Comic Con on Saturday and went to Bok Tower Gardens on Sunday. I will be back every so often as work sends me around the state.
-
AuthorPosts
- You must be logged in to reply to this topic.