<?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>AH Squared &#187; javascript</title>
	<atom:link href="http://www.ahsquared.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ahsquared.com</link>
	<description>This is the home of AH Squared&#039;s many and varied activities</description>
	<lastBuildDate>Tue, 25 Oct 2011 03:30:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Creating a synth toy in HTML5 and Javascript</title>
		<link>http://www.ahsquared.com/2010/07/19/creating-a-synth-toy-in-html5-and-javascript/</link>
		<comments>http://www.ahsquared.com/2010/07/19/creating-a-synth-toy-in-html5-and-javascript/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 13:00:30 +0000</pubDate>
		<dc:creator>ahsquared</dc:creator>
				<category><![CDATA[audio]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[interaction]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[processing.js]]></category>
		<category><![CDATA[soundmanager]]></category>

		<guid isPermaLink="false">http://www.ahsquared.com/?p=739</guid>
		<description><![CDATA[It&#8217;s been a while since posting&#8230;life eh! Anyway, I&#8217;ve been actively working on a synth toy/tool that works in the browser using only HTML5 and Javascript (and jQuery [yes this is also js ], mainly to speed things up). It &#8230; <a href="http://www.ahsquared.com/2010/07/19/creating-a-synth-toy-in-html5-and-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since posting&#8230;life eh! Anyway, I&#8217;ve been actively  working on a synth toy/tool that works in the browser using only <a href="http://html5rocks.com/">HTML5</a> and <a href="http://www.crockford.com/javascript/javascript.html">Javascript</a> (and <a href="http://jquery.com/">jQuery</a> [yes this is also js <img src='http://www.ahsquared.com/wp/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ], mainly to speed things up).  It is here: <a href="http://www.ahsquared.com/synth/audiogen.html">http://ahsquared.com/synth/audiogen.html</a>.</p>
<p>I have made no attempt yet at UI design or even any kind of prettiness,  just getting the functionality squared away. This borrows heavily from a  <a href="http://acko.net/blog/javascript-audio-synthesis-with-html-5">blog  post</a> by Steven Wittens for how to create and manipulate the audio  samples.</p>
<p><span id="more-739"></span></p>
<p>I had been separately working on a little <a href="http://processingjs.org/">processing.js </a>app that was going to make use of <a href="http://www.schillmania.com/projects/soundmanager2/">soundmanager2</a>. I decided to change it to use html5 (although that is now also supported by sm2).</p>
<p>I am writing the audio directly to the &lt;audio&gt; tags as base64-encoded data URIs (audio samples wrapped in a wave file header), so I can generate them on the client side taking into consideration user choices about <a href="http://en.wikipedia.org/wiki/Audio_frequency">frequency</a>, <a href="http://en.wikipedia.org/wiki/Panning_%28audio%29">panning</a>, <a href="http://en.wikipedia.org/wiki/Amplitude">volume</a>, <a href="http://en.wikipedia.org/wiki/Synthesizer#Filter">filter sweep</a> to a second frequency, <a href="http://en.wikipedia.org/wiki/Duration">duration</a>, and <a href="http://en.wikipedia.org/wiki/Synthesizer#ADSR_envelope">adsr envelope</a>. There is also a waveform display, using the &lt;canvas&gt; element, that allows you to zoom in and out. As I am about to teach Introduction to Audio at <a href="http://www.cofa.unsw.edu.au/">COFA </a>in a week, I had been thinking of this as an educational tool that is easily accessible to anyone on the web. I&#8217;m hoping it can be optimized to work on mobile browsers as well. Of course, by the time that happens <a href="https://wiki.mozilla.org/Audio_Data_API">this </a>will probably be out and make this obsolete before it sees much light of day.</p>
<p>You can name the samples you create, and play them back, yay&#8230;boring unless you&#8217;re a synth geek! So you can also choose a sound from a dropdown and then click in the dark grey box and create a ball that plays back your sound when it hits something. You can make as many sounds as you want, and attach them to different balls. The balls also absorb other balls and their sound (when I get it working properly) when they collide with smaller ones.</p>
<p>This is all very rough at this point, the UI is god-awful, but will be worked and prettified soon.</p>
<p>Until then have fun.</p>
<p>Note: there is definite bugginess still, let&#8217;s say this is alpha stage.</p>
<p>While I was looking around last night, I came across <a href="http://lab.andre-michelle.com/pulsate">Pulsate</a>, which would have been very inspiring had I seen it before I got this far. I had played with <a href="http://lab.andre-michelle.com/tonematrix">Tonematrix </a>previously. Everything Andre does is pretty sweet (even if it is Flash <img src='http://www.ahsquared.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> )</p>
<p>Cheers,</p>
<p>Andre</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahsquared.com/2010/07/19/creating-a-synth-toy-in-html5-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Select All Bookmarklet</title>
		<link>http://www.ahsquared.com/2010/01/11/facebook-select-all-bookmarklet/</link>
		<comments>http://www.ahsquared.com/2010/01/11/facebook-select-all-bookmarklet/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 20:03:33 +0000</pubDate>
		<dc:creator>ahsquared</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.ahsquared.com/?p=659</guid>
		<description><![CDATA[For some reason Facebook seems to think that its users love clicking and so refuses to give us a Select All button (is that part of the monetization scheme? are they going to charge for it?) Anyway I can&#8217;t stand &#8230; <a href="http://www.ahsquared.com/2010/01/11/facebook-select-all-bookmarklet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For some reason Facebook seems to think that its users love clicking and so refuses to give us a Select All button (is that part of the monetization scheme? are they going to charge for it?) Anyway I can&#8217;t stand it, so I found a little bookmarklet that will invite all your friends.</p>
<p><br class="spacer_" /></p>
<p>The one I found worked well but it selected everyone, even those who were already members, so I altered it so it would only select friends who needed the invite. Follow the steps below to create the bookmarklet that makes this work. The instructions are for Firefox, but should be similar for other browsers.</p>
<p><br class="spacer_" /></p>
<p><strong><span style="font-size: small;">How to create a Firefox Bookmarklet</span></strong> The best way to do it would be to add this as a browser bookmarklet. <strong>So in FireFox:</strong></p>
<ol style="list-style-type: decimal;">
<li>Right click next to your other bookmarklets and select <strong>New Bookmark</strong>.</li>
<li>In the <strong>Name</strong> field type: FaceBook Select All (or whatever you want)</li>
<li>In the <strong>Location</strong> field copy and paste the code you see below in the code box exactly as it is. You can leave the KEYWORDS and DESCRIPTION field blank. They aren&#8217;t necessary.
<p><pre class="brush: js; highlight: [5, 15];">javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object' &amp;&amp; elms[fid].className != 'disabled'){fs.click(elms[fid]);}}</pre>
</li>
<li>Hit <strong>Add</strong>.</li>
</ol>
<p>You can also just drag this link to your bookmark toolbar: <a href="javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object' &amp;&amp; elms[fid].className != 'disabled'){fs.click(elms[fid]);}}">FB Select All</a></p>
<p>Now wherever you are adding friends to an event or group using the Facebook friend selector you can click the bookmarklet and it will select everyone who is not already a member.</p>
<p><br class="spacer_" /></p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahsquared.com/2010/01/11/facebook-select-all-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

