<?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>Lee McKinnon</title>
	<atom:link href="http://leemckinnon.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://leemckinnon.com</link>
	<description>I&#039;m a software engineer with an interest in Wall Street, electronic music and most things &#34;tech.&#34;</description>
	<lastBuildDate>Wed, 18 Aug 2010 23:17:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Top 5 C Sharp Tips I Wish I Knew Before Taking the Plunge</title>
		<link>http://leemckinnon.com/5-c-sharp-tips-i-wish-i-knew-before-taking-the-plunge/</link>
		<comments>http://leemckinnon.com/5-c-sharp-tips-i-wish-i-knew-before-taking-the-plunge/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 21:28:50 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://leemckinnon.com/?p=400</guid>
		<description><![CDATA[I&#8217;ve been programming in C Sharp for over 4 years (2 years while at an IT company). There are many things such as C Sharp language tips/patterns I wish I knew before I started that would have saved me a &#8230; <a href="http://leemckinnon.com/5-c-sharp-tips-i-wish-i-knew-before-taking-the-plunge/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fleemckinnon.com%2F5-c-sharp-tips-i-wish-i-knew-before-taking-the-plunge%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fleemckinnon.com%2F5-c-sharp-tips-i-wish-i-knew-before-taking-the-plunge%2F&amp;source=leemak&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been programming in C Sharp for over 4 years (2 years while at an IT company). There are many things such as C Sharp language tips/patterns I wish I knew before I started that would have saved me a lot of time in development. They don&#8217;t necessarily change the outcome but they <em>really </em> help with code review, readability and maintainability.</p>
<h4><strong>1. Ternary operation</strong></h4>
<p>Coalesce Operators (??) can drastically increase the readability of your code.</p>
<h5>Example:</h5>
<pre class="brush: csharp;">
if (genderMale.checked = true)
{
thisGender = Male;
}
else
{
thisGender = Female;
}
</pre>
<p>Although this code would work, it&#8217;s hard to read at 8 lines.</p>
<p>Let&#8217;s shrink this down using the ?: operator, shall we?</p>
<pre class="brush: cpp;"> thisGender = (genderMale.checked == true) ? Male : Female; </pre>
<p>Essentially, the format is :</p>
<h5>[ CONDITION ? FIRST_EXPRESSION : SECOND_EXPRESSION;]</h5>
<p>I use it wherever I can.</p>
<h6>(See: <a href="http://msdn.microsoft.com/en-us/library/ty67wk28(VS.80).aspx">http://msdn.microsoft.com/en-us/library/ty67wk28(VS.80).aspx</a> for more information)</h6>
<p><span id="more-400"></span></p>
<h4><strong>2. Using, well &#8220;Using()&#8221;</strong></h4>
<p>There have been times when I&#8217;ve had to open/delete/write a file and I would do this hundreds if not thousands of times. The problem I was having was that the &#8220;dispose()&#8221; method was not efficiently being called. To make matters worse, I had several threads going at once-what a nightmare. Until a collegue suggested &#8220;Using.&#8221;</p>
<p>The &#8220;Using&#8221; statement takes objects (that implement the IDisposable method) and allows you to use them without worrying about cleaning up resources.</p>
<p>For example, below, I am opening a file and doing some operation. The &#8220;Using()&#8221; statement takes care of cleaning up all resources and allows that file to be used elsewhere again and again.</p>
<pre class="brush: csharp;">
int billCount = 0;
using( var reader = File.OpenText( &amp;quot;myBills.txt&amp;quot; ) )
{
while( ( reader.ReadLine() ) != null )
{
billCount++;
}
}
</pre>
<p>Here, I am simply opening &#8220;mybills.txt&#8221; and iterating through every line, counting the number of bills. After I&#8217;m done, I don&#8217;t have to worry about closing the file, &#8220;Using()&#8221; does this for me.</p>
<h6>(See: <a href="http://msdn.microsoft.com/en-us/library/yh598w02(VS.80).aspx">http://msdn.microsoft.com/en-us/library/yh598w02(VS.80).aspx</a> for more info on the &#8220;Using()&#8221; statement)</h6>
<h4><strong>3. ReSharper</strong></h4>
<p>ReSharper is one amazing tool, it helps you fix, format, refactor and clean your code. It saves a <strong>ton</strong> of time and can get you out of a bind if you&#8217;re in a hurry to fix something.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="505" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/BdgOqlGkSPE?fs=1&amp;hl=en_US&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="505" src="http://www.youtube.com/v/BdgOqlGkSPE?fs=1&amp;hl=en_US&amp;rel=0&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>My favorite ReSharper features:</p>
<ul>
<li>Real time debugging. ( You&#8217;re reading that right)</li>
<li>Better syntax highlighting</li>
<li>Impressive keystroke shortcuts</li>
<li>Ability to rename anything, which then renames it everywhere else.</li>
<li>Gives suggestions on improving your code, what to delete, what to change.</li>
<li>Gives suggestions on what to remove, what items are not being used and are bloating your code.</li>
</ul>
<h6>Visit <a href="http://www.jetbrains.com/resharper/">http://www.jetbrains.com/resharper/</a> for more information on features and pricing.</h6>
<h4><strong>4. BackgroundWorker</strong></h4>
<p>For the longest time, I used strictly threads. That was until I came across the backgroundWorker class.</p>
<p>The background worker allows you to spawn a new thread much like typical threading does, but it comes with a lot more &#8220;built-in&#8221; functionality.</p>
<p>Here is the overall idea of the class:</p>
<ol>
<li>Create a new background worker class</li>
<li>Assign a method to the worker.</li>
<li>Start the worker.</li>
<li>Worker performs the time consuming method.</li>
<li>Worker reports progress to a progressBar.</li>
<li>The worker completes.</li>
<li>Results can be attached to the worker for processing (such as checking errors).</li>
</ol>
<p>Here is a great tutorial on the backgroundWorker: <a href="http://dotnetperls.com/backgroundworker">http://dotnetperls.com/backgroundworker</a></p>
<h6>(See: <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx">http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx</a> for more info on the BackgroundWorker)</h6>
<h4><strong>5. IEnumerable</strong></h4>
<p>For the longest time I ran across &#8220;IEnumerable&#8221; when reading technical papers or reading MSDN. I had no clue what it was and was almost scared to learn it.</p>
<p>Eventually I gave in when an colleague suggested that I used it to increase the performance and maintainability of an application I was developing.</p>
<p>The implementation of the logic was in an external class. I wanted to loop through a collection of items and update a progressBar. The problem was that the progressBar updating could <em>not</em> be performed in the external class because we wanted 100% separation of the logic and GUI. IEnumerable to the rescue!</p>
<p>IEnumerable allows you to iterate through a collection of items one at a time. It provides total separation between logic and GUI and you can still perform operations on the items during each iteration, all while leaving the IEnumerable method intact. This also greatly decreases chances of errors since you do not have to edit the IEnumerable method (provided it works <em>as is</em>).</p>
<h6>(See: <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx">http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx</a> for more info on IEnumerable)</h6>
<p>Thats it! Hope I&#8217;ve helped someone out there.</p>
<p><a href="http://twitter.com/leemak">Follow me on twitter! @leemak</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leemckinnon.com/5-c-sharp-tips-i-wish-i-knew-before-taking-the-plunge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing ShowPulse</title>
		<link>http://leemckinnon.com/introducing-showpulse/</link>
		<comments>http://leemckinnon.com/introducing-showpulse/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 02:43:35 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[showpulse]]></category>

		<guid isPermaLink="false">http://leemckinnon.com/?p=376</guid>
		<description><![CDATA[Yesterday on my way home from my last class ever, I began to think of what radio shows I had missed during the week. I&#8217;m a huge fan of electronic radio shows such as A State of Trance, Trance Around &#8230; <a href="http://leemckinnon.com/introducing-showpulse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fleemckinnon.com%2Fintroducing-showpulse%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fleemckinnon.com%2Fintroducing-showpulse%2F&amp;source=leemak&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Yesterday on my way home from my last class <em>ever</em>, I began to think of what radio shows I had missed during the week.</p>
<p>I&#8217;m a huge fan of electronic radio shows such as <a href="http://www.astateoftrance.com/">A State of Trance</a>, <a href="www.trancearoundtheworld.com/">Trance Around the World</a> and the <a href="http://www.markusschulz.com/gdjb.php">Global DJ Broadcast</a>. They introduce the latest tracks from around the world and it&#8217;s always different, I&#8217;ve even <a href="http://leemckinnon.com/trance-videos/">stayed up 48 hours to travel NYC to be part of a live show</a>. There&#8217;s just one problem, I can&#8217;t for the life of me remember when and what time they air. Plus, I keep forgetting about many of them since there are so many.</p>
<p>Fast forward an hour to 6:00PM and I&#8217;m at my white board. I began designing a simple system to alert users when a radio show was playing. I began to develop &#8220;<a href="http://leemckinnon.com/showpulse/#">ShowPulse</a>.&#8221;<br />
<a href="http://leemckinnon.com/wp-content/uploads/2010/08/showpulse.png"><img class="size-large wp-image-377" title="showpulse" src="http://leemckinnon.com/wp-content/uploads/2010/08/showpulse-1024x716.png" alt="" width="640" height="447" /></a></p>
<h4>
<h6>Graphical User Interface (GUI)</h6>
<p><a href="http://leemckinnon.com/wp-content/uploads/2010/08/showemail.jpg"><img class="size-full wp-image-392 alignnone" title="showemail" src="http://leemckinnon.com/wp-content/uploads/2010/08/showemail.jpg" alt="" width="478" height="207" /></a></h4>
<h6>Example of email sent to user when a show is playing.</h6>
<h4><strong>What is ShowPulse?</strong></h4>
<p>Show pulse:</p>
<ul>
<li>Displays radio shows and the time until the next show.</li>
<li>Displays time until end of show if the show is currently airing.</li>
<li>Allows you to subscribe to alerts pertaining to a particular radio show.</li>
<li>User provides an email which requires activation.</li>
<li>Upon activation, the system will process the user every 30 minutes via a Cron job script.</li>
<li>Users can subscribe to as many shows as they wish.</li>
<li>Users can manage their subscriptions easily and remove any show they wish from their alert queue.</li>
<li>Cron job runs every 30 minutes and sends out the alerts to users based on their subscriptions.</li>
</ul>
<p>It took me around 6 hours to finish the site from start to finish, starting with a blank screen and a css reset I always use.</p>
<p>The site uses AJAX heavily (JQuery rocks) and as you can imagine a somewhat simple database scheme.</p>
<p><a href="http://leemckinnon.com/showpulse/#">Visit ShowPulse now!</a></p>
<p><a href="http://twitter.com/leemak">Follow me on twitter! @leemak</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leemckinnon.com/introducing-showpulse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Less Photoshop and More CSS</title>
		<link>http://leemckinnon.com/using-less-photoshop-and-more-css/</link>
		<comments>http://leemckinnon.com/using-less-photoshop-and-more-css/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 00:28:31 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://leemckinnon.com/?p=363</guid>
		<description><![CDATA[I&#8217;m developing a new site and I get this question quite often: &#8220;You make that with Photoshop?&#8221; My answer is yes and no. So how do I typically design my sites? I first start on paper. Not only is this &#8230; <a href="http://leemckinnon.com/using-less-photoshop-and-more-css/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fleemckinnon.com%2Fusing-less-photoshop-and-more-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fleemckinnon.com%2Fusing-less-photoshop-and-more-css%2F&amp;source=leemak&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: left;">I&#8217;m developing a new site and I get this question quite often: &#8220;You make that with Photoshop?&#8221;</p>
<p>My answer is yes and no.</p>
<p><strong>So how do I typically design my sites?</strong></p>
<h4>I first start on<em> paper.</em></h4>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<div id="attachment_365" class="wp-caption aligncenter" style="width: 610px"><a href="http://leemckinnon.com/wp-content/uploads/2010/08/IMG_6246.png"><img class="size-full wp-image-365" title="IMG_6246" src="http://leemckinnon.com/wp-content/uploads/2010/08/IMG_6246.png" alt="" width="600" height="340" /></a><p class="wp-caption-text">Engineering paper is bliss!</p></div>
<p><span style="font-style: normal;">Not only is this a fast way to layout the site, it makes it easier to design later in Photoshop. I try to layout where all the elements will go, notes on functions/details and other tidbits I think may be useful later.</span></p>
<h4><span style="font-style: normal;"><span id="more-363"></span>Then I proceed to Photoshop</span></h4>
<p><span style="font-style: normal;"> </span></p>
<div id="attachment_373" class="wp-caption aligncenter" style="width: 610px"><a href="http://leemckinnon.com/wp-content/uploads/2010/08/Untitled-2.png"><img class="size-full wp-image-373" title="beatphotoshop" src="http://leemckinnon.com/wp-content/uploads/2010/08/Untitled-2.png" alt="" width="600" height="328" /></a><p class="wp-caption-text">Photo...creating</p></div>
<p><span style="font-style: normal;">I begin digitizing the template by laying out the structure I created on paper. I make the template as much as I can before I need text to help decide if I want/need to move elements that look out of place. I then add links, text, images. The end result is close to the final site, but not exact. Objects will shift, move, stretch depending on the users browsers, my CSS skills and other small obstacles.</span></p>
<p><span style="font-style: normal;">Colors are pretty much determined at this point. It&#8217;s nearly impossible to figure out the final color scheme in your head. Opacity helps a lot with determining colors. Find a good color, adjust the transparency and see how it looks. The colors&#8217; 6 digit hex (#XXXXXX) values will be used in the next step.</span></p>
<p>Cross browser compatibility is actually a <strong><em>huge</em><span style="font-weight: normal;"> problem, but luckily they (looking at you IE!!!) are catching up to web standards.</span></strong><span style="font-style: normal;">.</span></p>
<h4><span style="font-style: normal;">Finally I create the </span><em>actual</em> site</h4>
<p>For this part, I start coding the structure of the site using &#8220;divs&#8221; and <em>not</em> tables<a href="http://www.xhtmlvalid.com/blog/2008/02/20/divs-vs-tables/">. Divs are awesome, I urge you to try</a>! I retreive colors from Photoshop (magic wand) and copy the 6 digit hex values and import them into CSS. As I build the site, I slowly build a library of useful CSS classes and ids. I barely import any images from Photoshop, 98% of the site looks and feels using pure CSS. For the site below, I used a repeating background image which is impossible (at least for now) to recreate in CSS.</p>
<p>A few tips:</p>
<ul>
<li>If you need a hover effect on a link, use (#link:hover). Make the attribute have a different background, this produces the same affect as a bulky image file for each link you want this to happen to.</li>
<li>If you need gradients from photoshop, create a 1 pixel wide version of it (with the full height that you need). The element that uses this gradient should have it repeat horizontally (repeat-x).</li>
<li>Really need a bunch of images for a particular element? <a href="http://www.alistapart.com/articles/sprites">Use CSS sprites if you can.</a> Throw all the images into one neat image and alter the appearance using CSS.</li>
<li>Use floats (just clear them with the parent!) to position left and right.</li>
<li>Use (margin: 0 auto; width: XXX) to position horizontally.</li>
<li>Use JQuery/Prototype/Mootools/YUI instead of flash! Do humanity some good! <img src='http://leemckinnon.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </li>
</ul>
<div id="attachment_364" class="wp-caption aligncenter" style="width: 514px"><a href="http://leemckinnon.com/wp-content/uploads/2010/08/sigbeat.jpg"><img class="size-full wp-image-364" title="sigbeat" src="http://leemckinnon.com/wp-content/uploads/2010/08/sigbeat.jpg" alt="(Almost) finished site" width="504" height="334" /></a><p class="wp-caption-text">(Almost) finished site</p></div>
<h4><strong>Conclusion</strong></h4>
<p>To sum it all up:</p>
<ol>
<li>Sketch sketch sketch! It will help out later!</li>
<li>Build a prototype in Photoshop. This will help you with your color scheme, <em>almost</em> exact final look and a good base for coding.</li>
<li>Produce a site with as much CSS and as little images as possible. The less images, the better performance. Better performance, happier visitors.</li>
</ol>
<p><a href="http://twitter.com/leemak">Follow me on twitter! @leemak</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leemckinnon.com/using-less-photoshop-and-more-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review: SAMSUNG BX2440X</title>
		<link>http://leemckinnon.com/review-samsung-bx2440x/</link>
		<comments>http://leemckinnon.com/review-samsung-bx2440x/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 21:16:32 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[bx2440]]></category>
		<category><![CDATA[lcd monitor]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[samsung]]></category>

		<guid isPermaLink="false">http://leemckinnon.com/?p=315</guid>
		<description><![CDATA[*Scroll to bottom for update! (July 26, 2010) A few months ago I needed a new LCD panel because at time I only had one 21&#8243; LCD that was a programmer&#8217;s nightmare. I searched the internet for the best LCD &#8230; <a href="http://leemckinnon.com/review-samsung-bx2440x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fleemckinnon.com%2Freview-samsung-bx2440x%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fleemckinnon.com%2Freview-samsung-bx2440x%2F&amp;source=leemak&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><span style="color: #ff0000;">*Scroll to bottom for update! (July 26, 2010)</span></p>
<p>A few months ago I needed a new LCD panel because at time I only had one 21&#8243; LCD that was a programmer&#8217;s nightmare. I searched the internet for the best LCD for my money. I came across the Samsung BX2440X, there were little to no reviews on the panel so I&#8217;d be taking a chance. I&#8217;m glad I did!</p>
<div id="attachment_316" class="wp-caption aligncenter" style="width: 525px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/BX2440_dimension.jpg"><img class="size-full wp-image-316" title="Samsung BX2440X Stock Image" src="http://leemckinnon.com/wp-content/uploads/2010/06/BX2440_dimension.jpg" alt="" width="515" height="265" /></a><p class="wp-caption-text">From Samsung.com</p></div>
<h4>Main Features</h4>
<ul>
<li><strong>1920 x 1080 resolution &#8211; </strong>Very crisp resolution, excellent for web browsing or gaming.</li>
<li><strong>24&#8243; diagonal width &#8211; </strong>Large screen means more productivity!</li>
<li><strong>5ms response time</strong> &#8211; Slower than some gaming panels but I haven&#8217;t notice any issues with BC2 or WoW.</li>
<li><strong>DVI &amp; VGA inputs &#8211; </strong>No HDMI here, I can&#8217;t tell the difference.</li>
<li><strong>Fully height adjustable stand </strong> &#8211; Move it up or down to fit your style.</li>
<li><strong>Vertical &amp; Horizontal adjustable </strong> &#8211; Awesome feature for an LCD in this price range. I couldn&#8217;t find any that had this feature under $500.</li>
<li><strong>LED backlight </strong>- Very energy efficient and the LCD as a whole uses 25 Watts and under .3W in standby.</li>
<li><strong>Very thin bezel </strong>- Great looking frame.</li>
</ul>
<p><span id="more-315"></span></p>
<h4>Specifications</h4>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>Screen Size</td>
<td>24&#8243;</td>
</tr>
<tr>
<td>LED Backlight</td>
<td>Yes</td>
</tr>
<tr>
<td>Widescreen</td>
<td>Yes</td>
</tr>
<tr>
<td>Recommended Resolution</td>
<td>1920 x 1080</td>
</tr>
<tr>
<td>Viewing Angle</td>
<td>170°(H) / 160°(V)</td>
</tr>
<tr>
<td>Pixel Pitch</td>
<td>0.282mm</td>
</tr>
<tr>
<td>Brightness</td>
<td>250 cd/m2</td>
</tr>
<tr>
<td>Contrast Ratio</td>
<td>DC 1,000,000:1(1000:1)</td>
</tr>
<tr>
<td>Response Time</td>
<td>5ms</td>
</tr>
<tr>
<td>Bezel Width</td>
<td>1.9 cm (Inches: 3/4)</td>
</tr>
</tbody>
</table>
<p><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16824001389&amp;Tpk=bx2440x">Source</a></p>
<h4>Whats in the box?</h4>
<ul>
<li>Panel</li>
<li>Stand (bolts into panel)</li>
<li>DVI cable</li>
<li>Power cable.</li>
<li>CD with drivers (I never installed them)</li>
<li>Lots of Styrofoam.</li>
</ul>
<h4>Photos</h4>
<div id="attachment_323" class="wp-caption aligncenter" style="width: 520px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5142.jpg"><img class="size-full wp-image-323 " title="IMG_5142" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5142.jpg" alt="" width="510" height="340" /></a><p class="wp-caption-text">No damage during shipping!</p></div>
<div id="attachment_322" class="wp-caption aligncenter" style="width: 520px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5138.jpg"><img class="size-full wp-image-322 " title="IMG_5138" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5138.jpg" alt="" width="510" height="340" /></a><p class="wp-caption-text">Some of the marketing features ( <img src='http://leemckinnon.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p></div>
<div id="attachment_325" class="wp-caption aligncenter" style="width: 520px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5144.jpg"><img class="size-full wp-image-325 " title="IMG_5144" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5144.jpg" alt="First looks" width="510" height="340" /></a><p class="wp-caption-text">First Looks</p></div>
<p style="text-align: center;">
<div id="attachment_326" class="wp-caption aligncenter" style="width: 520px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5152.jpg"><img class="size-full wp-image-326 " title="IMG_5152" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5152.jpg" alt="" width="510" height="340" /></a><p class="wp-caption-text">Menu (real buttons)</p></div>
<div id="attachment_327" class="wp-caption aligncenter" style="width: 520px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5157.jpg"><img class="size-full wp-image-327 " title="IMG_5157" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_5157.jpg" alt="Connections" width="510" height="340" /></a><p class="wp-caption-text">Connections on back</p></div>
<div id="attachment_359" class="wp-caption aligncenter" style="width: 710px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6210.png"><img class="size-full wp-image-359  " title="IMG_6210" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6210.png" alt="" width="700" height="417" /></a><p class="wp-caption-text">Samsung BX2440X on left next to 21&quot; (which is closer so it may appear bigger)</p></div>
<p style="text-align: center;">
<h4>My Impressions</h4>
<p><em>Design</em></p>
<p>The panel is gorgeous. Very thin bezel and glossy black finish make it a sharp looking panel. The power button lights up blue and is not overpowering, it&#8217;s subtle.</p>
<p>One problem I have with the design is the location of the power plug. It&#8217;s on the far right (if facing the LCD) and when you try to orientate the panel vertically, it gets caught on the plug. This forces me to tilt the panel back so that it can move around.</p>
<p><em>Color</em></p>
<p>I&#8217;m no expert Photoshop user or design student but the colors are brilliant. They are very crisp and are on par with my Samsung HDTV. Movies look awesome in full 1080p resolution.</p>
<p><em>Connections</em></p>
<p>Very little when compared to cheaper devices. DVI and VGA here only! No HDMI or display port.</p>
<p><em>Hardware</em></p>
<p>This does not have one of the new IPS panels which were too expensive for my budget. This panel is bright however delivering a great contrast ratio.</p>
<p><em>Gaming</em></p>
<p>Gaming is awesome on this display. No tearing or ghosting! Colors look awesome when I compare them to my old LCD.</p>
<h4>Conclusion</h4>
<p>The panel is excellent. If you are a casual gamer like me that mainly surfs the internet and codes, this is the perfect panel for you. Gaming was <strong>perfectly fine</strong> and I notices no issues with ghosting or tearing at full settings in Bad Company 2.</p>
<p><em>Pros:</em></p>
<ul>
<li>Fully adjustable stand</li>
<li>Great size at 24&#8243;</li>
<li>LED powered so great energy efficiency</li>
<li>Minimal heat output</li>
<li>Great contrast ratio</li>
<li>Under $300</li>
</ul>
<p><em>Cons:</em></p>
<ul>
<li>Not one of the new IPS panels</li>
<li>Refresh rate low for some people</li>
<li>Weird plug position that makes it hard to orientate vertically.</li>
</ul>
<h4>Update (July 26, 2010)</h4>
<p>Here are some updated photos. John in the comments heared that the plug was an issue when adjusting the LCD to the vertical position.</p>
<p>The problem is that the plug sticks out too far. This is true; however, I only have to tilt the screen from the bottom to go around the plug. See the new pictures below.</p>
<div id="attachment_354" class="wp-caption aligncenter" style="width: 370px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6219.png"><img class="size-full wp-image-354 " title="IMG_6219" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6219.png" alt="The plug sticks out slightly which hits the main support post." width="360" height="540" /></a><p class="wp-caption-text">The plug sticks out slightly which hits the main support post.</p></div>
<p>This is avoided by tilting the LCD outward from the bottom.</p>
<div id="attachment_355" class="wp-caption aligncenter" style="width: 370px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6220.png"><img class="size-full wp-image-355 " title="IMG_6220" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6220.png" alt="" width="360" height="540" /></a><p class="wp-caption-text">Tilting the panel outward.</p></div>
<p>Then I tilt the monitor into the portrait position and push it back vertically.</p>
<div id="attachment_356" class="wp-caption aligncenter" style="width: 370px"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6222.png"><img class="size-full wp-image-356 " title="IMG_6222" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6222.png" alt="" width="360" height="540" /></a><p class="wp-caption-text">LCD rotated and pushed back (bottom is pushed back towards pole)</p></div>
<p>Then I&#8217;m all set!</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_357" class="wp-caption aligncenter" style="width: 370px;">
<dt class="wp-caption-dt"><a href="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6223.png"><img class="size-full wp-image-357 " title="IMG_6223" src="http://leemckinnon.com/wp-content/uploads/2010/06/IMG_6223.png" alt="" width="360" height="540" /></a></dt>
</dl>
</div>
<h4>Final Thoughts</h4>
<p>I&#8217;ve had this monitor for about 2 months now. I have had <strong>no problems</strong> with it and will be picking up another once I graduate in August. It&#8217;s the perfect size and has plenty of desktop real estate within.</p>
<p>Hope this helps!</p>
<p><a href="http://twitter.com/leemak">Follow me on twitter! @leemak</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leemckinnon.com/review-samsung-bx2440x/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>TV Themes and Music for Arduino</title>
		<link>http://leemckinnon.com/tv-themes-and-music-for-arduino/</link>
		<comments>http://leemckinnon.com/tv-themes-and-music-for-arduino/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 14:34:49 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[interesting]]></category>

		<guid isPermaLink="false">http://leemckinnon.com/?p=296</guid>
		<description><![CDATA[I was in lab today with my senior design team and we just finished building our audio amplifier for use in our project. We had a few tones to play which proved our circuit worked; however; other classmates requested songs. &#8230; <a href="http://leemckinnon.com/tv-themes-and-music-for-arduino/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fleemckinnon.com%2Ftv-themes-and-music-for-arduino%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fleemckinnon.com%2Ftv-themes-and-music-for-arduino%2F&amp;source=leemak&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I was in lab today with my senior design team and we just finished building our audio amplifier for use in our project. We had a few tones to play which proved our circuit worked; however; other classmates requested songs. I searched the net and found a script that incorporates ringtone sequences.</p>
<h3>The Tunes</h3>
<p>The following sites have plenty of songs which you need to adapt for the script below:</p>
<ul>
<li><a href="http://merwin.bespin.org/db/rts/index.php">http://merwin.bespin.org/db/rts/index.php</a></li>
<li><a href="http://www.cellringtones.com/">http://www.cellringtones.com/</a></li>
<li><a href="http://merwin.bespin.org/db/rts/index.php">http://merwin.bespin.org/db/rts/index.php</a></li>
<li><a href="http://www.cellringtones.com/">http://www.cellringtones.com/</a></li>
<li><a href="http://nokiatone.ifrance.com/nokiatone/rtttf.htm">http://nokiatone.ifrance.com/nokiatone/rtttf.htm</a></li>
<li><a href="http://www.ringtones4all.com/index.php?page=freetone&amp;catr=20&amp;cnt=0">http://www.ringtones4all.com/index.php?page=freetone&amp;catr=20&amp;cnt=0</a></li>
<li><a href="http://ringtones.frostzone.com/">http://ringtones.frostzone.com/</a></li>
<li><a href="http://www.2thumbswap.com/members/tones/nokia/tones_nokia_main.html">http://www.2thumbswap.com/members/tones/nokia/tones_nokia_main.html</a></li>
<li><a href="http://hem.passagen.se/klas2/vgtones/">http://hem.passagen.se/klas2/vgtones/</a></li>
<li><a href="http://arcadetones.emuunlim.com/">http://arcadetones.emuunlim.com/</a></li>
</ul>
<p>Found via: <a href="http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation">http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation</a></p>
<p><span id="more-296"></span></p>
<h3>Required Code</h3>
<p>I commented the &#8220;Looney Tunes&#8221; tone sequence. Simple add one from the sites above or uncomment sequences from the code below. This code should run instantly. Make sure you are using pin 13 though, took me a minute to figure out why it wasn&#8217;t working, doh!</p>
<pre class="brush: cpp;">
// A fun sketch to demonstrate the use of the Tone library.
// By Brett Hagman
// bhagman@roguerobotics.com
// www.roguerobotics.com

// To mix the output of the signals to output to a small speaker (i.e. 8 Ohms or higher),
// simply use 1K Ohm resistors from each output pin and tie them together at the speaker.
// Don't forget to connect the other side of the speaker to ground!

// You can get more RTTTL (RingTone Text Transfer Language) songs from
// http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation

#define OCTAVE_OFFSET 0
#define TONE_PIN 13

#define NOTE_C4  262
#define NOTE_CS4 277
#define NOTE_D4  294
#define NOTE_DS4 311
#define NOTE_E4  330
#define NOTE_F4  349
#define NOTE_FS4 370
#define NOTE_G4  392
#define NOTE_GS4 415
#define NOTE_A4  440
#define NOTE_AS4 466
#define NOTE_B4  494
#define NOTE_C5  523
#define NOTE_CS5 554
#define NOTE_D5  587
#define NOTE_DS5 622
#define NOTE_E5  659
#define NOTE_F5  698
#define NOTE_FS5 740
#define NOTE_G5  784
#define NOTE_GS5 831
#define NOTE_A5  880
#define NOTE_AS5 932
#define NOTE_B5  988
#define NOTE_C6  1047
#define NOTE_CS6 1109
#define NOTE_D6  1175
#define NOTE_DS6 1245
#define NOTE_E6  1319
#define NOTE_F6  1397
#define NOTE_FS6 1480
#define NOTE_G6  1568
#define NOTE_GS6 1661
#define NOTE_A6  1760
#define NOTE_AS6 1865
#define NOTE_B6  1976
#define NOTE_C7  2093
#define NOTE_CS7 2217
#define NOTE_D7  2349
#define NOTE_DS7 2489
#define NOTE_E7  2637
#define NOTE_F7  2794
#define NOTE_FS7 2960
#define NOTE_G7  3136
#define NOTE_GS7 3322
#define NOTE_A7  3520
#define NOTE_AS7 3729
#define NOTE_B7  3951

int notes[] = { 0,
NOTE_C4, NOTE_CS4, NOTE_D4, NOTE_DS4, NOTE_E4, NOTE_F4, NOTE_FS4, NOTE_G4, NOTE_GS4, NOTE_A4, NOTE_AS4, NOTE_B4,
NOTE_C5, NOTE_CS5, NOTE_D5, NOTE_DS5, NOTE_E5, NOTE_F5, NOTE_FS5, NOTE_G5, NOTE_GS5, NOTE_A5, NOTE_AS5, NOTE_B5,
NOTE_C6, NOTE_CS6, NOTE_D6, NOTE_DS6, NOTE_E6, NOTE_F6, NOTE_FS6, NOTE_G6, NOTE_GS6, NOTE_A6, NOTE_AS6, NOTE_B6,
NOTE_C7, NOTE_CS7, NOTE_D7, NOTE_DS7, NOTE_E7, NOTE_F7, NOTE_FS7, NOTE_G7, NOTE_GS7, NOTE_A7, NOTE_AS7, NOTE_B7
};

//char *song = &quot;The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6&quot;;
//char *song = &quot;Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6&quot;;
//char *song = &quot;Entertainer:d=4,o=5,b=140:8d,8d#,8e,c6,8e,c6,8e,2c.6,8c6,8d6,8d#6,8e6,8c6,8d6,e6,8b,d6,2c6,p,8d,8d#,8e,c6,8e,c6,8e,2c.6,8p,8a,8g,8f#,8a,8c6,e6,8d6,8c6,8a,2d6&quot;;
char *song = &quot;Looney:d=4,o=5,b=140:32p,c6,8f6,8e6,8d6,8c6,a.,8c6,8f6,8e6,8d6,8d#6,e.6,8e6,8e6,8c6,8d6,8c6,8e6,8c6,8d6,8a,8c6,8g,8a#,8a,8f&quot;;
//char *song = &quot;Bond:d=4,o=5,b=80:32p,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d#6,16d#6,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d6,16c#6,16c#7,c.7,16g#6,16f#6,g#.6&quot;;
//char *song = &quot;MASH:d=8,o=5,b=140:4a,4g,f#,g,p,f#,p,g,p,f#,p,2e.,p,f#,e,4f#,e,f#,p,e,p,4d.,p,f#,4e,d,e,p,d,p,e,p,d,p,2c#.,p,d,c#,4d,c#,d,p,e,p,4f#,p,a,p,4b,a,b,p,a,p,b,p,2a.,4p,a,b,a,4b,a,b,p,2a.,a,4f#,a,b,p,d6,p,4e.6,d6,b,p,a,p,2b&quot;;
//char *song = &quot;StarWars:d=4,o=5,b=45:32p,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#.6,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#6&quot;;
//char *song = &quot;GoodBad:d=4,o=5,b=56:32p,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,d#,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,c#6,32a#,32d#6,32a#,32d#6,8a#.,16f#.,32f.,32d#.,c#,32a#,32d#6,32a#,32d#6,8a#.,16g#.,d#&quot;;
//char *song = &quot;TopGun:d=4,o=4,b=31:32p,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,16f,d#,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,g#&quot;;
//char *song = &quot;A-Team:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#&quot;;
//char *song = &quot;Flinstones:d=4,o=5,b=40:32p,16f6,16a#,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,d6,16f6,16a#.,16a#6,32g6,16f6,16a#.,32f6,32f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,a#,16a6,16d.6,16a#6,32a6,32a6,32g6,32f#6,32a6,8g6,16g6,16c.6,32a6,32a6,32g6,32g6,32f6,32e6,32g6,8f6,16f6,16a#.,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#6,16c7,8a#.6&quot;;
//char *song = &quot;Jeopardy:d=4,o=6,b=125:c,f,c,f5,c,f,2c,c,f,c,f,a.,8g,8f,8e,8d,8c#,c,f,c,f5,c,f,2c,f.,8d,c,a#5,a5,g5,f5,p,d#,g#,d#,g#5,d#,g#,2d#,d#,g#,d#,g#,c.7,8a#,8g#,8g,8f,8e,d#,g#,d#,g#5,d#,g#,2d#,g#.,8f,d#,c#,c,p,a#5,p,g#.5,d#,g#&quot;;
//char *song = &quot;MahnaMahna:d=16,o=6,b=125:c#,c.,b5,8a#.5,8f.,4g#,a#,g.,4d#,8p,c#,c.,b5,8a#.5,8f.,g#.,8a#.,4g,8p,c#,c.,b5,8a#.5,8f.,4g#,f,g.,8d#.,f,g.,8d#.,f,8g,8d#.,f,8g,d#,8c,a#5,8d#.,8d#.,4d#,8d#.&quot;;
//char *song = &quot;MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d&quot;;
//char *song = &quot;KnightRider:d=4,o=5,b=125:16e,16p,16f,16e,16e,16p,16e,16e,16f,16e,16e,16e,16d#,16e,16e,16e,16e,16p,16f,16e,16e,16p,16f,16e,16f,16e,16e,16e,16d#,16e,16e,16e,16d,16p,16e,16d,16d,16p,16e,16d,16e,16d,16d,16d,16c,16d,16d,16d,16d,16p,16e,16d,16d,16p,16e,16d,16e,16d,16d,16d,16c,16d,16d,16d&quot;;
//char *song = &quot;The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6&quot;;
//char *song = &quot;Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6&quot;;
//char *song = &quot;TakeOnMe:d=4,o=4,b=160:8f#5,8f#5,8f#5,8d5,8p,8b,8p,8e5,8p,8e5,8p,8e5,8g#5,8g#5,8a5,8b5,8a5,8a5,8a5,8e5,8p,8d5,8p,8f#5,8p,8f#5,8p,8f#5,8e5,8e5,8f#5,8e5,8f#5,8f#5,8f#5,8d5,8p,8b,8p,8e5,8p,8e5,8p,8e5,8g#5,8g#5,8a5,8b5,8a5,8a5,8a5,8e5,8p,8d5,8p,8f#5,8p,8f#5,8p,8f#5,8e5,8e5&quot;;
//char *song = &quot;Entertainer:d=4,o=5,b=140:8d,8d#,8e,c6,8e,c6,8e,2c.6,8c6,8d6,8d#6,8e6,8c6,8d6,e6,8b,d6,2c6,p,8d,8d#,8e,c6,8e,c6,8e,2c.6,8p,8a,8g,8f#,8a,8c6,e6,8d6,8c6,8a,2d6&quot;;
//char *song = &quot;Muppets:d=4,o=5,b=250:c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,8a,8p,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,8e,8p,8e,g,2p,c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,a,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,d,8d,c&quot;;
//char *song = &quot;Xfiles:d=4,o=5,b=125:e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,g6,f#6,e6,d6,e6,2b.,1p,g6,f#6,e6,d6,f#6,2b.,1p,e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,e6,2b.&quot;;
//char *song = &quot;Looney:d=4,o=5,b=140:32p,c6,8f6,8e6,8d6,8c6,a.,8c6,8f6,8e6,8d6,8d#6,e.6,8e6,8e6,8c6,8d6,8c6,8e6,8c6,8d6,8a,8c6,8g,8a#,8a,8f&quot;;
//char *song = &quot;20thCenFox:d=16,o=5,b=140:b,8p,b,b,2b,p,c6,32p,b,32p,c6,32p,b,32p,c6,32p,b,8p,b,b,b,32p,b,32p,b,32p,b,32p,b,32p,b,32p,b,32p,g#,32p,a,32p,b,8p,b,b,2b,4p,8e,8g#,8b,1c#6,8f#,8a,8c#6,1e6,8a,8c#6,8e6,1e6,8b,8g#,8a,2b&quot;;
//char *song = &quot;Bond:d=4,o=5,b=80:32p,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d#6,16d#6,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d6,16c#6,16c#7,c.7,16g#6,16f#6,g#.6&quot;;
//char *song = &quot;MASH:d=8,o=5,b=140:4a,4g,f#,g,p,f#,p,g,p,f#,p,2e.,p,f#,e,4f#,e,f#,p,e,p,4d.,p,f#,4e,d,e,p,d,p,e,p,d,p,2c#.,p,d,c#,4d,c#,d,p,e,p,4f#,p,a,p,4b,a,b,p,a,p,b,p,2a.,4p,a,b,a,4b,a,b,p,2a.,a,4f#,a,b,p,d6,p,4e.6,d6,b,p,a,p,2b&quot;;
//char *song = &quot;StarWars:d=4,o=5,b=45:32p,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#.6,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#6&quot;;
//char *song = &quot;GoodBad:d=4,o=5,b=56:32p,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,d#,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,c#6,32a#,32d#6,32a#,32d#6,8a#.,16f#.,32f.,32d#.,c#,32a#,32d#6,32a#,32d#6,8a#.,16g#.,d#&quot;;
//char *song = &quot;TopGun:d=4,o=4,b=31:32p,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,16f,d#,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,g#&quot;;
//char *song = &quot;A-Team:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#&quot;;
//char *song = &quot;Flinstones:d=4,o=5,b=40:32p,16f6,16a#,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,d6,16f6,16a#.,16a#6,32g6,16f6,16a#.,32f6,32f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,a#,16a6,16d.6,16a#6,32a6,32a6,32g6,32f#6,32a6,8g6,16g6,16c.6,32a6,32a6,32g6,32g6,32f6,32e6,32g6,8f6,16f6,16a#.,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#6,16c7,8a#.6&quot;;
//char *song = &quot;Jeopardy:d=4,o=6,b=125:c,f,c,f5,c,f,2c,c,f,c,f,a.,8g,8f,8e,8d,8c#,c,f,c,f5,c,f,2c,f.,8d,c,a#5,a5,g5,f5,p,d#,g#,d#,g#5,d#,g#,2d#,d#,g#,d#,g#,c.7,8a#,8g#,8g,8f,8e,d#,g#,d#,g#5,d#,g#,2d#,g#.,8f,d#,c#,c,p,a#5,p,g#.5,d#,g#&quot;;
//char *song = &quot;Gadget:d=16,o=5,b=50:32d#,32f,32f#,32g#,a#,f#,a,f,g#,f#,32d#,32f,32f#,32g#,a#,d#6,4d6,32d#,32f,32f#,32g#,a#,f#,a,f,g#,f#,8d#&quot;;
//char *song = &quot;Smurfs:d=32,o=5,b=200:4c#6,16p,4f#6,p,16c#6,p,8d#6,p,8b,p,4g#,16p,4c#6,p,16a#,p,8f#,p,8a#,p,4g#,4p,g#,p,a#,p,b,p,c6,p,4c#6,16p,4f#6,p,16c#6,p,8d#6,p,8b,p,4g#,16p,4c#6,p,16a#,p,8b,p,8f,p,4f#&quot;;
//char *song = &quot;MahnaMahna:d=16,o=6,b=125:c#,c.,b5,8a#.5,8f.,4g#,a#,g.,4d#,8p,c#,c.,b5,8a#.5,8f.,g#.,8a#.,4g,8p,c#,c.,b5,8a#.5,8f.,4g#,f,g.,8d#.,f,g.,8d#.,f,8g,8d#.,f,8g,d#,8c,a#5,8d#.,8d#.,4d#,8d#.&quot;;
//char *song = &quot;LeisureSuit:d=16,o=6,b=56:f.5,f#.5,g.5,g#5,32a#5,f5,g#.5,a#.5,32f5,g#5,32a#5,g#5,8c#.,a#5,32c#,a5,a#.5,c#.,32a5,a#5,32c#,d#,8e,c#.,f.,f.,f.,f.,f,32e,d#,8d,a#.5,e,32f,e,32f,c#,d#.,c#&quot;;
//char *song = &quot;MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d&quot;;
//char *song = &quot;smb:d=4,o=5,b=100:16e6,16e6,32p,8e6,16c6,8e6,8g6,8p,8g,8p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,16p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16c7,16p,16c7,16c7,p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16d#6,8p,16d6,8p,16c6&quot;;
//char *song = &quot;SMBUndergr:d=16,o=6,b=100:c,c5,a5,a,a#5,a#,2p,8p,c,c5,a5,a,a#5,a#,2p,8p,f5,f,d5,d,d#5,d#,2p,8p,f5,f,d5,d,d#5,d#,2p,32d#,d,32c#,c,p,d#,p,d,p,g#5,p,g5,p,c#,p,32c,f#,32f,32e,a#,32a,g#,32p,d#,b5,32p,a#5,32p,a5,g#5&quot;;
//char *song = &quot;SMBWater:d=8,o=6,b=225:4d5,4e5,4f#5,4g5,4a5,4a#5,b5,b5,b5,p,b5,p,2b5,p,g5,2e.,2d#.,2e.,p,g5,a5,b5,c,d,2e.,2d#,4f,2e.,2p,p,g5,2d.,2c#.,2d.,p,g5,a5,b5,c,c#,2d.,2g5,4f,2e.,2p,p,g5,2g.,2g.,2g.,4g,4a,p,g,2f.,2f.,2f.,4f,4g,p,f,2e.,4a5,4b5,4f,e,e,4e.,b5,2c.&quot;;
//char *song = &quot;smbdeath:d=4,o=5,b=90:32c6,32c6,32c6,8p,16b,16f6,16p,16f6,16f.6,16e.6,16d6,16c6,16p,16e,16p,16c&quot;;

void setup(void)
{
Serial.begin(9600);
}

#define isdigit(n) (n &amp;gt;= '0' &amp;amp;&amp;amp; n &amp;lt;= '9') void play_rtttl(char *p) {   // Absolutely no error checking in here   byte default_dur = 4;   byte default_oct = 6;   int bpm = 63;   int num;   long wholenote;   long duration;   byte note;   byte scale;   // format: d=N,o=N,b=NNN:   // find the start (skip name, etc)   while(*p != ':') p++;    // ignore name   p++;                     // skip ':'   // get default duration   if(*p == 'd')   {     p++; p++;              // skip &quot;d=&quot;     num = 0;     while(isdigit(*p))     {       num = (num * 10) + (*p++ - '0');     }     if(num &amp;gt; 0) default_dur = num;
p++;                   // skip comma
}

Serial.print(&quot;ddur: &quot;); Serial.println(default_dur, 10);

// get default octave
if(*p == 'o')
{
p++; p++;              // skip &quot;o=&quot;
num = *p++ - '0';
if(num &amp;gt;= 3 &amp;amp;&amp;amp; num &amp;lt;=7) default_oct = num;
p++;                   // skip comma
}

Serial.print(&quot;doct: &quot;); Serial.println(default_oct, 10);

// get BPM
if(*p == 'b')
{
p++; p++;              // skip &quot;b=&quot;
num = 0;
while(isdigit(*p))
{
num = (num * 10) + (*p++ - '0');
}
bpm = num;
p++;                   // skip colon
}

Serial.print(&quot;bpm: &quot;); Serial.println(bpm, 10);

// BPM usually expresses the number of quarter notes per minute
wholenote = (60 * 1000L / bpm) * 4;  // this is the time for whole note (in milliseconds)

Serial.print(&quot;wn: &quot;); Serial.println(wholenote, 10);

// now begin note loop
while(*p)
{
// first, get note duration, if available
num = 0;
while(isdigit(*p))
{
num = (num * 10) + (*p++ - '0');
}

if(num) duration = wholenote / num;
else duration = wholenote / default_dur;  // we will need to check if we are a dotted note after

// now get the note
note = 0;

switch(*p)
{
case 'c':
note = 1;
break;
case 'd':
note = 3;
break;
case 'e':
note = 5;
break;
case 'f':
note = 6;
break;
case 'g':
note = 8;
break;
case 'a':
note = 10;
break;
case 'b':
note = 12;
break;
case 'p':
default:
note = 0;
}
p++;

// now, get optional '#' sharp
if(*p == '#')
{
note++;
p++;
}

// now, get optional '.' dotted note
if(*p == '.')
{
duration += duration/2;
p++;
}

// now, get scale
if(isdigit(*p))
{
scale = *p - '0';
p++;
}
else
{
scale = default_oct;
}

scale += OCTAVE_OFFSET;

if(*p == ',')
p++;       // skip comma for next note (or we may be at the end)

// now play the note

if(note)
{
Serial.print(&quot;Playing: &quot;);
Serial.print(scale, 10); Serial.print(' ');
Serial.print(note, 10); Serial.print(&quot; (&quot;);
Serial.print(notes[(scale - 4) * 12 + note], 10);
Serial.print(&quot;) &quot;);
Serial.println(duration, 10);
tone(TONE_PIN, notes[(scale - 4) * 12 + note]);
delay(duration);
noTone(TONE_PIN);
}
else
{
Serial.print(&quot;Pausing: &quot;);
Serial.println(duration, 10);
delay(duration);
}
}
}

void loop(void)
{
play_rtttl(song);
Serial.println(&quot;Done.&quot;);
while(1);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://leemckinnon.com/tv-themes-and-music-for-arduino/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
