Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Song backup - abundant-music.com
/**
*
* UPDATE 2014-07-19: No longer works :-(
*
* This code enables you to backup ALL the settings from your song on
* abundant-music.com.
*
* This tool (which is awesome, btw) already offers preset saving
* functionality, but I prefer to save everything related to a song
* at once, mostly for the trouble of maintaining several presets, but
* also because most of the time I won't reuse
*
* IMPORTANT:
* You should run this script through the abundant-music Dropbox URL
* (to get it, open abundant-music.com and inspect the frame element).
*
* HOW TO USE IT:
* Execute it on Chrome's console and a script for reloading your
* current song will be put on your clipboard (it relies on the secret
* 'copy' function, I thing Firefox/Firebug supports it too). Use this
* generated on console again whenever you want
*
* WARNING:
* This is NOT future proof! If the author decides to change the format
* the tool saves its settings, the scripts that this code generates may
* may not work anymore.
* Consider it a BIG UGLY HACK!
*
* NOTES:
* You can opt to remove the key "RenderStorage" from the 'props' array,
* so your backups can become smaller, but you have to make sure you
* change some setting to force the song to be composed (just include
* a space on any field and erase it back).
*
*/
(function() {
var
props = ["RenderStorage", "SongContentSeedSettings", "SongDetails", "SongDomains", "SongIndicesSeedSettings", "SongParameters", "SongSettings", "SongStructureSeedSettings", "WebAudioPlayerSettings"],
i = props.length, loadScript = "", db = window.localStorage;
while (i--) {
var prop = props[i];
loadScript += "window.localStorage.setItem('" + prop + "', '" + db.getItem(prop) + "');\n";
}
loadScript += "window.location.reload();";
copy(loadScript);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment