{"id":4219,"date":"2013-11-30T22:00:16","date_gmt":"2013-12-01T06:00:16","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=4219"},"modified":"2013-12-29T15:22:30","modified_gmt":"2013-12-29T23:22:30","slug":"adding-ay-files-to-the-game-music-website","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/adding-ay-files-to-the-game-music-website\/","title":{"rendered":"Adding AY Files To The Game Music Website"},"content":{"rendered":"<p>For the first time since I launched the site in the summer of last year, I finally added support for new systems for my <a href=\"http:\/\/gamemusic.multimedia.cx\/\">Game Music Appreciation<\/a> site: A set of chiptune music files which bear the file extension AY. These files come from games that were on the <a href=\"http:\/\/en.wikipedia.org\/wiki\/ZX_Spectrum\">ZX Spectrum<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/Amstrad_CPC\">Amstrad CPC<\/a> computer systems.<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2013\/11\/zx-spectrum-180pxw.png\" alt=\"ZX Spectrum\" width=\"180\" height=\"124\" class=\"aligncenter size-full wp-image-4221\" \/> &nbsp; <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2013\/11\/amstrad-cpc-180pxw.png\" alt=\"Amstrad CPC\" width=\"180\" height=\"119\" class=\"aligncenter size-full wp-image-4220\" \/><br \/>\n<\/center><\/p>\n<p>Right now, there are <a href=\"http:\/\/gamemusic.multimedia.cx\/browse\/zx-spectrum\">over 650 ZX Spectrum games<\/a> in the site while there are all of <a href=\"http:\/\/gamemusic.multimedia.cx\/browse\/amstrad-cpc\">20 Amstrad CPC games<\/a>. The latter system seems a bit short-changed, but I read that a lot of Amstrad games were straight ports from the Spectrum anyway since the systems possessed assorted similarities. This might help explain the discrepancy.<\/p>\n<p><strong>Technically<\/strong><br \/>\nThe AY corpus has always been low hanging fruit due to the fact that the site already supports the format courtesy of the <a href=\"https:\/\/code.google.com\/p\/game-music-emu\/\">game-music-emu<\/a> backend. The thing that blocked me was that I didn&#8217;t know much about these systems. I knew that there were 2 systems (and possibly more) that shared the same chiptune format. Apparently, these machines were big in Europe (I was only vaguely aware of them before I started this project).<\/p>\n<p>Both the Spectrum and the Amstrad used Zilog Z-80 CPUs for computing and created music using a <a href=\"http:\/\/en.wikipedia.org\/wiki\/General_Instrument_AY-3-8910\">General Instruments synthesizer chip designated AY-3-8912<\/a>, hence the chiptune file extension AY. This has 3 channels similar to the C64 SID chip. Additionally, there&#8217;s a fourth channel that game music emu calls &#8220;beeper&#8221; (and which Wikipedia describes as &#8220;one channel with 10 octaves&#8221;). Per my listening, it seems similar to the old PC speaker\/honker. The metadata for a lot of the songs will specify either (AY) or (Beeper).<\/p>\n<p><strong>Wrangling Metadata<\/strong><br \/>\nLarge collections of AY files are easy to find; as is typical for pure chiptunes, the files are incredibly small.<\/p>\n<p>As usual, the hardest part of the whole process was munging metadata. There seems to be 2 slightly different conventions for AY metadata, likely from 2 different people doing the bulk of the work and releasing the fruits of their labor into the wild. After I recognized the subtle differences between the 2 formats, it was straightforward to craft a tool to perform most of the work, leaving only a minimum of cleanup effort required afterwards.<\/p>\n<p><em>(As an aside, I think this process is called <a href=\"http:\/\/en.wikipedia.org\/wiki\/Extract,_transform,_load\">extract &#8211; transform &#8211; load, or ETL<\/a>. Sounds fancy and complicated, yet it&#8217;s technically one of the first computer programming tasks I was ever paid to perform.)<\/em><\/p>\n<p><strong>Collateral Damage<\/strong><br \/>\nWhile pushing this feature, I managed to break the site&#8217;s search engine. The search solution I developed was always sketchy (involving <a href=\"http:\/\/multimedia.cx\/eggs\/re-solving-my-search-engine-problem\/\">compiling a C program as a static binary CGI script<\/a> and trusting it to run on the server). I will probably need to find a better approach, preferably sooner than later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Game Music Appreciation site now includes .AY chiptune music from ZX Spectrum and Amstrad CPC computers (whatever those are)<\/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-4219","post","type-post","status-publish","format-standard","hentry","category-general"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/4219","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=4219"}],"version-history":[{"count":6,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/4219\/revisions"}],"predecessor-version":[{"id":4228,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/4219\/revisions\/4228"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=4219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=4219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=4219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}