<?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>dave&#039;s blog of art and programming &#187; livecoding</title>
	<atom:link href="http://www.pawfal.org/dave/blog/category/livecoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pawfal.org/dave/blog</link>
	<description>missing acceptable use policy</description>
	<lastBuildDate>Fri, 10 Feb 2012 18:20:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Betablocker DS code patterns (part 2)</title>
		<link>http://www.pawfal.org/dave/blog/2012/02/betablocker-ds-code-patterns-part-2/</link>
		<comments>http://www.pawfal.org/dave/blog/2012/02/betablocker-ds-code-patterns-part-2/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 18:20:40 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[livecoding]]></category>
		<category><![CDATA[visual programming]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2513</guid>
		<description><![CDATA[Following on from the last installment of Betablocker DS coding patterns, this time looking at some very short programs that are nicely controllable by the livecoder - including some actual audio examples here (embedding seems broken on archive.org).
Both these example programs are 16 bytes long, and require 3 concurrent threads to be running over different [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from the <a href="http://www.pawfal.org/dave/blog/2012/01/betablocker-ds-code-patterns-1/">last installment of Betablocker DS coding patterns</a>, this time looking at some very short programs that are nicely controllable by the livecoder - including some <a href="http://www.archive.org/details/BetablockerdsExamples">actual audio examples here</a> (embedding seems broken on archive.org).</p>
<p>Both these example programs are 16 bytes long, and require 3 concurrent threads to be running over different parts of the program. Each thread has a simple purpose, the first loads a byte and plays it as a sound repeatedly, the second one increments the byte that the first is playing, and the third periodically resets the byte to a constant value. </p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/02/bbds-arp.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/02/bbds-arp.png" alt="" title="bbds-arp" width="607" height="186" class="alignnone size-full wp-image-2514" /></a></p>
<p>The first example simply plays the byte as a note - resulting in an arpeggiator style sound. After writing the code, the performer can change the speed of each of the three threads to get quite a bit of variety. For example, the slower the resetting thread runs, the longer the pattern will be before it repeats.</p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/02/bbds-seq.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/02/bbds-seq.png" alt="" title="bbds-seq" width="600" height="283" class="alignnone size-full wp-image-2516" /></a></p>
<p>The second example is very similar, but is slightly modified to play a sequence of different sounds rather than notes, to become a drum sequencer. The second instruction is also changed from a "push literal" to a "push contents of address" which results in the program playing a part of memory as a sequence. We can control the start address location with the reset byte, write directly to this part of memory, and fiddle with the other thread's speed to get even more complexity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2012/02/betablocker-ds-code-patterns-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Betablocker DS code patterns (part 1)</title>
		<link>http://www.pawfal.org/dave/blog/2012/01/betablocker-ds-code-patterns-1/</link>
		<comments>http://www.pawfal.org/dave/blog/2012/01/betablocker-ds-code-patterns-1/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 17:05:36 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[livecoding]]></category>
		<category><![CDATA[visual programming]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2485</guid>
		<description><![CDATA[Some useful Betablocker DS code patterns as used in common live coding situations.
Firstly, when carrying out a sound check before a live performance it's important to keep some kinds of sound engineers happy generating as many different sounds as you can so they can fiddle around with stuff - of course remember to turn everything [...]]]></description>
			<content:encoded><![CDATA[<p>Some useful <a href="http://www.pawfal.org/dave/index.cgi?Projects/BetablockerDS">Betablocker DS</a> code patterns as used in common live coding situations.</p>
<p>Firstly, when carrying out a sound check before a live performance it's important to keep some kinds of sound engineers happy generating as many different sounds as you can so they can fiddle around with stuff - of course remember to turn everything up to 8 when asked to make the loudest sound you can in order to leave some overhead to blow the PA.</p>
<p>This is a betablocker program which will play all the sounds in a sound bank at all frequencies. Add more concurrent threads to make it more interesting. Values interpreted as pointers are visualised as arrows:</p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/01/bbds-sndchk1.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/01/bbds-sndchk1.png" alt="" title="bbds-sndchk" width="300" height="92" class="alignnone size-full wp-image-2489" /></a><br />
(the instruction set description can be <a href="http://www.pawfal.org/dave/images/bbds-page2.png">found here</a>)</p>
<p>In betablocker the beat is always locked to the instruction cycle rate, so fast changing sounds are a matter of optimisation. One of the most common ways around this (and a good way to start things off in a gig) is to use one fast loop program for playing sounds while another slower program modifies the first by overwriting bits of it. </p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/01/bbds-xorrave.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2012/01/bbds-xorrave.png" alt="" title="bbds-xorrave" width="350" height="157" class="alignnone size-full wp-image-2492" /></a></p>
<p>More to follow in this series. See also <a href="http://www.pawfal.org/dave/blog/2011/10/evolving-musical-bytecode-3/">evolved betablocker genetic programs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2012/01/betablocker-ds-code-patterns-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two talks in Helsinki</title>
		<link>http://www.pawfal.org/dave/blog/2011/11/two-talks-in-helsinki/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/11/two-talks-in-helsinki/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 07:16:48 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[livecoding]]></category>
		<category><![CDATA[naked on pluto]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2401</guid>
		<description><![CDATA[Next week I'm presenting Naked on Pluto at Pixelache's Pixelversity on Wednesday evening (9th November) at the Cable Factory. Owen Kelly will also be there to talk about Pixelversity's ‘Social Identity, Augmented Reality &#038; Virtuality’ Study Group' which will take place next year. 
On Saturday afternoon (12th November), Till Bovermann and I will be demoing [...]]]></description>
			<content:encoded><![CDATA[<p>Next week I'm <a href="http://www.pixelache.ac/helsinki/2011/award-winning-naked-on-pluto-project-new-study-group-on-virtuality/">presenting Naked on Pluto</a> at <a href="http://www.pixelache.ac/helsinki/">Pixelache's</a> <a href="http://www.pixelache.ac/helsinki/pixelversity/">Pixelversity</a> on Wednesday evening (9th November) at the Cable Factory. <a href="http://www.owenkelly.net/">Owen Kelly</a> will also be there to talk about Pixelversity's ‘Social Identity, Augmented Reality & Virtuality’ Study Group' which will take place next year. </p>
<p>On Saturday afternoon (12th November), <a href="http://lfsaw.de/">Till Bovermann</a> and I will be demoing Supercollider, Fluxus, Scheme Bricks and Betablocker DS and talking about what it means to be a livecoder at the <a href="http://www.hacklab.fi/2011/10/live-codingia-hacklabilla-12-11/">Hacklab Helsinki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/11/two-talks-in-helsinki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Betablocker rehersal</title>
		<link>http://www.pawfal.org/dave/blog/2011/10/betablocker-rehersal/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/10/betablocker-rehersal/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 08:14:29 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[homebrew]]></category>
		<category><![CDATA[livecoding]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2361</guid>
		<description><![CDATA[Dave &#038; Till – Betablocker live coding (cuts) by LFSaw
]]></description>
			<content:encoded><![CDATA[<p><object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F26075505&color=000000&show_comments=true"></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F26075505&color=000000&show_comments=true" type="application/x-shockwave-flash" width="100%"></embed></object><span><a href="http://soundcloud.com/lfsaw/dave-till-betablocker-live">Dave & Till – Betablocker live coding (cuts)</a> by <a href="http://soundcloud.com/lfsaw">LFSaw</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/10/betablocker-rehersal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>slub in Paris</title>
		<link>http://www.pawfal.org/dave/blog/2011/10/slub-in-paris/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/10/slub-in-paris/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 11:31:13 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[gig]]></category>
		<category><![CDATA[livecoding]]></category>
		<category><![CDATA[slub]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2290</guid>
		<description><![CDATA[Some random pictures from some excellent (and at times very loud) few days in Paris. Thanks to Sony Computer Science Labs and also the Paris contingent of the TPOLM demo crew for coming out to support us. 
   
The gig was extensively recorded, so hopefully more about this soon.
]]></description>
			<content:encoded><![CDATA[<p>Some random pictures from some excellent (and at times very loud) few days in Paris. Thanks to <a href="http://www.csl.sony.fr/">Sony Computer Science Labs</a> and also the Paris contingent of the <a href="http://www.tpolm.org/herring/">TPOLM demo crew</a> for coming out to support us. </p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0553.jpg"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0553-300x179.jpg" alt="" title="IMAG0553" width="300" height="179" class="alignnone size-medium wp-image-2291" /></a> <a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0554.jpg"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0554-300x179.jpg" alt="" title="IMAG0554" width="300" height="179" class="alignnone size-medium wp-image-2292" /></a> <a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0632.jpg"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0632-300x179.jpg" alt="" title="IMAG0632" width="300" height="179" class="alignnone size-medium wp-image-2293" /></a> <a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0642.jpg"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/10/IMAG0642-300x179.jpg" alt="" title="IMAG0642" width="300" height="179" class="alignnone size-medium wp-image-2294" /></a></p>
<p>The gig was extensively recorded, so hopefully more about this soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/10/slub-in-paris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BetaBlocker DS test tones</title>
		<link>http://www.pawfal.org/dave/blog/2011/09/betablocker-ds-test-tones/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/09/betablocker-ds-test-tones/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 10:00:28 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[homebrew]]></category>
		<category><![CDATA[livecoding]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2262</guid>
		<description><![CDATA[After a week of heavy development on Germination X, and with a fast approaching performance, it seemed the time to dive back into Gameboy DS homebrew and get the bits and pieces of assembler code I'd been playing with together into something I could build more sounds from. 
After getting the low level stuff working [...]]]></description>
			<content:encoded><![CDATA[<p>After a week of heavy development on Germination X, and with a fast approaching performance, it seemed the time to dive back into Gameboy DS homebrew and get the bits and pieces of <a href="https://gitorious.org/flotsam/flotsam/blobs/master/ds/bbds/source/qrz.s">assembler code</a> I'd been playing with together into something I could build more sounds from. </p>
<p>After getting the low level stuff working properly, I got busy making a <a href="https://gitorious.org/flotsam/flotsam/blobs/master/ds/bbds/source/sound.cpp">bunch of audio scenes</a> that I can trigger from Betablocker DS code.</p>
<p><object width="640" height="26" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param value="true" name="allowfullscreen"/><param value="always" name="allowscriptaccess"/><param value="high" name="quality"/><param value="true" name="cachebusting"/><param value="#000000" name="bgcolor"/><param name="movie" value="http://www.archive.org/flow/flowplayer.commercial-3.2.1.swf" /><param value="config={'key':'#$aa4baff94a9bdcafce8','playlist':[{'url':'01-lsr8.mp3','autoPlay':false},'02-asr8.mp3','03-mla.mp3','04-0x3FFF.mp3','05-rsbgt.mp3','06-myownmemory.mp3'],'clip':{'autoPlay':true,'baseUrl':'http://www.archive.org/download/BetablockerDsTestTones/'},'canvas':{'backgroundColor':'#000000','backgroundGradient':'none'},'plugins':{'audio':{'url':'http://www.archive.org/flow/flowplayer.audio-3.2.1-dev.swf'},'controls':{'playlist':true,'fullscreen':false,'height':26,'backgroundColor':'#000000','autoHide':{'fullscreenOnly':true},'scrubberHeightRatio':0.6,'timeFontSize':9,'mute':false,'top':0}},'contextMenu':[{},'-','Flowplayer v3.2.1']}" name="flashvars"/><embed src="http://www.archive.org/flow/flowplayer.commercial-3.2.1.swf" type="application/x-shockwave-flash" width="640" height="26" allowfullscreen="true" allowscriptaccess="always" cachebusting="true" bgcolor="#000000" quality="high" flashvars="config={'key':'#$aa4baff94a9bdcafce8','playlist':[{'url':'01-lsr8.mp3','autoPlay':false},'02-asr8.mp3','03-mla.mp3','04-0x3FFF.mp3','05-rsbgt.mp3','06-myownmemory.mp3'],'clip':{'autoPlay':true,'baseUrl':'http://www.archive.org/download/BetablockerDsTestTones/'},'canvas':{'backgroundColor':'#000000','backgroundGradient':'none'},'plugins':{'audio':{'url':'http://www.archive.org/flow/flowplayer.audio-3.2.1-dev.swf'},'controls':{'playlist':true,'fullscreen':false,'height':26,'backgroundColor':'#000000','autoHide':{'fullscreenOnly':true},'scrubberHeightRatio':0.6,'timeFontSize':9,'mute':false,'top':0}},'contextMenu':[{},'-','Flowplayer v3.2.1']}"></embed></object><br />
<a href="http://www.archive.org/details/BetablockerDsTestTones">Sounds hosted by archive.org</a></p>
<p>Mostly I'm doing wavetable based things, with lots of frequency and ring modulation. I was also pleased to find this simple resonant filter thanks to the ever fabulous <a href="http://www.musicdsp.org">musicdsp archive</a> (and thanks to Paul Kellett for originally posting it):</p>
<pre style='color:#000000;background:#ffffff;'><span style='color:#696969; '>// set feedback amount given f and q between 0 and 1</span>
fb <span style='color:#808030; '>=</span> q <span style='color:#808030; '>+</span> q<span style='color:#808030; '>/</span><span style='color:#808030; '>(</span><span style='color:#008000; '>1.0</span> <span style='color:#808030; '>-</span> f<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

<span style='color:#696969; '>// for each sample...</span>
buf0 <span style='color:#808030; '>=</span> buf0 <span style='color:#808030; '>+</span> f <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>in <span style='color:#808030; '>-</span> buf0 <span style='color:#808030; '>+</span> fb <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>buf0 <span style='color:#808030; '>-</span> buf1<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
buf1 <span style='color:#808030; '>=</span> buf1 <span style='color:#808030; '>+</span> f <span style='color:#808030; '>*</span> <span style='color:#808030; '>(</span>buf0 <span style='color:#808030; '>-</span> buf1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
out <span style='color:#808030; '>=</span> buf1<span style='color:#800080; '>;</span>
</pre>
<p>The next step was to read Jasper Vijn's <a href="http://www.coranac.com/tonc/text/fixed.htm">excellent explanation of fixed point maths</a> which I've used a bit on the Android but not really totally understood before. Mobile devices tend to only have integer maths at the hardware level, so if we restrict the calculations to fixed point it's much faster and kinder to batteries than the floating point equivalent. Here is the fixed point version of the filter:</p>
<pre style='color:#000000;background:#ffffff;'><span style='color:#696969; '>// we are using .10 fixed point (10 bits for the fractional part)</span>
<span style='color:#004a43; '>#</span><span style='color:#004a43; '>define</span><span style='color:#004a43; '> FX_SHIFT 10</span>

<span style='color:#696969; '>// convert an int into to it's fixed representation</span>
<span style='color:#800000; font-weight:bold; '>inline</span> s32 fx<span style='color:#808030; '>(</span>s32 i<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span> <span style='color:#800000; font-weight:bold; '>return</span> i<span style='color:#808030; '>&lt;</span><span style='color:#808030; '>&lt;</span>FX_SHIFT<span style='color:#800080; '>;</span> <span style='color:#800080; '>}</span>

<span style='color:#696969; '>// multiply two fixed point numbers (returns fixed point)</span>
<span style='color:#800000; font-weight:bold; '>inline</span> s32 fxmul<span style='color:#808030; '>(</span>s32 a<span style='color:#808030; '>,</span> s32 b<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span> <span style='color:#800000; font-weight:bold; '>return</span> <span style='color:#808030; '>(</span>a<span style='color:#808030; '>*</span>b<span style='color:#808030; '>)</span><span style='color:#808030; '>></span><span style='color:#808030; '>></span>FX_SHIFT<span style='color:#800080; '>;</span> <span style='color:#800080; '>}</span>

<span style='color:#696969; '>// f is cutoff frequecy, q is resonance, s is the filter state</span>
<span style='color:#800000; font-weight:bold; '>void</span> lpf<span style='color:#808030; '>(</span>s16<span style='color:#808030; '>*</span> dst<span style='color:#808030; '>,</span> s16<span style='color:#808030; '>*</span> src<span style='color:#808030; '>,</span> u32 length<span style='color:#808030; '>,</span> s16 f<span style='color:#808030; '>,</span> s16 q<span style='color:#808030; '>,</span> s16 <span style='color:#808030; '>*</span>s<span style='color:#808030; '>)</span>
<span style='color:#800080; '>{</span>
    u32 fb <span style='color:#808030; '>=</span> q<span style='color:#808030; '>+</span>fxmul<span style='color:#808030; '>(</span>q<span style='color:#808030; '>,</span>fx<span style='color:#808030; '>(</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>)</span><span style='color:#808030; '>-</span>f<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span>u32 i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>&lt;</span>length<span style='color:#800080; '>;</span> <span style='color:#808030; '>+</span><span style='color:#808030; '>+</span>i<span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        s<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>+</span><span style='color:#808030; '>=</span>fxmul<span style='color:#808030; '>(</span>f<span style='color:#808030; '>,</span>src<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#808030; '>-</span>s<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>+</span>fxmul<span style='color:#808030; '>(</span>fb<span style='color:#808030; '>,</span>s<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>-</span>s<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        s<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>+</span><span style='color:#808030; '>=</span>fxmul<span style='color:#808030; '>(</span>f<span style='color:#808030; '>,</span>s<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span><span style='color:#808030; '>-</span>s<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        dst<span style='color:#808030; '>[</span>i<span style='color:#808030; '>]</span><span style='color:#808030; '>=</span>s<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span><span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/09/betablocker-ds-test-tones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Missile Command machinima in São Paulo</title>
		<link>http://www.pawfal.org/dave/blog/2011/08/missile-command-machinima-in-sao-paulo/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/08/missile-command-machinima-in-sao-paulo/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 12:15:42 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[fluxus hacking]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[livecoding]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2225</guid>
		<description><![CDATA[Some images of the Machinima exhibition at FILE 2011 in São Paulo, featuring a movie of a livecoded abstractification of a Missile Command game written/performed/destroyed/recorded in Fluxus.
 
]]></description>
			<content:encoded><![CDATA[<p>Some images of the Machinima exhibition at <a href="http://filefestival.org">FILE 2011</a> in São Paulo, featuring a movie of a livecoded abstractification of a <a href="http://www.pawfal.org/dave/index.cgi?Projects/Missile%20Command">Missile Command game</a> written/performed/destroyed/recorded in Fluxus.</p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/08/machinima-003.jpg"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/08/machinima-003-300x200.jpg" alt="" title="machinima-003" width="300" height="200" class="alignnone size-medium wp-image-2226" /></a> <a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/08/machinima-044.jpg"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/08/machinima-044-300x200.jpg" alt="" title="machinima-044" width="300" height="200" class="alignnone size-medium wp-image-2227" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/08/missile-command-machinima-in-sao-paulo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Betablocker DS: Table feedback after Claudius Maximus</title>
		<link>http://www.pawfal.org/dave/blog/2011/08/betablocker-ds-table-feedback-after-claudius-maximus/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/08/betablocker-ds-table-feedback-after-claudius-maximus/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 09:22:00 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[homebrew]]></category>
		<category><![CDATA[livecoding]]></category>
		<category><![CDATA[visual programming]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2205</guid>
		<description><![CDATA[After getting some dates for gigs with Betablocker DS, I am spending some time looking into audio algorithms, and implementing them on the Gameboy DS. Last Thursday I spent some time at the TAI studio/bunker with Till Bovermann investigating these PD patches by Claudius Maximus:

The algorithm uses feedback to create sounds that take some time [...]]]></description>
			<content:encoded><![CDATA[<p>After getting some dates for gigs with <a href="http://www.pawfal.org/dave/index.cgi?Projects/BetablockerDS">Betablocker DS</a>, I am spending some time looking into audio algorithms, and implementing them on the Gameboy DS. Last Thursday I spent some time at the <a href="http://www.pawfal.org/dave/index.cgi?Projects/BetablockerDS">TAI studio/bunker</a> with <a href="http://lfsaw.de/">Till Bovermann</a> investigating <a href="https://code.goto10.org/svn/maximus/tutorials/table-feedback/">these PD patches</a> by <a href="http://claudiusmaximus.goto10.org/cm/">Claudius Maximus</a>:</p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/08/table-feedback.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/08/table-feedback.png" alt="" title="table-feedback" width="338" height="266" class="alignnone size-full wp-image-2206" /></a></p>
<p>The algorithm uses feedback to create sounds that take some time to play through a wide range of frequencies. It works by writing into the same buffer it's playing, but at a different rate/position - the resulting ugliness suits the style of BBDS very much. As an aid to our understanding Till <a href="https://gist.github.com/1170270">converted the algorithm to Supercollider</a>, then over the next couple of days I managed to get it running with an inner loop of 9 instructions on the DS (could probably be optimised further, but I'm still a beginner):</p>
<pre>
@ ----------------------------------------------------
@ qrz_maximus: *dst, length, readpos, writepos [freq, *tab]
@ ----------------------------------------------------
        .global qrz_maximus
	.type   qrz_maximus, %function
qrz_maximus:
        push    {r4,r5,r6,r7}       @ push the registers we need
        ldr     r4, [r13,#20]       @ load freq from stack into r4
        ldr     r5, [r13,#24]       @ load *tab from stack into r5
        ldr     r6, .tablength      @ load the tablen into r6
.maximus_loop:
        ldrh    r7, [r5,r2]         @ load the sample into r7
        strh    r7, [r0], #2        @ write output: *dst=r7 dst++
        strh    r7, [r5,r3]         @ feedback into tab[writepos]=r7
        add     r2, r2, r4          @ readpos+=freq
        and     r2, r2, r6          @ mask readpos into range
        add     r3, r3, #2          @ writepos++
        and     r3, r3, r6          @ mask writepos into range
        subs    r1, r1, #1          @ length--
        bne     .maximus_loop       @ repeat until length zero
        mov     r0, r2              @ return readpos
        pop     {r4,r5,r6,r7}
        bx      lr                  @ exit
.tablength:
        .word   0x00003FF
</pre>
<p>And here it is running on autopilot with a test program in Betablocker:</p>
<p><iframe src="http://player.vimeo.com/video/28294545" width="600" height="450" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/08/betablocker-ds-table-feedback-after-claudius-maximus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Golden Medallions and in-game programming</title>
		<link>http://www.pawfal.org/dave/blog/2011/07/golden-medallions-and-in-game-programming/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/07/golden-medallions-and-in-game-programming/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 14:06:53 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[livecoding]]></category>
		<category><![CDATA[naked on pluto]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2098</guid>
		<description><![CDATA[Once the low level code for a Naked on Pluto bot is written in Scheme, it's added by the game using secret commands which program the game inside itself, while it's running. This means the game can be changed while people are playing it - which makes it much easier to add new things without [...]]]></description>
			<content:encoded><![CDATA[<p>Once the low level code for a Naked on Pluto bot is written in Scheme, it's added by the game using secret commands which program the game inside itself, while it's running. This means the game can be changed while people are playing it - which makes it much easier to add new things without worrying about the disruption caused by restarting the server. We can also work on the game collaboratively, at the same time this way.</p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/07/spybot.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/07/spybot.png" alt="" title="spybot" width="665" height="272" class="alignnone size-full wp-image-2099" /></a><br />
(Programming a spybot with it's behaviour)</p>
<p>Eventually the plan is to be able to program the bots fully within the game client - this is still a long term goal, but there are of course some fairly complex security problems with this idea.</p>
<p><a href="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/07/dress.png"><img src="http://www.pawfal.org/dave/blog/wp-content/uploads/2011/07/dress.png" alt="" title="dress" width="899" height="240" class="alignnone size-full wp-image-2100" /></a><br />
(dressing a AudienceBot with another object)</p>
<p>Not all players have the ability to use these secret commands right now, in order to access them a player has to be carrying a special object (also known as a "Golden Medallion"). This allows you access to all areas of the game, including an "administration room" and various other secret powers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/07/golden-medallions-and-in-game-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rainy sunday</title>
		<link>http://www.pawfal.org/dave/blog/2011/05/rainy-sunday/</link>
		<comments>http://www.pawfal.org/dave/blog/2011/05/rainy-sunday/#comments</comments>
		<pubDate>Sun, 29 May 2011 20:30:43 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[homebrew]]></category>
		<category><![CDATA[livecoding]]></category>
		<category><![CDATA[visual programming]]></category>

		<guid isPermaLink="false">http://www.pawfal.org/dave/blog/?p=2022</guid>
		<description><![CDATA[A rainy Sunday, with only the dog for company, so in between walks I thought I'd try and learn some assembler. I've been unhappy with triggering samples with Betablocker DS (I prefer synthesis) and I've heard good things about ARM asm - so it seemed like a good opportunity to attempt a small, fast and [...]]]></description>
			<content:encoded><![CDATA[<p>A rainy Sunday, with only the dog for company, so in between walks I thought I'd try and learn some assembler. I've been unhappy with triggering samples with Betablocker DS (I prefer synthesis) and I've heard good things about ARM asm - so it seemed like a good opportunity to attempt a small, fast and dirty synth.</p>
<p><iframe src="http://player.vimeo.com/video/24390484" width="600" height="450" frameborder="0"></iframe></p>
<p>I found some really nice tutorials <a href="http://www.coranac.com/tonc/text/asm.htm">here</a> and <a href="http://quirkygba.blogspot.com/2008/12/things-you-never-wanted-to-know-about.html">here</a>. I've done a tiny bit of this sort of thing before with microcontrollers, but this is a more of a respectable flavour of assembler, on a decent <a href="http://en.wikipedia.org/wiki/Reduced_instruction_set_computing">RISC</a> processor (which derives from the Acorn Archimedes and is now used on IPhones, Androids and Gameboys). Here is a white noise generator:</p>
<pre style='color:#000000;background:#ffffff;'><span style='color:#696969; '>; white_noise(r0=*dst, r1=clock, r2=length, r3=freq)</span>
<span style='color:#e34adc; '>white_noise:</span>
        <span style='color:#800000; font-weight:bold; '>push</span>    <span style='color:#808030; '>{</span>r4<span style='color:#808030; '>,</span>r5<span style='color:#808030; '>,</span>r6<span style='color:#808030; '>}</span>          <span style='color:#696969; '>; need to restore registers we use</span>
        <span style='color:#800000; font-weight:bold; '>mov</span>     r4<span style='color:#808030; '>,</span> r1              <span style='color:#696969; '>; r4 is the rand state (start with clock)</span>
        ldr     r5<span style='color:#808030; '>,</span> <span style='color:#808030; '>.</span>rnd_data       <span style='color:#696969; '>; r5 is the multiplier value</span>
        ldr     r6<span style='color:#808030; '>,</span> <span style='color:#808030; '>.</span>rnd_data<span style='color:#808030; '>+</span><span style='color:#008c00; '>1</span>     <span style='color:#696969; '>; r6 is the addition value</span>
<span style='color:#e34adc; '>.noise_loop:</span>
        mla     r4<span style='color:#808030; '>,</span> r5<span style='color:#808030; '>,</span> r4<span style='color:#808030; '>,</span> r6      <span style='color:#696969; '>; the maths bit: r4 = (r6 + (r5 * r4))</span>
        strh    r4<span style='color:#808030; '>,</span> <span style='color:#808030; '>[</span>r0<span style='color:#808030; '>]</span><span style='color:#808030; '>,</span> #<span style='color:#008c00; '>2</span>        <span style='color:#696969; '>; *dst++ = clock; </span>
        subs    r2<span style='color:#808030; '>,</span> r2<span style='color:#808030; '>,</span> #<span style='color:#008c00; '>1</span>          <span style='color:#696969; '>; length--;</span>
        bne     <span style='color:#808030; '>.</span>noise_loop         <span style='color:#696969; '>; branch if length not zero</span>
        <span style='color:#800000; font-weight:bold; '>pop</span>     <span style='color:#808030; '>{</span>r4<span style='color:#808030; '>,</span>r5<span style='color:#808030; '>,</span>r6<span style='color:#808030; '>}</span>
        <span style='color:#000080; '>bx</span>      lr                  <span style='color:#696969; '>; return</span>
<span style='color:#e34adc; '>.rnd_data:</span>
        <span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>word</span>   <span style='color:#008000; '>0x000343FD</span>          <span style='color:#696969; '>; nicked from ansi c rand()</span>
        <span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>word</span>   <span style='color:#008000; '>0x00269EC3</span>          <span style='color:#696969; '>; need to keep large numbers (&gt;8bit) as data</span>
</pre>
<p>This code is based on the ansi C rand() function that basically looks like this:</p>
<pre style='color:#000000;background:#ffffff;'>randnum <span style='color:#808030; '>=</span> randnum * <span style='color:#008c00; '>214013</span> <span style='color:#808030; '>+</span> <span style='color:#008c00; '>2531011</span><span style='color:#400000; '>;</span></pre>
<p>Which we can do in a single instruction - mla (<a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/CIHIHGGJ.html">multiply with accumulate</a>). Of course, gcc would presumably optimise much better code than mine from C++, but there is something more satisfying about doing it this way. I certainly prefer the sound - and over half the cpu usage remains unused with 5 voices and the interface running. The rest of the <a href="https://gitorious.org/flotsam/flotsam/blobs/master/ds/bbds/source/qrz.s">code is here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pawfal.org/dave/blog/2011/05/rainy-sunday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

