<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>matt.west.co.tt &#187; Hacks</title>
	<atom:link href="http://matt.west.co.tt/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://matt.west.co.tt</link>
	<description>adventures of a retro electro media hacker type person</description>
	<lastBuildDate>Mon, 25 Jul 2011 21:37:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>The Synchronizatron 3000</title>
		<link>http://matt.west.co.tt/music/synchronizatron-3000/</link>
		<comments>http://matt.west.co.tt/music/synchronizatron-3000/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 21:25:59 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=258</guid>
		<description><![CDATA[In advance of my appearance at the Ultrachip Festival in Edinburgh next month (19th-20th August! Two nights of awesomeness from the UK&#8217;s finest chiptune musicians! Free entry! W00t!), I thought this would be a good time to reveal the secret weapon at the heart of my live shows. Ladies and gentlemen, behold… the Synchronizatron 3000. [...]]]></description>
			<content:encoded><![CDATA[<p>In advance of my appearance at the <strong><a href="http://www.ultrachip.co.uk/">Ultrachip Festival</a></strong> in Edinburgh next month <em>(19th-20th August! Two nights of awesomeness from the UK&#8217;s finest chiptune musicians! Free entry! W00t!)</em>, I thought this would be a good time to reveal the secret weapon at the heart of my live shows. Ladies and gentlemen, behold… <strong>the Synchronizatron 3000</strong>.</p>
<div style="text-align: center;"><img src="http://matt.west.co.tt/images/synchronizatron_400px.jpg" alt="" width="400" height="533"></div>
<p>Out of all my projects, I like this one a lot. I like it because it brought me out of my comfort zone and into the murky world of hardware design (aided by the <a href="http://arduino.cc/">Arduino</a> project which does a fine job of making that world accessible to electronics noobs like me). I also like it because it elegantly solves a problem that, in all likelihood, nobody in the world but me has. But most of all, I like it because it has a pair of blinky LEDs on the top which serve no meaningful purpose.<br />
<span id="more-258"></span><br />
A couple of the songs in my set are played using two Spectrums together, to get an unthinkable 6 (SIX!) channels of sound. At <a href="http://ay-riders.speccy.cz">AY Riders</a> concerts in the past, we synchronised them through the low-tech method of having two of us with our fingers poised over the space bar while one of us counted us in. This method has two drawbacks: firstly, if the timing is even slightly out, it&#8217;s very noticeable. Secondly, different models of Spectrum have slightly different clock speeds, which causes them to slowly drift out of sync over the duration of the song. My two &#8216;performance&#8217; Spectrums are an original 128+ and my <a href="http://matt.west.co.tt/spectrum/speccy2010/">Speccy2010</a>, which are about as different as you can get &#8211; so that wasn&#8217;t going to cut it.</p>
<p>The job of the Synchronizatron 3000 is to provide a common external 50Hz clock signal for the two Spectrums to use, in place of their own timers. This signal gets fed in through whichever port happens to be convenient &#8211; for the Speccy2010, it&#8217;s the joystick port, which handily also provides a +5V line for powering the whole thing &#8211; and for the 128+, it&#8217;s the cassette (EAR) port. Using the cassette port adds another hurdle, because it&#8217;s designed to receive audio-frequency signals, so (presumably due to bandpass filters and other things I don&#8217;t understand) it won&#8217;t respond to simply flipping the signal high and low every 50th of a second &#8211; so instead, it rapidly alternates between generating an 8000Hz tone and silence. The code is really laughably simple:</p>
<pre>
void setup() {
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT); // clock signal
  pinMode(9, INPUT);   // on/off switch
  pinMode(10, OUTPUT); // off (red) LED
  pinMode(11, OUTPUT); // on (green) LED
}

void loop() {
  if (digitalRead(9)) {  // switched on
    digitalWrite(10, LOW);
    digitalWrite(11, HIGH);
    tone(13, 8000); // burst of high frequency
    delay(5);   // play it for 5ms
    noTone(13); // set signal off
    delay(15);  // wait for 15ms
  } else {  // switched off
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
  }
}
</pre>
<p>The Z80 code on the Spectrum side to listen to those pulses goes something like this &#8211; it&#8217;s somewhat similar to what the Spectrum&#8217;s own tape loading routines do when listening for the end of a &#8216;beeeeeee&#8217; in &#8216;beeeeeee bip! beeeeeee bipipipipi…&#8217;, except that here it gets done 50 times a second:</p>
<pre>
	call init_music
loop:
wait_low:
	call get_pulse      ; check for presence of a tone
	jr nz,wait_low      ; don't proceed until the tone has stopped
wait_high:
	call get_pulse      ; now wait for the tone to start up again
	jr z,wait_high      ; - don't proceed until we detect a pulse
	call play_music     ; play the next 'frame' of music -
	                    ; - we want to do this every 1/50s
	jr loop             ; repeat ad infinitum

get_pulse:
	in a,(254)          ; read the cassette port:
	and 0x40            ; - bit 6 of port 254
	ld d,a              ; save its initial value in d
	ld b,255            ; see if it changes over the next 255 iterations over this loop:
get_pulse_loop:
	in a,(254)          ; re-read the cassette port
	and 0x40
	cp d                ; compare with initial value
	ret nz              ; return (with zero flag reset) if there's been a change
	djnz get_pulse_loop
	ret                 ; return (with zero flag set) after 255 iterations with no change
</pre>
<p>Having successfully proved the concept with the full Arduino board, accompanying breadboard and rats-nest of wires, transferring the whole thing to a standalone circuit on stripboard was dead easy &#8211; even easier than the <a href="http://arduino.cc/en/Main/Standalone">regular instructions</a> for doing that, because the Speccy2010 joystick port already gives us a regulated 5V line that saves us from having to rig one up ourselves on the board.</p>
<div style="text-align: center;"><img src="http://matt.west.co.tt/images/synchronizatron_circuit.jpg" alt="(the stripboard schematic, with obligatory coffee stain)" title="the stripboard schematic, with obligatory coffee stain" width="400" height="533"></div>
<p><em>Thanks to <a href="https://twitter.com/loleg">Oleg</a>, <a href="https://twitter.com/btscroggs">Ben</a> and the rest of the <a href="http://wiki.oxfordhackspace.org.uk/doku.php">Oxford Hack Space</a> crowd for their technical, organisational and moral support while cooking this up!</em></p>
<p>It all worked splendidly on the night <a href="http://matt.west.co.tt/music/gasman-live-at-outline-2011/">in Eersel</a>, and you&#8217;ll be able to witness it in action again if you come along to Ultrachip next month. Go on, you know you want to…<br />
<img src="http://www.cmptrllr.co.uk/wp-content/uploads/2011/07/ultrachip-2011-2x.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/synchronizatron-3000/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jasmid &#8211; MIDI synthesis with Javascript and HTML5 audio</title>
		<link>http://matt.west.co.tt/music/jasmid-midi-synthesis-with-javascript-and-html5-audio/</link>
		<comments>http://matt.west.co.tt/music/jasmid-midi-synthesis-with-javascript-and-html5-audio/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 23:40:41 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=190</guid>
		<description><![CDATA[The executive summary: At last weekend&#8217;s Barcamp London 8, I presented a talk entitled &#8220;Realtime audio generation for the web (because there&#8217;s not enough MIDI on webpages these days&#8221;. In it, I went over the current options for generating audio within the browser, and presented my latest hack in that direction, jasmid: a Javascript app [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The executive summary:</strong> At last weekend&#8217;s <a href="http://eight.barcamplondon.org/">Barcamp London 8</a>, I presented a talk entitled &#8220;Realtime audio generation for the web (because there&#8217;s not enough MIDI on webpages these days&#8221;. In it, I went over the current options for generating audio within the browser, and presented my latest hack in that direction, <strong>jasmid</strong>: a Javascript app that can read standard MIDI files, render them to wave audio (with, at present, some <em>very</em> simple waveforms) and play them directly from the browser, completely independently of your OS&#8217;s MIDI support.</p>
<ul>
<li><a href="https://github.com/gasman/jasmid">jasmid on Github</a></li>
<li><a href="http://jsspeccy.zxdemo.org/jasmid/">Online demo</a></li>
</ul>
<p>Read on for the complete notes/transcript of the talk (in hopefully more coherent form than the talk itself &#8211; next time I promise to spend less time on the flashy demo and more time figuring out exactly what I&#8217;m going to say&#8230;)<br />
<span id="more-190"></span></p>
<p>Right now everyone&#8217;s jolly excited about the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#audio">HTML5 audio element</a>. At last we have a standard-compliant way to drop audio clips into web pages that avoids all the gunk with external plugins and replaces it with a simple tag (well, once you&#8217;ve fought through the details of which browsers support MP3 versus Ogg anyway). It has a comprehensive API to handle all the details of buffering, programatically pausing, playing and skipping and so on &#8211; but one thing it stops short of is being able to generate the audio data on the fly, within the browser.</p>
<p>Why would you want that? Well, I can&#8217;t say why <em>you&#8217;d</em> want it, but I can tell you what I&#8217;m hoping to do with it: I&#8217;m involved in the <i>demo scene</i>, a community of programmers, artists and musicians who create digital art &#8211; something roughly like music videos, but with visuals generated in real time &#8211; and I&#8217;m working on <a href="http://demozoo.org/">a forthcoming website</a> that will showcase those productions. This community originates from the days of the Commodore 64, when people cracked games and added little intro animations to promote themselves, which became more and more elaborate as rival groups tried to outdo each other, until they evolved into full-scale artistic creations and the game cracking side of things took a back seat. And among the artefacts to come out of this community is a hell of a lot of music &#8211; we&#8217;re talking hundreds of thousands of tracks, all preserved in the native formats of the Commodore 64, and the Amiga, and all sorts of other things. And it would be quite neat to be able to play all of these from within my website.</p>
<p>I&#8217;m using this site as an excuse to play around with cool technologies, and at first I figured that this was an ideal job for <a href="http://aws.amazon.com/ec2/">Amazon EC2</a> &#8211; set up a bunch of instances churning away in the background converting these files to MP3. However, when I started to learn about ways to generate audio in the browser, it made sense to take advantage of that and save myself a whole lot of up-front processing (not to mention bandwidth).</p>
<p>At the forefront of this new development is the <a href="https://wiki.mozilla.org/Audio_Data_API">Mozilla Audio Data API</a>, available in the latest nightly builds of Firefox. This extends the HTML5 audio API with a few new methods, the central ones being mozSetup &#8211; which allows you to initialise an empty audio stream with a specified sample rate and number of channels &#8211; and mozWriteAudio, which lets you pass in an array of floats representing some sample data to add to that stream. Like all good up-and-coming browser innovations, we can reasonably assume that once the Mozilla developers have got this API stable enough they&#8217;re going to submit it to WHATWG for inclusion in the HTML5 spec &#8211; but for the moment, it has somewhat limited adoption. There is a remedy for that though&#8230;</p>
<p>At my last Barcamp London, two years ago now, I gave the first public showing of <a href="http://jsspeccy.zxdemo.org">JSSpeccy</a>, my ZX Spectrum emulator written in Javascript, which has been something of a runaway internet hit &#8211; and I&#8217;ve been somewhat surprised by the number of people taking it <em>seriously</em>, rather than as the crazy pointless hack I built it as (not least, the guy who ripped it off and sold it on the App Store as the first ever iPhone Spectrum emulator, despite it running at about 30% speed *cough*). But one guy who&#8217;s picked up the concept of emulation in Javascript and taken it much further than I&#8217;d ever dreamed possible is <a href="http://benfirshman.com/">Ben Firshman</a>, who created <a href="http://benfirshman.com/projects/jsnes/">JSNES</a>, the Javascript <del datetime="2011-02-03T14:19:49+00:00">SNES</del> NES emulator, featuring a whole host of advanced optimisations and new features, including audio support.</p>
<p><img src="http://matt.west.co.tt/images/jsnes.jpg" alt="" /></p>
<p>To achieve this, he created the <a href="https://github.com/bfirsh/dynamicaudio.js">dynamicaudio.js</a> library, which sits on top of Mozilla&#8217;s Audio Data API, but also provides an invisible Flash widget for other browsers to fall back upon. Armed with this work, I was able to build the first step towards my goal: <a href="http://jsspeccy.zxdemo.org/jsmodplayer/">jsmodplayer</a>, a player for the MOD music format originally introduced on the Amiga. It&#8217;s a rather messy format to implement, with every man and his dog coming up with their own custom extensions to it in a very ad-hoc way, but at its heart it consists of a set of uncompressed wave samples (typically a second or two in length), and a script detailing when to trigger them and at what pitch. Put enough of those trigger events together, throw in some effects like volume control and pitch slide, and you have a song.</p>
<p>Now, as we all know from the Apple versus Adobe tiff, Flash is not exactly universal across the platforms we care about &#8211; so we haven&#8217;t covered all of our bases yet. However, for certain applications, there&#8217;s a possible third path (albeit one that I haven&#8217;t properly investigated yet), using another recent browser addition: <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">data: URIs</a>. Unlike typical URLs, which point to some external location that contains the data we want, a data: URI embeds that data directly, as a string of base64 or URL-encoded data. This means that we could generate a string containing a valid WAV file from Javascript (or indeed an MP3 or Ogg file, although generating those from Javascript is a little bit hardcore), and use that as the source of an &lt;audio&gt; element.</p>
<p>This does depend on us being able to generate the audio up-front before starting playback, so it&#8217;s arguably not truly &#8216;real time&#8217; &#8211; something like an emulator, which is generating audio in response to user interaction, couldn&#8217;t really do this. It&#8217;s good enough for our straightforward audio player, though.</p>
<p>For a while there was an unfortunate flaw in this plan: Chrome didn&#8217;t currently support WAV as an audio format. <a href="http://code.google.com/p/chromium/issues/detail?id=23916">The bug tracker ticket relating to this</a> featured some rather flimsy arguments defending this decision, such as &#8220;if we support WAV, people will start widely serving audio across the web as uncompressed WAV files&#8221; (um&#8230; just like everyone on the internet is using BMP files, which are supported by all major browsers, right?). Given the tendency of bug tickets to wander off onto unrelated subjects, it&#8217;s hard to tell what the eventual conclusion to this is &#8211; but if I&#8217;m reading it right, we can happily use WAVs as of Chrome 7.</p>
<p>(At this point, someone rightly mentioned that Internet Explorer imposes a 32K limit on URLs, so that won&#8217;t get you much of a wave file &#8211; especially with base64 or URL encoding to contend with. As such, all we can really do is hope that IE users will tend to have the Flash option available. Personally, I think it makes a refreshing change that we can even <em>consider</em> IE in our cutting-edge browser hacks once again&#8230;)</p>
<p>In fact, there&#8217;s another mechanism for feeding data into URLs dynamically, which I&#8217;d all but forgotten until I started preparing this talk: if you have a &#8216;javascript:&#8217; URL which returns a string when executed, that string will be used as the data. This trick was most prominently used in <a href="http://www.wolf5k.com/">Wolfenstein 5K</a> (long before the wider world caught on to the joys of Javascript size coding contests&#8230;), which constructed its display as an XBM image, an obscure text-based format. Before <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html">canvas</a> came along, I spent many happy hours trying to replicate that trick with GIF images, discovering along the way that Internet Explorer didn&#8217;t like strings containing zero bytes, which sent me down the garden path of constructing valid GIFs containing no zeros. Ah, happy days. In short, I don&#8217;t even know if this works at all with &lt;audio&gt;, and even if it does, it&#8217;s almost certainly as much of a dead end as it was back in 2004&#8230;</p>
<p><img src="http://matt.west.co.tt/images/fpc.png" alt="" /></p>
<p>One project of mine where I really <em>should</em> have seen the value of generating the audio up-front was <a href="http://matt.west.co.tt/demoscene/fake-plastic-cubes/">Fake Plastic Cubes</a>, a demo I wrote this summer to play around with the size reduction tricks I&#8217;d seen coming out of the <a href="http://10k.aneventapart.com/">10K Apart</a> and <a href="http://js1k.com/home">JS1k</a> contests, and to try and come up with something audiovisual in as small a size as possible. On the audio side, that meant ditching samples entirely, and doing the synthesis from first principles, building the sound up from plain sine waves &#8211; but in a classic case of project management fail, I spent a week building a really wonderful synthesiser framework and rushed everything else at the last minute, meaning that I had no chance to actually make something nice on top of it. As a result, it&#8217;s totally unpolished, and the animation keeps stuttering for a split second while it generates the next chunk of audio. It&#8217;s only a tiny fraction of the available processor time, but it&#8217;s enough to be very, very noticeable. I really should have just generated the entire audio track on startup and <em>then</em> kicked off the visuals &#8211; but there was no time for that, or to play around with <a href="http://www.whatwg.org/specs/web-workers/current-work/">web workers</a> which would seem to be another potential way to generate audio as a background process&#8230;</p>
<p>I also didn&#8217;t have time to compose a decent soundtrack, or experiment with the synth enough to come up with interesting sounds, or implement a vaguely sensible way to enter musical notes (as a dodgy workaround, I remapped the names of the notes in the scale to <a href="https://github.com/gasman/fakeplasticcubes/blob/master/src/synth.js">their positions on a QWERTY keyboard</a> and prodded out a melody from those</a>). Fortunately, I didn&#8217;t have to let a good routine go to waste: a week or so back, I encountered <a href="http://www.sergimansilla.com/blog/dinamically-generating-midi-in-javascript/">Sergi Mansilla&#8217;s jsmidi project</a>, which provides an easy way to create standard MIDI files from Javascript. However, it turns out that MIDI support in browsers has more or less stagnated &#8211; while wave audio goes from strength to strength, MIDI is still stuck in the world of OS-specific plugins &#8211; so there was a clear opportunity for some Javascript synthesiser love there. And so I&#8217;ve come up with <a href="https://github.com/gasman/jasmid">jasmid</a>, a JS library for reading MIDI files and playing them back through its own audio synthesis engine.</p>
<p>A MIDI file consists of a simple header, followed by a list of tracks &#8211; each of which is a list of timestamped events, which are usually note on/off events but could be a tempo change, change of instrument or various other things. The timestamps are actually a bit weird: you&#8217;d expect them to be given in something like microseconds, but they&#8217;re actually expressed as a number of &#8216;ticks&#8217;, where the MIDI file specifies a particular number of ticks per beat, and the tempo of the song is given in beats per second, which can change over time just to add further confusion. Ultimately it probably does make sense, because it means you can accurately use any rational number (within reason) as a tempo, and that&#8217;s handy for professional MIDI equipment that has to keep exact time for extended periods &#8211; it&#8217;s just an initial hurdle that you have to get over. Once you&#8217;ve got that in place, a MIDI synthesiser boils down to a set of generator functions that can emit audio waves for as long as you tell them to, and a main loop which picks events off the queue, running the generators until it&#8217;s time to process the next event.</p>
<p>For this first release, the generated sounds are not particularly interesting &#8211; just plain sine waves with a bit of attack/decay volume control applied &#8211; but now that we&#8217;ve got the initial framework in place it should be relatively straightforward to add more diverse sounds, and the synth engine should hopefully be flexible enough to support effects like harmonics and reverb.</p>
<p>Finally, as a glimpse of what&#8217;s in store for in-browser audio creation in the future, keep an eye on the <a href="http://mozillalabs.com/rainbow/">Mozilla Rainbow</a> project, which provides APIs for capturing audio and video from microphones / webcams. For the last few years I&#8217;ve been taking part in <a href="http://fawm.org/">February Album Writing Month</a>, a song writing community where collaborations over the internet play a major part &#8211; perhaps it won&#8217;t be too long until we&#8217;re doing that over a Google-Docs-style online equivalent of Audacity / GarageBand&#8230;?</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/jasmid-midi-synthesis-with-javascript-and-html5-audio/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>JSModPlayer &#8211; a Javascript .MOD player</title>
		<link>http://matt.west.co.tt/music/jsmodplayer/</link>
		<comments>http://matt.west.co.tt/music/jsmodplayer/#comments</comments>
		<pubDate>Sun, 23 May 2010 02:22:27 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=156</guid>
		<description><![CDATA[The epic Pacman 30th anniversary Google Doodle, along with Ben Firshman&#8217;s dynamicaudio.js library for dynamically generating audio, collectively persuaded me that I haven&#8217;t done any mad Javascript hacking for far too long. My response to this state of affairs is JSModPlayer, a player for .MOD music files (the mainstay of Amiga and PC sample-based music [...]]]></description>
			<content:encoded><![CDATA[<p>The epic Pacman 30th anniversary Google Doodle, along with Ben Firshman&#8217;s <a href="http://github.com/bfirsh/dynamicaudio.js">dynamicaudio.js</a> library for dynamically generating audio, collectively persuaded me that I haven&#8217;t done any mad Javascript hacking for far too long. My response to this state of affairs is <b><a href="http://jsspeccy.zxdemo.org/jsmodplayer/">JSModPlayer</a></b>, a player for .MOD music files (the mainstay of Amiga and PC sample-based music circa 1990).</p>
<p>So far it only implements a subset of the possible sample effects, and it demands a very fast Javascript engine &#8211; luckily all the new breed of browsers are pretty competitive at that now. Even so, unless your CPU is an absolute behemoth, it&#8217;ll probably struggle to keep up &#8211; the audio output is fixed at 44100Hz, and that&#8217;s rather a lot of numbers for Javascript to crunch, especially when the MOD file gets up to 16 or more channels. Which, amusingly enough, is exactly the situation we had back when we were using Gravis Ultrasounds on 386es. Hurrah for progress!</p>
<p><strong>Update 2010-06-08:</strong> Oops. In the process of testing how Safari 5 shapes up, I discovered a rather silly oversight: the audio buffering routine was set up to never use more than 10% of CPU. Now that I&#8217;ve fixed it, it turns out that Chrome and Safari (at least) have no trouble at all playing Jugi&#8217;s <em>Dope</em> theme in its 28-channel glory. (However, taking the brakes off the buffering does mean that we can&#8217;t reliably pause the audio any more. A small price to pay, I think you&#8217;ll agree.)</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/jsmodplayer/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>DivIDEo v0.2.0 &#8211; video converters for the masses</title>
		<link>http://matt.west.co.tt/demoscene/divideo-v0-2-0-video-converters-for-the-masses/</link>
		<comments>http://matt.west.co.tt/demoscene/divideo-v0-2-0-video-converters-for-the-masses/#comments</comments>
		<pubDate>Tue, 18 May 2010 23:53:08 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=152</guid>
		<description><![CDATA[I&#8217;ve rewritten the DivIDEo converter app in pure C, and as a result it&#8217;s now available in friendly standalone Windows and Mac OS X command line executables (and slightly less crazy and Ruby-ish to compile for other platforms). All the necessary libraries (including a major chunk of ffmpeg) are compiled in, so now there&#8217;s nothing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve rewritten the DivIDEo converter app in pure C, and as a result it&#8217;s now available in friendly standalone Windows and Mac OS X command line executables (and slightly less crazy and Ruby-ish to compile for other platforms). All the necessary libraries (including a major chunk of <a href="http://ffmpeg.org/">ffmpeg</a>) are compiled in, so now there&#8217;s nothing standing between you and full-on ZX Spectrum video converting action. Head over to <a href="http://divideo.zxdemo.org/">the DivIDEo website</a> for the downloads.</p>
<p>Incidentally, a couple of people have asked about the identity of the singer in <a href="http://www.youtube.com/watch?v=bVO5NUy7uZE">the Outline presentation</a>. Apparently, while that clip is what we sneeringly refer to as an &#8220;internet phenomenon&#8221;, it&#8217;s not quite reached 100% saturation, so: it is <a href="http://knowyourmeme.com/memes/trololo-edward-hill-russian-rickroll">Edward Anatolevich Hill</a>, with a Russian TV performance of the song &#8220;I am very glad, because I&#8217;m finally back home&#8221;, or as it&#8217;s becoming increasingly better known, <a href="http://trololololololololololo.com/">Trololololo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/demoscene/divideo-v0-2-0-video-converters-for-the-masses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DivIDEo &#8211; Spectrum streaming video</title>
		<link>http://matt.west.co.tt/demoscene/divideo-spectrum-streaming-video/</link>
		<comments>http://matt.west.co.tt/demoscene/divideo-spectrum-streaming-video/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:06:36 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=148</guid>
		<description><![CDATA[Six years after my first tentative attempts at streaming video from the DivIDE interface were presented at Notcon 2004, I&#8217;ve finally come up with a system that I&#8217;m happy with. It boasts 25fps playback with audio somewhere above the &#8216;nails in a vacuum cleaner&#8217; quality of previous attempts (through the use of delta compression on [...]]]></description>
			<content:encoded><![CDATA[<p>Six years after my first tentative attempts at streaming video from the DivIDE interface were presented at Notcon 2004, I&#8217;ve finally come up with a system that I&#8217;m happy with. It boasts 25fps playback with audio somewhere above the &#8216;nails in a vacuum cleaner&#8217; quality of previous attempts (through the use of delta compression on the video data and variable bitrate audio to use up whatever processor time is left), a one-shot conversion utility that handles all the video decoding, rendering and re-packing, and a player routine that more or less respects the ATA spec (so won&#8217;t fall apart as soon as someone else tries it on a different CompactFlash card. Hopefully). Here&#8217;s how I presented it at the Outline demo party:</p>
<p><object width="480" height="279"><param name="movie" value="http://www.youtube.com/v/bVO5NUy7uZE&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bVO5NUy7uZE&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="279"></embed></object></p>
<p>The full description, and a whole bunch of downloads, is on the <a href="http://divideo.zxdemo.org/">DivIDEo project website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/demoscene/divideo-spectrum-streaming-video/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JSSpeccy v20091121</title>
		<link>http://matt.west.co.tt/spectrum/jsspeccy-20091121/</link>
		<comments>http://matt.west.co.tt/spectrum/jsspeccy-20091121/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 23:12:29 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[JSSpeccy]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=139</guid>
		<description><![CDATA[Yesterday&#8217;s Full Frontal javascript conference turned out to be the ideal setting to compare notes with Ben Firshman of JSNES fame on the finer points of implementing emulators in Javascript &#8211; so this new release of JSSpeccy is the natural consequence of that. I&#8217;ve put in an optimisation which might possibly be a speed boost [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday&#8217;s <a href="http://2009.full-frontal.org/">Full Frontal javascript conference</a> turned out to be the ideal setting to compare notes with Ben Firshman of <a href="http://benfirshman.com/projects/jsnes/">JSNES</a> fame on the finer points of implementing emulators in Javascript &#8211; so this new release of JSSpeccy is the natural consequence of that. I&#8217;ve put in an optimisation which might possibly be a speed boost on Chrome (only writing bytes to ImageData when absolutely <em>absolutely</em> necessary), and the much-needed ability to load your own snapshot files, using the little-known getAsBinary method on file upload objects. (Unfortunately Firefox 3.5 is the only browser which supports it right now, but it looks like it may be in the process of getting the official W3C blessing right now.) And since I was on a roll, on the train back I implemented tape loading traps and the ability to load .TAP files (again, only on Firefox 3.5). Wahey!</p>
<ul>
<li><a href="http://jsspeccy.zxdemo.org/">Play online</a></li>
<li><a href="http://jsspeccy.zxdemo.org/jsspeccy-20091121.zip">Download JSSpeccy v20091121</a> (680Kb)</li>
<li><a href="http://svn.matt.west.co.tt/svn/jsspec/">JSSpeccy subversion repository</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/spectrum/jsspeccy-20091121/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Midibeep</title>
		<link>http://matt.west.co.tt/music/midibeep/</link>
		<comments>http://matt.west.co.tt/music/midibeep/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 00:11:52 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=130</guid>
		<description><![CDATA[Last week I posted possibly the most tedious Basic type-in listing ever to World Of Spectrum: (continues for approx 1500 more lines) Anyone typing it in in its entirety would be rewarded with this: Download midibeep_minute_waltz.mp3 Not bad for an evening&#8217;s work. Mind you, I did take an ever so teeny shortcut, by writing a [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted possibly <a href="http://www.worldofspectrum.org/forums/showthread.php?t=27028">the most tedious Basic type-in listing ever</a> to <a href="http://www.worldofspectrum.org/forums/">World Of Spectrum</a>:</p>
<p><img src="http://matt.west.co.tt/images/beep.png" width="320" height="240" alt="5 BEEP 0.212765, 20; 10 BEEP 0.106383,19..." /><br />
<em>(continues for approx 1500 more lines)</em></p>
<p>Anyone typing it in in its entirety would be rewarded with this:</p>
<p><a href="http://www.zxdemo.org/gasman/music/midibeep_minute_waltz.mp3">Download midibeep_minute_waltz.mp3</a></p>
<p>Not bad for an evening&#8217;s work. Mind you, I did take an ever so teeny shortcut, by writing a Ruby program to convert a MIDI file to BEEP format. (Any .mid file will do, although ones with a single instrument will survive the rather primitive selective-note-butchering process better. Oh, and anything much longer than this one will exceed the 48K Spectrum memory&#8230;) And now you can try it out too:</p>
<ul>
<li><a href="http://github.com/gasman/midibeep/">Midibeep source/downloads at Github</a></li>
<li><a href="http://www.zxdemo.org/extra/src/Mid2BEEP.zip">Midibeep Windows build</a> (thanks to Karl McNeil)</li>
<li><a href="http://www.zxdemo.org/gasman/music/chopin.tap">Minute Waltz (TAP, 38K)</a></li>
</ul>
<p><strong>Update 2010-05-26:</strong> Karl McNeil has adapted Midibeep into a variant called Mid2ASM, which outputs an assembler listing rather than Basic &#8211; this enables the data to be packed much more efficiently, paving the way for altogether longer pieces of music. <a href="http://www.zxdemo.org/extra/src/Mid2ASM.zip">Download Mid2ASM</a> (453K, Windows EXE included)</p>
<p><strong>Update 2010-06-02:</strong> Another update from Karl, featuring a Windows GUI, more space-saving tweaks, and embedding the output in a Basic REM statement. <a href="http://www.zxdemo.org/extra/src/Mid2ASM-2.zip">Download Mid2ASM v2</a> (3.4Mb)</p>
<p><strong>Update 2011-04-09:</strong> Karl McNeil has released the last version of Mid2ASM for a while, <a href="ftp://ftp.worldofspectrum.org/pub/sinclair/tools/pc/Mid2ASM.zip">version 3.2</a> &#8211; featuring primitive importing from .sid .psg and .wav, and the choice of Basic or assembly output. The <a href="ftp://ftp.worldofspectrum.org/pub/sinclair/tools/pc/Mid2ASM_SRC.zip">source archive</a> also contains the command-line version, midibeep2.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/midibeep/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
<enclosure url="http://www.zxdemo.org/gasman/music/midibeep_minute_waltz.mp3" length="1780424" type="audio/mpeg" />
		</item>
		<item>
		<title>JSSpeccy v20090929 (Don&#8217;t-Mess-With-Geeks Edition)</title>
		<link>http://matt.west.co.tt/spectrum/jsspeccy-20090929/</link>
		<comments>http://matt.west.co.tt/spectrum/jsspeccy-20090929/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 00:21:19 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[JSSpeccy]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=127</guid>
		<description><![CDATA[I wasn&#8217;t really planning on developing JSSpeccy further, because I didn&#8217;t consider it a serious project with a future. However, it turns out that someone else did. Enough to rip it off wholesale and pass it off as their own work on the iPhone app store for Â£1.29 a pop, no less. Yes, thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>I wasn&#8217;t really planning on developing JSSpeccy further, because I didn&#8217;t consider it a serious project with a future. However, it turns out that someone else <em>did</em>. Enough to rip it off wholesale and pass it off as their own work on the iPhone app store for Â£1.29 a pop, no less. Yes, thanks to <a href="http://jorallan.livejournal.com/9645.html">the detective work of Phil Kendall</a> we now know that ZXGamer, the much heralded Spectrum emulator for the iPhone, was nothing more than JSSpeccy with a fancy title screen tacked on. (Which of course is a blatant violation of the GPL, and being pure Javascript, would explain why it ran at less than the speed of a real Spectrum on a 600 MHz device, and why it was overwhelmingly rated at one out of five stars. Epic fail.) It&#8217;s been pulled from the app store now &#8211; so while ZXGamer is gradually disappearing from the internet, it&#8217;s time to redress the balance a bit.</p>
<p><a href="http://jsspeccy.zxdemo.org/">A new version of JSSpeccy is out</a>. It doesn&#8217;t run at full speed on an iPhone either (although it positively speeds along on recent versions of Safari on real computers), but it does boast the following changes:</p>
<ul>
<li><strong>GPL v3 licenced</strong>, with prominent notices to make it clear that playing silly buggers like the above will not be tolerated (even if they do include source&#8230;)</li>
<li><strong>A bit of speed optimisation</strong> (about 15% faster maybe)</li>
<li><strong>A pimped-up user interface</strong> with shiny icons</li>
<li>And most relevantly, <strong>entirely controllable via iPhone / iPod Touch touchscreen</strong>. In principle. (If you&#8217;re expecting an immersive gaming experience, you&#8217;ll be disappointed.)</li>
</ul>
<p>So there you go &#8211; probably the best Spectrum emulator for the iPhone ever. And it&#8217;s free.</p>
<ul>
<li><a href="http://jsspeccy.zxdemo.org/">Play online</a></li>
<li><a href="http://jsspeccy.zxdemo.org/jsspeccy-20090929.zip">Download, inc source</a> (674Kb)</li>
<li><a href="http://svn.matt.west.co.tt/svn/jsspec/">JSSpeccy Subversion repository</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/spectrum/jsspeccy-20090929/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sleeper &#8211; mapping European night trains</title>
		<link>http://matt.west.co.tt/ruby/sleeper/</link>
		<comments>http://matt.west.co.tt/ruby/sleeper/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 21:24:06 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=118</guid>
		<description><![CDATA[It&#8217;s now been 10 months and 10 demo parties since I last saw the inside of an airport (with plenty more to come over the next couple of months&#8230; parties that is, not airports), and for any eco-conscious European traveller like me, knowing which sleeper trains to catch is the key to happy travels. So, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sleeper.demozoo.org/"><img src="http://matt.west.co.tt/images/sleeper.jpg" width="250" height="201" alt="" style="float: left; padding-right: 8px;" /></a> It&#8217;s now been 10 months and 10 demo parties since I last saw the inside of an airport (with plenty more to come over the next couple of months&#8230; parties that is, not airports), and for any eco-conscious European traveller like me, knowing which sleeper trains to catch is the key to happy travels. So, it&#8217;s a bit of a shame that there&#8217;s no single website you can go to to find out the best sleeper train to get to European Destination X. Sure, <a href="http://www.seat61.com/">Seat 61</a> is a fantastic resource for finding out how to get to your country of choice, but you can never be sure whether you&#8217;d get better results by heading just across the border, or tweaking your journey times slightly&#8230;</p>
<p>So, in a classic case of building a website to scratch a personal itch, and not wanting to let niggly licencing issues get in the way of a cool idea&#8230; <strong><a href="http://sleeper.demozoo.org/">Sleeper</a></strong> is my new website aimed at searching and mapping the European sleeper train network in its entirety. It&#8217;s been put together with <a href="http://www.ruby-lang.org/">Ruby</a>, <a href="http://www.rubyonrails.org/">Rails</a> (gosh, that&#8217;s rather apt isn&#8217;t it&#8230;), <a href="http://geokit.rubyforge.org/">Geokit</a>, Google Maps, <a href="http://wiki.github.com/why/hpricot">Hpricot</a> and my own freshly open-sourced <a href="http://github.com/gasman/bahn/">Bahn</a> library for snarfing data from <a href="http://www.bahn.de/">Deutsche Bahn</a>&#8216;s website, and hopefully it can give you a fuller picture than ever before of what actually exists in the wonderful world of sleeper trains. Right now it stops short of providing one overall definitive map of the network (it would probably crash your browser if I tried plotting it on Google Maps), but that&#8217;s on the todo list.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/ruby/sleeper/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Ode To Claire / Snakebite</title>
		<link>http://matt.west.co.tt/music/ode-to-claire-snakebite/</link>
		<comments>http://matt.west.co.tt/music/ode-to-claire-snakebite/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:17:25 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Demoscene]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Spectrum]]></category>

		<guid isPermaLink="false">http://matt.west.co.tt/?p=117</guid>
		<description><![CDATA[A couple of fast-made Spectrum releases for last month&#8217;s most excellent]]></description>
			<content:encoded><![CDATA[<p>A couple of fast-made Spectrum releases for last month&#8217;s most excellent <a href=http://www.outlinedemoparty.nl/">Outline</a> demo party. <strong>Ode To Claire</strong> is a curious little 128 byte intro, using a trick I&#8217;ve been wanting to try out for ages. It&#8217;s not exactly a fast-paced action extravaganza, but it does fit 150-odd characters of avant-garde poetry, the printing routine, and a demo effect into 128 bytes of code. Working out how is an exercise for the reader (and I&#8217;m quite interested to know whether the secret is immediately obvious to anyone who&#8217;s at all familiar with the Spectrum&#8230;)</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3LSzKeh-6sQ&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3LSzKeh-6sQ&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<ul>
<li><a href="http://www.zxdemo.org/f/200905/ode_to_claire.zip">Download Ode To Claire</a></li>
<li><a href="http://pouet.net/prod.php?which=53180">Ode To Claire on Pouet</a></li>
</ul>
<p>On the musical front, <strong>Snakebite</strong> is a chiptune with a middle-eastern vibe, modelled after every Turkish Eurovision entry ever. It got third place in the competition, and originally they weren&#8217;t going to give out a third prize, but they had some spare food left over on the Saturday night, so I won a jar of sausages. <em>Best. Prize. Ever.</em></p>
<p><a href="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.mp3">Download gasman_-_snakebite.mp3</a></p>
<ul>
<li><a href="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.mp3">Download Snakebite &#8211; MP3 (2.5Mb)</li>
<li><a href="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.stc">Download Snakebite &#8211; STC (5.1Kb)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://matt.west.co.tt/music/ode-to-claire-snakebite/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://music.matt.west.co.tt/speccy/gasman_-_snakebite.mp3" length="2604390" type="audio/mpeg" />
		</item>
	</channel>
</rss>

