<?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>Programming Fundamentals &#187; Moushira Elamrawy</title>
	<atom:link href="http://legacy.iaacblog.com/mai2012-2013-programming/category/students/moushira-elamrawy/feed/" rel="self" type="application/rss+xml" />
	<link>http://legacy.iaacblog.com/mai2012-2013-programming</link>
	<description>Programming Fundamentals</description>
	<lastBuildDate>Tue, 18 Dec 2012 18:15:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Your moves into sound</title>
		<link>http://legacy.iaacblog.com/mai2012-2013-programming/2012/11/your-moves-into-sound/</link>
		<comments>http://legacy.iaacblog.com/mai2012-2013-programming/2012/11/your-moves-into-sound/#comments</comments>
		<pubDate>Mon, 19 Nov 2012 23:02:23 +0000</pubDate>
		<dc:creator>Moushira</dc:creator>
				<category><![CDATA[Exercises]]></category>
		<category><![CDATA[Int Programming]]></category>
		<category><![CDATA[Moushira Elamrawy]]></category>

		<guid isPermaLink="false">http://legacy.iaacblog.com/mai2012-2013-programming/?p=294</guid>
		<description><![CDATA[Ever wondered what would happen if you tracked your motion, used your motion parameters in building a sound wave? I also wondered and thought we can try. Click here to listen to the result (ps: it is super noisy). The initial idea was to track my skateboard rides and map the falls! (because I fall [...]]]></description>
				<content:encoded><![CDATA[<p>Ever wondered what would happen if you tracked your motion, used your motion parameters in building a sound wave?  I also wondered and thought we can try.   Click <a href='http://legacy.iaacblog.com/mai2012-2013-programming/files/2012/11/Sinewaves.mp3'>here</a> to listen to the result<em> (ps: it is super noisy).</em><br />
The initial idea was to track my skateboard rides and map the falls! (because I fall a lot on the side walks) where the repetion of the zero speed parameter, will make a rhythm. However, due to GPS problems with my phone, I ended up using random values that don&#8217;t correspond to a specific motion track.</p>
<p>The tone was generated by building a sine wave, which is constructed by 3 parameters, a frequency, an amplitude [-1,  1] and a sampling rate.  You can learn more about sine waves <a href="http://en.wikipedia.org/wiki/Sine_wave">here</a> . The sketch on the left is a quick render of different waves constructed with different frequencies and amplitudes, <a href="http://legacy.iaacblog.com/mai2012-2013-programming/files/2012/11/sinewaves.png"><img src="http://legacy.iaacblog.com/mai2012-2013-programming/files/2012/11/sinewaves-150x150.png" alt="" title="sinewaves" width="150" height="150" class="alignleft size-thumbnail wp-image-540" /></a> which I generated using   <a href="http://audacity.sourceforge.net/download"> Audacity</a>. Even though, we are converting data to sound and not the opposite, it is still important to learn how waves are constructed before we build them.</p>
<p>Now, as far as processing is concerned, it seems that <a href="http://code.compartmental.net/tools/minim">minim</a> library makes it an interesting tool to deal with sound, nevertheless, minim examples, which are installed by default in your package, and which come with an <a href="http://code.compartmental.net/minim/javadoc"> exact illustration</a> of how sinwaves works in your code (click Sinewave on the left tab). You don&#8217;t have to stick to sinewaves, you can also construct your waves using  square or triangulate functions. They are all controlled by the same 3 parameters: (frq, amplitude, samplerate).</p>
<p>In order to move to the code, after understanding how sound is being built, we need to start by having a look on <a href="http://www.vimeo.com/16907710">how classes are built</a> , then we use that to manipulate <a href="http://theantimap.com/category/applications/antimap-html5processingjs-simple-demo"> Antimap&#8217;s example</a> (<em>Yeah, we all love free examples</em>), or generate your own from scratch, if you aren&#8217;t a fan or freebies. I needed it to help deal with csv data input, however, I think that <a href="http://www.processing.org/reference/Table.html">table()</a> could provide a better solution, but I didn&#8217;t try it. The whole idea is to use different arrays to control the sine wave parameters in the function <code> SineWave(frq, latitude, out.sampleRate()) </code> then you can manipulate the different values from different arrays and see how interesting results could come along. You can also control sine.portamento() for different effects.  If you got a the <em>&#8220;buffer underrun in AudioOutput&#8221;</em> it is mostly because your draw function has nothing there, so check the processing forum for tips, also don&#8217;t forget the minum.stop () at the end of your code, otherwise the noise will loop forever, and it is too noisy indeed:)</p>
]]></content:encoded>
			<wfw:commentRss>http://legacy.iaacblog.com/mai2012-2013-programming/2012/11/your-moves-into-sound/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://legacy.iaacblog.com/mai2012-2013-programming/files/2012/11/Sinewaves.mp3" length="406673" type="audio/mpeg" />
		</item>
	</channel>
</rss>
