<?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>CODEMUSE</title>
	<atom:link href="http://www.codemuse.net/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.codemuse.net/blog</link>
	<description>sharing my generative art toys / code / photography / etc</description>
	<lastBuildDate>Sun, 16 Mar 2008 03:29:09 +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>PlayWithMozart</title>
		<link>http://www.codemuse.net/blog/?p=1</link>
		<comments>http://www.codemuse.net/blog/?p=1#comments</comments>
		<pubDate>Mon, 10 Mar 2008 05:19:18 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[genMusic]]></category>
		<category><![CDATA[srceCode]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=1</guid>
		<description><![CDATA[Draw a melody line, let Mozart fill in the measures, then play the result.]]></description>
			<content:encoded><![CDATA[<p>I just completed a new art-toy: <a href="http://www.codemuse.net/PlayWithMozart/PlayWithMozart.html" title="PlayWithMozart">PlayWithMozart</a>. To play, click on young Mozart&#8217;s image, below.</p>
<p align="center"><a href="http://codemuse.net/PlayWithMozart/PlayWithMozart.html" title="PlayWithMozart"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/mozartat11_400x300.gif" alt="MozartAt11" /></a></p>
<p>Be sure to come back here and leave a comment if you enjoy the program of if you have any questions or suggestions.  I plan to make the code available in a few weeks, after I have a chance to comment it.</p>
<h3><span class="Apple-style-span" style="font-size: 16px; font-weight: normal"></span>The idea</h3>
<p>The idea was simply to try to adapt Mozart&#8217;s Musical Dice Game, so that the choice of measures is not random, but deterministic in some fashion.  Thus came the idea of drawing a melody line and have the program choose the measure that best fits the melody line.Mozart wrote a minuet with 176 measures.  He also created two matrices of 11 rows and 8 columns (look at it as one matrix with 16 columns).  Each cell in the matrix contains a serial number referring to one of the 176 measures in the minuet.  In the Musical Dice Game, the player rolls two die, thus producing a number between 2 and 12 &#8212; corresponding to one of the 11 rows of the matrix.  For the first measure, one throws the die and selects the measure in the appropriate row of the first column.  For the second measure, one throws the die again and selects the measure in the appropriate row of the second column, and so on.  The resulting composition is a re-arrangement of the measures of the original minuet.  The brilliance of Mozart was writing 16 sets of 11 measures, such that any of the  11 measures of a set can succeed any 11 measures of the previous set, while sounding good musically (actually Mozart cheated a little bit; the last set only has 3 unique measures, as some measures are repeated in the set). Several sites explain this game and its history; I found <a href="http://www.codemuse.net/PlayWithMozart/PlayWithMozart.html" title="Mozarts Musikalisches Wurfelspiel">this</a> site and <a href="http://www.amaranthpublishing.com/MozartDiceGame.htm" title="MozartDiceGame site">this</a> one very useful.Instead of &#8220;playing the dice&#8221;, the program <a href="http://www.codemuse.net/PlayWithMozart/PlayWithMozart.html" title="PlayWithMozart">PlayWithMozart</a> selects the measure that best fits the outline of the melody you have drawn, taking into account whether the melody line is rising or falling, and the average pitch of the melody line for that measure.  It does constrain the choices to the set of 11 measures available at any point.  In addition, it also penalizes measures previously chosen, so as to force more variety, so that all 176 measures will eventually be used. So, how satisfactory are the melodies resulting from this collaboration with Mozart? <a href="http://www.codemuse.net/PlayWithMozart/PlayWithMozart.html" title="PlayWithMozart">Try</a> it for yourself!</p>
<h3> Coding tools</h3>
<p>After playing with ActionScript a few years ago, I switched to Java and later Processing, because of their then faster execution speed, wonderful IDE (eclipse) and wide variety of open-source libraries.  While I find that Java really works well on the desktop, I have grown a little impatient with the time it takes to load applets to the browser and the fact that the browser locks while the applet is being loaded.  With ActionScript 3.0, the recent improvements in the Flash Player, and he ability to use Eclipse with Flex, I decided to try Flex.  I found the experience of programming Flex/ActionScript quite enjoyable, and was pleasantly surprised by the speed and responsiveness of the result (PlayWithMozart).  I do miss the more advanced syntax checkers, style checkers, code formatters, and refactoring tools available for Java &#8211; though I expect Flex to catch up.</p>
<h3><span class="Apple-style-span" style="font-size: 16px; font-weight: normal"></span>Producing sound with Flash/ActionScript</h3>
<p>I first tried to use Flash&#8217;s built-in sound library for <a href="http://www.codemuse.net/PlayWithMozart/PlayWithMozart.html" title="PlayWithMozart">PlayWithMozart</a> and was quite disappointed with my inability to control timing precisely.  I tried  a variety of strategies, but I found it difficult to synchronize separate sound clips. It sounded like timing was off by a significant amount. To confirm this, I wrote a quick Flash program to produce a repetitive beat and recorded the output.  Looking at the attacks on the waveforms produced, I found that the beats were off by up to +/- 16 ms.  I was about to abandon my project when  I stumbled upon Andre Michelle and Joa Ebert&#8217;s wonderful <a href="http://code.google.com/p/popforge/" title="Popforge">Popforge</a> library.  With it, I am able to play and apply sound effects to 8 simultaneous stereo tracks, at 20500 Hz, using about 10 to 25% of the CPU.  If you want to dynamically sequence sounds, or even synthesize them on the fly, using Flash, I recommend you look at the <a href="http://code.google.com/p/popforge/" title="Popforge">Popforge</a> library.On a related subject &#8211; the piano sounds.  Originally, I had planned to embed the waveforms for all 88 piano keys. However the resulting sound file was large and the Flex application was taking too long to load in the browser.  So I decided to only use one waveform per octave and have the program pitch-shift that waveform dynamically, as needed, for the other keys of the octave.  Some richness of the sound was lost, because all keys in the same octave a clones of each other, but this approach reduced the loading speed by about 90%. On reflection, I think a better compromise would have been to use two keys (e.g. C and G) per octave.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
		<item>
		<title>hairSynth &#8211; a hair drawing program</title>
		<link>http://www.codemuse.net/blog/?p=15</link>
		<comments>http://www.codemuse.net/blog/?p=15#comments</comments>
		<pubDate>Tue, 18 Dec 2007 03:45:56 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[genImage]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[srceCode]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=15</guid>
		<description><![CDATA[With hairSynth, you can easily create drawings of hair. This can be done directly in your browser, or you can download hairSynth to your computer (works on any computer that runs Java) and save the completed drawings in PostScript format for further manipulation in Illustrator or conversion to JPEG via Photoshop. To play with hairSynth, [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://www.codemuse.net/hairSynth/hairSynth.html" title="hairSynth"><strong>hairSynth</strong></a>, you can easily create drawings of hair. This can be done directly in your browser, or you can download <a href="http://www.codemuse.net/hairSynth/hairSynth.html" title="hairSynth"><strong>hairSynth</strong></a> to your computer (works on any computer that runs Java) and save the completed drawings in PostScript format for further manipulation in Illustrator or conversion to JPEG via Photoshop. To play with <a href="http://www.codemuse.net/hairSynth/hairSynth.html" title="hairSynth"><strong>hairSynth</strong></a>, click on the image below<a href="http://www.codemuse.net/hairSynth/hairSynth.html" title="hairSynth"></a></p>
<p style="text-align: center"><a href="http://www.codemuse.net/hairSynth/hairSynth.html" title="hairSynth"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/hairsynth400x400b.gif" alt="hairSynth400×400gif" /></a></p>
<p>For detailed instructions and to download the program and source code, click <a href="http://www.codemuse.net/html_files/code_hairSynth.htm" title="hairSynth program and code">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=15</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>cutNwatch</title>
		<link>http://www.codemuse.net/blog/?p=17</link>
		<comments>http://www.codemuse.net/blog/?p=17#comments</comments>
		<pubDate>Sun, 08 Apr 2007 01:45:56 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[genAnim]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[srceCode]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=17</guid>
		<description><![CDATA[cutNwatch - an interactive toy that runs in your browser]]></description>
			<content:encoded><![CDATA[<p><a href="http://codemuse.net/cutNwatch/cutNwatch.html" title="cutNwatch"><strong>cutNwatch</strong></a> &#8211; an interactive toy that runs in your browser. Draw a line, watch it as it cuts a surface, then watch the surface deform and recover.</p>
<p>Click <a href="http://codemuse.net/cutNwatch/cutNwatch.html" title="play cutNwatch">here</a> to play.</p>
<p>For more details, including source code, click <a href="http://codemuse.net/html_files/code_cutNwatch.htm" title="cutNwatch details and code">here</a>.</p>
<p><a href="http://www.codemuse.net/blog/wp-content/uploads/2008/03/cutnwatch.JPG" title="cutNwatch_deform_snap"></a></p>
<p style="text-align: center"><a href="http://codemuse.net/cutNwatch/cutNwatch.html" title="cutNwatch"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/cutnwatch.JPG" alt="cutNwatch_deform_snap" /></a></p>
<p align="center"><a href="http://codemuse.net/cutNwatch/cutNwatch.html" title="cutnNwatch"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/cutnwatchtickle2_400x400.jpg" alt="cutnNwatch_tickle_snap" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RippleTiles</title>
		<link>http://www.codemuse.net/blog/?p=33</link>
		<comments>http://www.codemuse.net/blog/?p=33#comments</comments>
		<pubDate>Sun, 13 Jul 2003 22:00:40 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genAnim]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=33</guid>
		<description><![CDATA[An interactive cellular automaton.]]></description>
			<content:encoded><![CDATA[<p><a href="http://codemuse.net/html_files/flash_rippletiles.htm" title="RippleTiles"><strong>RippleTiles</strong></a> &#8211; an interactive cellular automaton. Click on the image below to play.</p>
<p align="center"><a href="http://codemuse.net/html_files/flash_rippletiles.htm" title="RippleTiles"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/rippletiles.gif" alt="RippleTiles_gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=33</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DiskDrummer</title>
		<link>http://www.codemuse.net/blog/?p=28</link>
		<comments>http://www.codemuse.net/blog/?p=28#comments</comments>
		<pubDate>Sun, 01 Dec 2002 23:15:43 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genMusic]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=28</guid>
		<description><![CDATA[A simple interactive drum box.]]></description>
			<content:encoded><![CDATA[<p><a href="http://codemuse.net/html_files/flash_diskdrummer.htm" title="DiskDrummer"><strong>DiskDrummer</strong></a> &#8211; a simple interactive drum box. Click on the image below to play.</p>
<p align="center"><a href="http://codemuse.net/html_files/flash_diskdrummer.htm" title="DiskDrummer"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/diskdrummer.gif" alt="DiskDrummer_gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=28</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boxers</title>
		<link>http://www.codemuse.net/blog/?p=31</link>
		<comments>http://www.codemuse.net/blog/?p=31#comments</comments>
		<pubDate>Sun, 02 Jun 2002 14:45:13 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genAnim]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=31</guid>
		<description><![CDATA[Fight or flight.]]></description>
			<content:encoded><![CDATA[<p align="left"><a href="http://codemuse.net/html_files/flash_boxer.htm" title="Boxers"><strong>Boxers</strong></a> &#8211; Two to 5 boxers confront each other. Fight or flight. No punches yet. Click on the image below to watch.</p>
<p><a href="http://codemuse.net/html_files/flash_boxer.htm" title="Boxers"></p>
<p style="text-align: center"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/boxers.gif" alt="Boxers.gif" /></p>
<p></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=31</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wild Pizza Dough</title>
		<link>http://www.codemuse.net/blog/?p=26</link>
		<comments>http://www.codemuse.net/blog/?p=26#comments</comments>
		<pubDate>Mon, 27 May 2002 16:00:31 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genAnim]]></category>
		<category><![CDATA[srceCode]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=26</guid>
		<description><![CDATA[A wildly bouncing elastic disk.]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://codemuse.net/html_files/flash_wildpizzadough.htm" title="WildPizzaDough">Wild Pizza Dough</a></strong> &#8211; my entry to BIT-101 2002 &#8220;25 lines of coe max&#8221; contest. Click on the image below to watch.</p>
<p align="center"><a href="http://codemuse.net/html_files/flash_wildpizzadough.htm" title="WildPizzaDough"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/wildpizzadough.gif" alt="WildPizzaDough_gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=26</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LocoMomo</title>
		<link>http://www.codemuse.net/blog/?p=20</link>
		<comments>http://www.codemuse.net/blog/?p=20#comments</comments>
		<pubDate>Thu, 16 May 2002 00:30:35 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genAnim]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=20</guid>
		<description><![CDATA[An interactive art-toy which blends a little engineering with a surrealistic image (find it).]]></description>
			<content:encoded><![CDATA[<p><font size="2" face="Arial, Helvetica, sans-serif"><a href="http://codemuse.net/html_files/flash_locomomo.htm" title="LocoMomo"><strong>LocoMomo</strong></a><strong>,</strong> is an interactive art-toy which blends a little engineering with a surrealistic image        (find the image). Turn on the sound!  Click on the image below to play.</font>
<p align="center"><a href="http://codemuse.net/html_files/flash_locomomo.htm" title="LocoMomo"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/locomomo.gif" alt="LocoMomo" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Messages</title>
		<link>http://www.codemuse.net/blog/?p=23</link>
		<comments>http://www.codemuse.net/blog/?p=23#comments</comments>
		<pubDate>Sat, 11 May 2002 01:15:30 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genAnim]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=23</guid>
		<description><![CDATA[A rendering of email flow. Non-interactive.]]></description>
			<content:encoded><![CDATA[<p><a href="http://codemuse.net/html_files/flash_messages.htm" title="Messages"><strong>Messages</strong></a> &#8211; a rendering of a synthetic email flow.  Non-interactive.  Click on the picture below to see.</p>
<p align="center"><a href="http://codemuse.net/html_files/flash_messages.htm" title="Messages"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/messages.gif" alt="Messages_gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=23</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expandor</title>
		<link>http://www.codemuse.net/blog/?p=24</link>
		<comments>http://www.codemuse.net/blog/?p=24#comments</comments>
		<pubDate>Mon, 06 May 2002 02:30:08 +0000</pubDate>
		<dc:creator>jmbara</dc:creator>
				<category><![CDATA[generative art]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[genAnim]]></category>

		<guid isPermaLink="false">http://www.codemuse.net/blog/?p=24</guid>
		<description><![CDATA[Expanding concentric frames.]]></description>
			<content:encoded><![CDATA[<p><a href="http://codemuse.net/html_files/flash_expandor.htm" title="Expandor"><strong>Expandor</strong></a> &#8211; expanding concentric frames. Non-interactive. Click on the image below to watch (should not be viewed by persons with photosensitive epilepsy).</p>
<p align="center"><a href="http://codemuse.net/html_files/flash_expandor.htm" title="Expandor"><img src="http://www.codemuse.net/blog/wp-content/uploads/2008/03/expandor.gif" alt="Expandor_gif" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codemuse.net/blog/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.479 seconds -->
