<?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>Barryvan</title>
	<atom:link href="http://www.barryvan.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barryvan.com.au</link>
	<description>Music, Programming, Design</description>
	<lastBuildDate>Sun, 08 Jan 2012 08:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TrackPerformer step-by-step</title>
		<link>http://www.barryvan.com.au/2012/01/trackperformer-step-by-step/</link>
		<comments>http://www.barryvan.com.au/2012/01/trackperformer-step-by-step/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 08:48:12 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[TrackPerformer]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=672</guid>
		<description><![CDATA[I&#8217;ve had a request to put together a guide explaining exactly how to build a performance using TrackPerformer. This post will walk you through the process, from preparation to presentation. Please note that this guide assumes you are working with an Impulse Tracker or OpenMPT module; if you are not, you will have a bit [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a request to put together a guide explaining exactly how to build a performance using TrackPerformer. This post will walk you through the process, from preparation to presentation.</p>
<p>Please note that this guide assumes you are working with an Impulse Tracker or OpenMPT module; if you are not, you will have a bit more work to do.</p>
<h2>Ingredients</h2>
<p>To build your performance, you will need the following items:</p>
<ul>
<li>The original module file (IT or MPTM format)</li>
<li>The exported audio file (preferably in OGG, MP3, and M4A formats, for maximum cross-browser compatibility)</li>
<li>A copy of the ModReader source (which you can <a title="Download a ZIP file of the ModReader source" href="https://github.com/barryvan/modReader/zipball/master">download from GitHub</a>)</li>
<li>A copy of the TrackPerformer source (which you can also <a title="Download a ZIP file of the TrackPerformer source" href="https://github.com/barryvan/trackPerformer/zipball/master">download from GitHub</a>)</li>
<li>A decent plain text editor (not Word) &#8212; I recommed <a href="http://www.activestate.com/komodo-ide">Komodo IDE</a> or <a href="http://www.activestate.com/komodo-edit">Komodo Edit</a>.</li>
<li>A recent and decent web browser &#8212; Firefox, Chrome, or Opera work best.</li>
</ul>
<p>With these in hand, you&#8217;re ready to get going!</p>
<h2>Method</h2>
<h3>1. Set up</h3>
<p>If you haven&#8217;t already, extract TrackPerformer to the folder of your choice. When you do so, you&#8217;ll notice that there are several sub-directories: &#8220;Examples&#8221;, &#8220;Source&#8221;, and &#8220;Utilities&#8221;. Create a new directory, called &#8220;Performances&#8221;.</p>
<p>Copy the file &#8220;template.html&#8221; from the &#8220;Examples&#8221; directory, renaming it to the name of your track.</p>
<p>Next, copy your exported audio files into the &#8220;Performances&#8221; directory; ensure that they all have the same file name (bar the extension).</p>
<p>Create a new, blank file, with a &#8220;.js&#8221; extension and named the same as your track. Load this file in your editor.</p>
<p>Finally, load the HTML file in your editor, and add a &lt;script&gt; tag just before the closing &lt;/head&gt; tag that references your JS file. For example, if your JS file was named &#8220;purple.js&#8221;, you would type:</p>
<pre>&lt;script type="text/javascript" src="purple.js"&gt;&lt;/script&gt;</pre>
<h3> 2. Conversion</h3>
<p>The next step is to convert your file into a format that TrackPerformer understands. This means noting down when every note is played, and by which instrument. It also means extracting information such as the tempo, time signature, and song title.Fortunately, if you&#8217;re using an IT or MPTM module, the ModReader utility is able to perform this (rather tedious) step for you.</p>
<p><em>If you are not using a format that ModReader is able to convert, you will need to complete this step manually. If your file can be opened in OpenMPT, it is possible to use a JavaScript macro in Komodo IDE/Edit to facilitate this; otherwise, you will need to craft the entire lot by hand.</em></p>
<p>If you have not already done so, extract the ModReader zip file to a suitable location. Then, in your web browser, load the &#8220;index.html&#8221; file from that location.</p>
<p>Select the file you would like to convert. Note that ModReader does all of its processing on your computer &#8212; it doesn&#8217;t send your file anywhere, and won&#8217;t change its contents, either.</p>
<p>All going according to plan, there should now be a lot more text on-screen. Copy everything between the dashed lines (not including the lines), and paste it into your performance&#8217;s JS file. This is the TrackPerformer-compatible version of your module,in a format known as <a href="http://json.org/">JSON</a>.</p>
<h3>3. Write some JavaScript</h3>
<p>As I said earlier, ModReader gives you a JSON representation of your track, which is great. However, we need to now pass this representation through to TrackPerformer. To do this, we need to write some JavaScript to go around this JSON representation. Edit your JS file so that it looks something like this:</p>
<pre class="brush: javascript">window.addEvent(&#039;domready&#039;, function() {
	var controller = window.controller = new barryvan.tp.Controller({
		background: &#039;rgba(230,230,230,0.5)&#039;,
		meta: {
			colour: &#039;rgba(0,0,0,0.5)&#039;,
			visible: false
		}
	}, $(&#039;container&#039;) || document.body);
	controller.perform({
		title: &#039;Foo bar baz&#039;
		/* the rest of the track... */
	});
});</pre>
<p>What we&#8217;re doing here is creating a new Controller, and telling it to perform the track.</p>
<h3>4. Make some noise</h3>
<p>The next step is to point TrackPerformer at the MP3, OGG, and M4A exports of the music. To do this, find the line in your JS file that reads
<pre>"audio": ""</pre>
<p>. In the empty quotes, put in the filename of your audio (without any extension). If your audio is on the web, put in the full URL (again, without the extension). Your JS file will now look something like this:</p>
<pre class="brush: javascript">{
	/* snip */
	&quot;audio&quot;: &quot;mice&quot;
	/* snip */
}</pre>
<p>Now, load up your HTML file in your web browser. You should be able to listen to your track. Next up, we&#8217;ll add a performer.</p>
<h3>5. Add a performer</h3>
<p>Each instrument in your piece can have zero or more performers assigned to it. There are a variety of performers that you can use, each of which offers a unique visual representation of your music. Each performer has a variety of options which affect its function and appearance. These include colour, size, position, vitality, and many others.</p>
<p>Each performer is defined in a code block that looks something like this:</p>
<pre class="brush: javascript">{
	performer: barryvan.tp.performer.Oscillator,
	options: {
		colour: &#039;#f00&#039;,
		stepSize: 10,
		sustain: true,
		middle: 58
	}
}</pre>
<p>The block above means that we want an Oscillator <em>(performer: barryvan.tp.performer.Oscillator)</em>. We have set some of its options <em>(options: { &#8230; })</em> such that it is bright red <em>(colour: &#8216;#f00&#8242;)</em>, that a semitone is 10 pixels in size <em>(stepSize: 10)</em>, and that its middle note (vertically centred in the performance) is 58 <em>(middle: 58)</em>, or A#4.</p>
<p>If you look at your JS file, you should see a section labelled &#8220;instruments&#8221;, which will look something like this:</p>
<pre class="brush: javascript">&quot;instruments&quot;: [
	{
		&quot;name&quot;: &quot;Melody&quot;,
		&quot;performers&quot;: []
	}
]</pre>
<p>Put the performer&#8217;s code block between the [], like so:</p>
<pre class="brush: javascript">&quot;instruments&quot;: [
	{
		&quot;name&quot;: &quot;Melody&quot;,
		&quot;performers&quot;: [{
			performer: barryvan.tp.performer.Oscillator,
			options: {
				colour: &#039;#f00&#039;,
				stepSize: 10,
				sustain: true,
				middle: 58
			}
		}]
	}
]</pre>
<p>Now, if you reload your performance in your web browser, you should have something on-screen. You can add more performers to the other instruments in your piece in the same way. If you want more than one performer for the same instrument, you can simply place a comma after the closing brace of the performer block, and start the next one.</p>
<h3>6. Add some filters (optional)</h3>
<p>Filters can manipulate the entire presentation. They can, for example, shift pixels around, draw a grid, or simply calculate the framerate.</p>
<p>Filters are applied to each frame of the animation, and can be applied before or after the performers have been processed. Filters that are processed at the start of each frame go under &#8220;prefilters&#8221;; those processed at the end of each frame are entered under &#8220;postfilters&#8221;.</p>
<p>Let&#8217;s shift some pixels around using the &#8220;Pick&#8221; filter. Like performers, filters are defined in a block of code:</p>
<pre class="brush: javascript">{
	filter: barryvan.tp.filter.Pick,
	options: {
		fuzz: 2
	}
}</pre>
<p>We&#8217;ll add this into the &#8220;prefilters&#8221; section:</p>
<pre class="brush: javascript">&quot;prefilters&quot;: []</pre>
<p>becomes</p>
<pre class="brush: javascript">&quot;prefilters&quot;: [{
	filter: barryvan.tp.filter.Pick,
	options: {
		fuzz: 2
	}
}]</pre>
<p>If you reload your performance in your web browser, things should look a little more fuzzy.</p>
<p>Filters can have a huge impact on the overall &#8220;feel&#8221; of your performance. They can soften the performers&#8217; hard edges, and give the entire performance a more natural appearance.</p>
<h3>7. Present</h3>
<p>Once you&#8217;ve added more performers, adjusted colours, and fiddled with the CSS on your HTML file, you&#8217;re ready to take to the stage. Simply upload the &#8220;Source&#8221; directory and your performance to your webserver (making sure to keep relative paths intact), and publish the URL. You don&#8217;t need to do anything on the server: TrackPerformer is entirely client-side.</p>
<h3>8. Ask questions</h3>
<p>If you run into problems, or have a question, don&#8217;t hesitate to leave a comment or raise an issue on GitHub. You&#8217;re also more than welcome to fork the project, and build your own performers and filters &#8212; if they&#8217;re pulled back into the main TrackPerformer tree, then everyone else can use them, too!</p>
<h2>Appendix</h2>
<h3>A. Converting notes to numbers</h3>
<p>Notes are in the range C-0 to B-9, and are numbered from 0 to 119. To find the number for a particular note, use this formula: <i>x = note + (octave * 12)</i>. In this formula, the note C is 0, C# is 1, D is 2, and so on.</p>
<h3>B. TrackPerformer Wiki: performers, formats, etc.</h3>
<p>The <a href="https://github.com/barryvan/trackPerformer/wiki/_pages">TrackPerformer Wiki</a> has details on all of the <a href="https://github.com/barryvan/trackPerformer/wiki/Performers">performers</a>, the <a href="https://github.com/barryvan/trackPerformer/wiki/Performance-format">performance format</a>, the <a href="https://github.com/barryvan/trackPerformer/wiki/Filters">filters</a> that are available, and the <a href="https://github.com/barryvan/trackPerformer/wiki/Controller-options">controller options</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2012/01/trackperformer-step-by-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TrackPerformer update</title>
		<link>http://www.barryvan.com.au/2011/12/trackperformer-update/</link>
		<comments>http://www.barryvan.com.au/2011/12/trackperformer-update/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 03:05:18 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Albums]]></category>
		<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=660</guid>
		<description><![CDATA[I&#8217;ve added in some really exciting new features to my TrackPerformer project, as well as three new performances: We Three Kings, Carol of the Bells, and Joy to the World. Filters It&#8217;s now possible to add filters, or effects, into the processing chain. These filters can be applied before any performers (pre-filters) or after all [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added in some really exciting new features to my <a href="https://github.com/barryvan/trackPerformer">TrackPerformer</a> project, as well as three new performances: <strong><a href="http://barryvan.github.com/trackPerformer/kings.html">We Three Kings</a></strong>, <strong><a href="http://barryvan.github.com/trackPerformer/bells.html">Carol of the Bells</a></strong>, and <strong><a href="http://barryvan.github.com/trackPerformer/joy.html">Joy to the World</a></strong>.</p>
<h2>Filters</h2>
<p>It&#8217;s now possible to add filters, or effects, into the processing chain. These filters can be applied before any performers (pre-filters) or after all performers (post-filters). At the moment, the included filters are:</p>
<ul>
<li>FPS: Calculates the average framerate across the performance, optionally displaying it in a DOM element.</li>
<li>Grid: Draws a grid to the canvas. The grid may be a simple intersection grid (points), or lines. Both the X and Y axes may be independently configured.</li>
<li>Pick: Probably the most interesting (and processor-intensive) part of TrackPerformer. The Pick filter will randomly swap a pixel with one of its neighbours. It&#8217;s used at full intensity on both <a href="http://barryvan.github.com/trackPerformer/kings.html">We three Kings</a> and <a href="http://barryvan.github.com/trackPerformer/joy.html">Joy to the World</a>, and, when toned down a little for <a href="http://barryvan.github.com/trackPerformer/bells.html">Carol of the Bells</a>, provides a softening, organic effect.</li>
</ul>
<p>I&#8217;ve got some ideas for more filters down the track&#8230; The only difficulty is keeping performance acceptable: manipulation of the canvas pixel by pixel is quite slow in current browsers.</p>
<h2>Performers</h2>
<p>There are a couple of new performers, and some minor updates to some of the existing ones. The Oscillator performer, in particular, is rapidly becoming the most flexible and useful of the performers.</p>
<ul>
<li>There&#8217;s a new ShimmerGrid performer, which is great for adding texture and movement to the entire canvas. You can see it in action particularly well on <a href="http://barryvan.github.com/trackPerformer/joy.html">Joy to the World</a>.</li>
<li>The Swarm performer can now draw its particles as knots (like the SignalTracker), as well as as dots.</li>
<li>The Oscillator now has the ability to draw sustained notes, and to increase the longevity of notes. Take a look at <a href="http://barryvan.github.com/trackPerformer/bells.html">Carol of the Bells</a> to see these new options in use.</li>
<li>Notes can now be filtered based not only on their pitch, but also their velocity (volume).</li>
</ul>
<p>There are a couple of other changes here and there, but these are the main ones.</p>
<h2>We Three Kings</h2>
<p>The three new example tracks are all taken from <a href="http://barryvan.bandcamp.com/album/we-three-kings">We Three Kings</a>, my new Christmas remix album. Why not go and have a listen?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/12/trackperformer-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TrackPerformer</title>
		<link>http://www.barryvan.com.au/2011/10/trackperformer/</link>
		<comments>http://www.barryvan.com.au/2011/10/trackperformer/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 13:05:15 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Free music downloads]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=645</guid>
		<description><![CDATA[TrackPerformer provides a visual stage for your music, using HTML5 canvas and audio. On that stage, performers &#8220;play&#8221; the instruments in the music visually. In other words, it&#8217;s a visualisation system for music, but based on the notation (the abstract) rather than the audio (the manifestation). Essentially, you take a piece of music, convert it [...]]]></description>
			<content:encoded><![CDATA[<p>TrackPerformer provides a visual stage for your music, using HTML5 canvas and audio. On that stage, performers &#8220;play&#8221; the instruments in the music visually. In other words, it&#8217;s a visualisation system for music, but based on the notation (the abstract) rather than the audio (the manifestation).</p>
<p>Essentially, you take a piece of music, convert it into a format that TrackPerformer understands (JSON), describe how you want it to be performed, and then watch! You can, of course, write your own performers.</p>
<div style="padding:8px;margin:0 24px;background:rgba(255,255,255,0.25);border:solid 1px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;">Before going any further, let&#8217;s <a href="http://barryvan.github.com/trackPerformer/colony.html">see it in action</a>. The music is &#8220;Colony&#8221;, a new piece that I wrote about a week ago.</div>
<p>Note: You won&#8217;t be able to view the performance linked above in Internet Explorer, due to its over-aggressive script-blocking: the scripts served from GitHub have the wrong mime-type, so IE won&#8217;t let them run.</p>
<p><a href="https://github.com/barryvan/trackPerformer">Take a look at the project on GitHub</a> to see how it all fits together. TrackPerformer itself resides in the &#8220;Source&#8221; directory; in &#8220;Examples&#8221;, you&#8217;ll find <a href="http://barryvan.github.com/trackPerformer/colony.html">the performance of Colony</a>; in &#8220;Utilities&#8221;, there&#8217;s a JavaScript macro for Komodo IDE/Edit that will help you to translate copied-and-pasted OpenMPT pattern data into TrackPerformer&#8217;s JSON format.</p>
<p>You can find more information on <a href="https://github.com/barryvan/trackPerformer/wiki">the TrackPerformer wiki</a>, including an outline of the format, and some basic instructions for getting started. I&#8217;ll be adding more information to the wiki over the next few days, and I&#8217;ll post updates here too.</p>
<p>Let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/10/trackperformer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Conflagration</title>
		<link>http://www.barryvan.com.au/2011/09/conflagration/</link>
		<comments>http://www.barryvan.com.au/2011/09/conflagration/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 11:28:40 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[EDM]]></category>
		<category><![CDATA[Free music downloads]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=633</guid>
		<description><![CDATA[I&#8217;ve been meaning to write a piece in this idiom for years. It&#8217;s an industrial/orchestral hybrid. I don&#8217;t know why, but I always find this style of music fun, notwithstanding its occasional heaviness. More of the usual Native Instruments suspects at play in this piece: Kontakt, Massive, FM8, and Battery. All of them driven by [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to write a piece in this idiom for years. It&#8217;s an industrial/orchestral hybrid. I don&#8217;t know why, but I always find this style of music fun, notwithstanding its occasional heaviness.</p>
<p>More of the usual Native Instruments suspects at play in this piece: Kontakt, Massive, FM8, and Battery. All of them driven by OpenMPT and Xlutop Chainer.</p>
<p>(<a href="http://www.barryvan.com.au/music/Conflagration.mp3">Download</a>)</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Sound" property="dct:title" rel="dct:type">Conflagration</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.barryvan.com.au/2011/09/conflagration/" property="cc:attributionName" rel="cc:attributionURL">Barry van Oudtshoorn</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/09/conflagration/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
<enclosure url="http://www.barryvan.com.au/music/Conflagration.mp3" length="8645226" type="audio/mpeg" />
		</item>
		<item>
		<title>A brief history of Toothbrush Depilation</title>
		<link>http://www.barryvan.com.au/2011/09/a-brief-history-of-toothbrush-depillation/</link>
		<comments>http://www.barryvan.com.au/2011/09/a-brief-history-of-toothbrush-depillation/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 23:22:44 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Writings]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=628</guid>
		<description><![CDATA[Toothbrush depilation, or, as it is known to its practitioners, &#8220;toothbrush depilation&#8221;, is a vibrant and exciting competitive sport. Although it has been around for the last two hundred years or so, it only came to the public notice when Hammurabi&#8217;s daughter, Hammuribena, was viciously murdered in Babylon. The ensuing civil war has guaranteed toothbrush [...]]]></description>
			<content:encoded><![CDATA[<p>Toothbrush depilation, or, as it is known to its practitioners, &#8220;toothbrush depilation&#8221;, is a vibrant and exciting competitive sport. Although it has been around for the last two hundred years or so, it only came to the public notice when Hammurabi&#8217;s daughter, Hammuribena, was viciously murdered in Babylon. The ensuing civil war has guaranteed toothbrush depilation&#8217;s place in the homes and hearts of Australia&#8217;s most-beloved families.</p>
<p>Perhaps surprisingly, the sport has remained relatively unchanged from its Babylonian days, notwithstanding the French revolutionaries&#8217; attempts to &#8220;simplify&#8221; and &#8220;democratise&#8221; it. Two teams attempt to remove the bristles from between five and six toothbrushes. Judges award points based on the number of bristles removed, their angular displacement, and the size of the bribe. Many have called for toothbrush depilation to be played at the Olympics, but unfortunately they had the wrong number, and so their calls could not be connected.</p>
<p>In Australia, the sport has had something of a checkered history. Forced underground by Hughes, it later experienced an upsurge in popularity under Menzies and Howard. Its detractors claim that it constitutes cruel and unusual punishment; its pundits counter this by pointing out that the detractors are all wimps.</p>
<p>With growing numbers of young Australians choosing toothbrush depilation over other, perhaps more conventional sports, it looks set to sweep the world in the new millenium. A bright future of bristles, bribes, and bloody murders beckons!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/09/a-brief-history-of-toothbrush-depillation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Autobiography</title>
		<link>http://www.barryvan.com.au/2011/08/autobiography/</link>
		<comments>http://www.barryvan.com.au/2011/08/autobiography/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 09:53:16 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Humour]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=623</guid>
		<description><![CDATA[I was asked today to write a short autobiography to go on the company website. This is what I wrote: Barry van Oudtshoorn hails from the snow-clad plains of the Serengeti delta. Overcoming his debilitating muteness (Barry was born without a larynx), he has become an accomplished ventriloquist and master orator. He has presided over [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked today to write a short autobiography to go on the company website. This is what I wrote:</p>
<blockquote><p>Barry van Oudtshoorn hails from the snow-clad plains of the Serengeti delta. Overcoming his debilitating muteness (Barry was born without a larynx), he has become an accomplished ventriloquist and master orator. He has presided over Presidential coming-of-age ceremonies and the marriages of seventeen Catholic priests, both in Uzbekistan and abroad.</p>
<p>The winner of the inaugural bi-annual toothbrush-depilation contest in 2010 (and a runner up the year before that), Barry leads a quiet life. Despite being married to Ariel, he has led a comfortable and well-cooked life. Barry enjoys making jellies wobble and cutting his toenails.</p></blockquote>
<p>I&#8217;m not sure that this will be what goes up, though&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/08/autobiography/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Un)quoted HTML attributes</title>
		<link>http://www.barryvan.com.au/2011/08/unquoted-html-attributes/</link>
		<comments>http://www.barryvan.com.au/2011/08/unquoted-html-attributes/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 07:23:22 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=607</guid>
		<description><![CDATA[In HTML, it&#8217;s perfectly valid to write something like this: &#60;p class=alpha&#62;Lorem ipsum dolor sit amet etc.&#60;/p&#62; Indeed, Internet Explorer 7 and 8 favour this approach. Whereas Firefox, for example, would return the above as &#60;p class=&#34;alpha&#34;&#62;Lorem ipsum dolor sit amet etc.&#60;/p&#62; when retrieving it using innerHTML, IE 7 &#38; 8 only quotes attributes that [...]]]></description>
			<content:encoded><![CDATA[<p>In HTML, it&#8217;s perfectly valid to write something like this:</p>
<pre class="brush: html">&lt;p class=alpha&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;</pre>
<p>Indeed, Internet Explorer 7 and 8 favour this approach. Whereas Firefox, for example, would return the above as</p>
<pre class="brush: html">&lt;p class=&quot;alpha&quot;&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;</pre>
<p>when retrieving it using innerHTML, IE 7 &amp; 8 only quotes attributes that satisfy certain criteria:</p>
<ul>
<li>Any attributes that contain spaces;</li>
<li>Some magic set of standard attributes, such as <i>href</i>;</li>
<li>Any custom attributes you may have specified.</li>
</ul>
<p>Unfortunately, however, this doesn&#8217;t constitute well-formed XML. In the software I develop at work, we produce PDFs that can include user-generated HTML. To do this, we use XSL:FO &#8212; an XML-based system. You can see where this is going: the backend requires valid XML, but the frontend is sending through HTML. The simplest way to fix this is with a simple regex, like so:</p>
<pre class="brush: javascript">var s = &#039;&lt;p class=alpha&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;&#039;;
s = s.replace(/=([^&quot;&#039;`&gt;\s]+)/g, &#039;=&quot;$1&quot;&#039;);
// s === &#039;&lt;p class=&quot;alpha&quot;&gt;Lorem ipsum dolor sit amet etc.&lt;/p&gt;&#039;</pre>
<p>Bear in mind that this regex is by no means perfect. It will, for example, convert this:</p>
<pre class="brush: html">&lt;p class=alpha&gt;Lorem ipsum&lt;/p&gt;
&lt;p&gt;dolor sit=amet&lt;/p&gt;</pre>
<p>into this:</p>
<pre class="brush: html">&lt;p class=&quot;alpha&quot;&gt;Lorem ipsum&lt;/p&gt;
&lt;p&gt;dolor sit=&quot;amet&lt;/p&quot;&gt;.</pre>
<p>&#8230;which is obviously not what we want. I spent a while trying to come up with a regex that would solve this problem, but I stopped pretty soon. What&#8217;s really needed here is a parser: something that can take in the tag soup that Internet Explorer produces, and produce valid XHTML (which is valid XML). A quick search reveals myriad implementations in various languages &#8212; Python, Java, even JavaScript.</p>
<p>So, after all that, what&#8217;s the take-away from this post? Just this: web browsers (slightly older versions of Internet Explorer in particular) are imperfect. XML was borne out of HTML, and is much less forgiving; whether or not its strictness is a good thing is up for debate. I guess that it&#8217;s a bit like reading Shakespeare nowadays: you can pretty much understand it, but every now and then you have to reach for a dictionary to make sense of what&#8217;s going on. Of course, when you don&#8217;t understand something in Shakespeare, you don&#8217;t fall over in a heap, but let&#8217;s not stretch the analogy too far.</p>
<h2>In brief</h2>
<p>When retrieving the innerHTML of an element (or using contenteditable), Internet Explorer doesn&#8217;t always wrap attribute values in quotes. The solution to this is not a magnificently obtuse regex, but a tag-soup parser that can return valid XML.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/08/unquoted-html-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Juggernaut</title>
		<link>http://www.barryvan.com.au/2011/07/juggernaut/</link>
		<comments>http://www.barryvan.com.au/2011/07/juggernaut/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 10:01:44 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[EDM]]></category>
		<category><![CDATA[Free music downloads]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=602</guid>
		<description><![CDATA[A piece in the same vein as Fluorescent. My wife describes this piece as &#8220;dystopian&#8221;. I, of course, had to reply with this rather witty riposte: &#8220;Dystopia? I &#8217;ardly even know &#8217;er!&#8221;. This piece is somewhat heavier than some of my other recent endeavours, but hopefully not too much so. In terms of VSTis, it [...]]]></description>
			<content:encoded><![CDATA[<p>A piece in the same vein as <a href="/2011/06/fluorescent/">Fluorescent</a>. My wife describes this piece as &#8220;dystopian&#8221;. I, of course, had to reply with this rather witty riposte: &#8220;Dystopia? I &rsquo;ardly even know &rsquo;er!&#8221;.</p>
<p>This piece is somewhat heavier than some of my other recent endeavours, but hopefully not too much so. In terms of VSTis, it makes use of the usual culprits: Reaktor, Massive, FM8, and Kontakt.</p>
<p>(<a href="http://www.barryvan.com.au/music/Juggernaut.mp3">Download</a>)</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Sound" property="dct:title" rel="dct:type">Juggernaut</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.barryvan.com.au/2011/07/juggernaut/" property="cc:attributionName" rel="cc:attributionURL">Barry van Oudtshoorn</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/07/juggernaut/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.barryvan.com.au/music/Juggernaut.mp3" length="5354969" type="audio/mpeg" />
		</item>
		<item>
		<title>Fluorescent</title>
		<link>http://www.barryvan.com.au/2011/06/fluorescent/</link>
		<comments>http://www.barryvan.com.au/2011/06/fluorescent/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 10:38:39 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[EDM]]></category>
		<category><![CDATA[Free music downloads]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=595</guid>
		<description><![CDATA[So I&#8217;ve been playing a bit of Unreal Tournament 3 of late, and UT3 happens to have a pretty awesome demoscene-inspired soundtrack. I guess it was inevitable that I should would go down that path as well! This piece is the result. It gave me the chance to dust off some of my less-often-used VSTis; [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been playing a bit of Unreal Tournament 3 of late, and UT3 happens to have a pretty awesome demoscene-inspired soundtrack. I guess it was inevitable that I should would go down that path as well! This piece is the result. It gave me the chance to dust off some of my less-often-used VSTis; Reaktor, Absynth and Battery all get a look-in on this track.</p>
<p>(<a href="http://www.barryvan.com.au/music/Fluorescent.mp3">Download</a>)</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Sound" property="dct:title" rel="dct:type">Fluorescent</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.barryvan.com.au/2011/06/fluorescent/" property="cc:attributionName" rel="cc:attributionURL">Barry van Oudtshoorn</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/06/fluorescent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.barryvan.com.au/music/Fluorescent.mp3" length="6308753" type="audio/mpeg" />
		</item>
		<item>
		<title>Frequency</title>
		<link>http://www.barryvan.com.au/2011/05/frequency/</link>
		<comments>http://www.barryvan.com.au/2011/05/frequency/#comments</comments>
		<pubDate>Fri, 27 May 2011 09:52:32 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Chillout]]></category>
		<category><![CDATA[Free music downloads]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Pop/rock]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=588</guid>
		<description><![CDATA[This track is, in many ways, a harkening back to my earlier compositions. Its structure is more straightforward, its arrangement is more natural and less synthetic, and it came about from a session in front of the piano. These elements form the basis of much of my earlier work, and, if I&#8217;m honest, they probably [...]]]></description>
			<content:encoded><![CDATA[<p>This track is, in many ways, a harkening back to my earlier compositions. Its structure is more straightforward, its arrangement is more natural and less synthetic, and it came about from a session in front of the piano. These elements form the basis of much of my earlier work, and, if I&#8217;m honest, they probably define my preferred method of composition.</p>
<p>Let me know what you think!</p>
<p>(<a href="http://www.barryvan.com.au/music/frequency.mp3">Download</a>)</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Sound" property="dct:title" rel="dct:type">Frequency</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.barryvan.com.au/2011/05/frequency/" property="cc:attributionName" rel="cc:attributionURL">Barry van Oudtshoorn</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2011/05/frequency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.barryvan.com.au/music/frequency.mp3" length="6357839" type="audio/mpeg" />
		</item>
	</channel>
</rss>

