{"id":3916,"date":"2012-09-13T22:06:26","date_gmt":"2012-09-14T05:06:26","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=3916"},"modified":"2012-09-13T22:06:26","modified_gmt":"2012-09-14T05:06:26","slug":"chiptune-database-and-api","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/chiptune-database-and-api\/","title":{"rendered":"Chiptune Database and API"},"content":{"rendered":"<p>So I set out to create <a href=\"http:\/\/gamemusic.multimedia.cx\/\">a website that allows people to easily listen to video game music directly through their web browser<\/a>. I succeeded in that goal. However, I must admit that the project has limited appeal since the web player is delivered via <a href=\"https:\/\/developers.google.com\/native-client\/\">Chrome&#8217;s Native Client technology<\/a>, somewhat limiting its audience. I&#8217;m not certain if anyone really expects NaCl to take off in any serious way, but I still have a few other projects in mind.<\/p>\n<p>I recently realized that, as a side effect of this project, I accidentally created something of significant value to fans of old video games and associated music&#8211; <strong>a searchable database of chiptune music and metadata<\/strong>. To my knowledge, no one else has endeavored to create such a thing. I figured that I might as well make the database easily accessible with an API and see where it leads.<\/p>\n<p>To that end, I created 2 API entry points. First, there is the search API located at http:\/\/gamemusic.multimedia.cx\/api\/search\/. This can be exercised by ending the URL with a URL-encoded search string, e.g.: <a href=\"http:\/\/gamemusic.multimedia.cx\/api\/search\/super+mario\">http:\/\/gamemusic.multimedia.cx\/api\/search\/super+mario<\/a>. This returns JSON data containing an array of results in decreasing order of relevance. Each result has a game title, database ID, media URL, system type, and an SHA-1 hash. This is the same API that <a href=\"http:\/\/gamemusic.multimedia.cx\/search\/?q=super+mario\">the site&#8217;s own search page uses<\/a>.<\/p>\n<p>The database ID can be plugged into http:\/\/gamemusic.multimedia.cx\/api\/metadata\/ to retrieve the song&#8217;s metadata in JSON format. E.g., the ID for Super Mario Bros. 3 on the NES is 161: <a href=\"http:\/\/gamemusic.multimedia.cx\/api\/metadata\/161\">http:\/\/gamemusic.multimedia.cx\/api\/metadata\/161<\/a>.<\/p>\n<p>I recently read <a href=\"http:\/\/www.bitnative.com\/2012\/08\/26\/how-restful-is-your-api\/\">an article about sins against true RESTful API principles<\/a> which led me to believe I&#8217;m almost certainly doing this web API stuff wrong. I don&#8217;t think it&#8217;s a huge deal, though, since I don&#8217;t think anyone actually listens to chiptunes any more. But if there are offline chiptune music players that are still in service and actively maintained, perhaps the authors would like to implement this API. It would require some type of HTTP networking library, a JSON parser, <a href=\"http:\/\/tukaani.org\/xz\/embedded.html\">the embedded XZ decoder<\/a>, and some new code to parse through my .gamemusic and .psfarchive formats.<\/p>\n<p>This database could be a significant value-add to chiptune playback software, and could help people experience classic game music much more easily.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My game music website&#8217;s database of chiptunes might be useful to offline music players as well<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3916","post","type-post","status-publish","format-standard","hentry","category-general"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=3916"}],"version-history":[{"count":10,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3916\/revisions"}],"predecessor-version":[{"id":3926,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3916\/revisions\/3926"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=3916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=3916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=3916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}