<?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>porges &#187; massey</title>
	<atom:link href="http://porg.es/blog/tag/massey/feed" rel="self" type="application/rss+xml" />
	<link>http://porg.es/blog</link>
	<description></description>
	<lastBuildDate>Thu, 12 Jan 2012 23:45:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Presenting Meteoroids</title>
		<link>http://porg.es/blog/presenting-meteoroids</link>
		<comments>http://porg.es/blog/presenting-meteoroids#comments</comments>
		<pubDate>Wed, 19 Nov 2008 23:23:37 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[self]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[massey]]></category>
		<category><![CDATA[meteoroids]]></category>
		<category><![CDATA[uni]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://porg.es/blog/?p=244</guid>
		<description><![CDATA[This post brought to you as part of fulfilling the requirements for Massey University’s 143.362. I thought I had posted this earlier, but it turns out I hadn&#8217;t. So, it&#8217;s here now Meteoroids Meteoroids is a simple game (the premise being an homage to the classic Asteroids-based titles), programmed in Processing. Audio is provided via [...]]]></description>
			<content:encoded><![CDATA[<p><i>This post brought to you as part of fulfilling the requirements for Massey University’s <a href="http://www.massey.ac.nz/massey/study/programme-course-and-paper-search/paper.cfm?paper_code=143.362">143.362</a>.</i></p>
<p>I thought I had posted this earlier, but it turns out I hadn&#8217;t. So, it&#8217;s here now <img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_razz.gif" alt="" /></p>
<h3>Meteoroids</h3>
<p>Meteoroids is a simple game (the premise being an homage to the classic Asteroids-based titles), programmed in <a href="http://processing.org/">Processing</a>. Audio is provided via <a href="http://chuck.cs.princeton.edu/">ChucK</a>, and input is provided by a Nintendo Wiimote via <a href="http://en.wikipedia.org/wiki/OpenSound_Control">OSC</a> commands generated from <a href="http://code.google.com/p/darwiinosc/">an extension</a> of <a href="http://sourceforge.net/projects/darwiin-remote/">Darwiin Remote</a>.</p>
<p>To explain more, here&#8217;s a short video <img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_smile.gif" alt="" /></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/_NdgujV3z5c&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_NdgujV3z5c&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/presenting-meteoroids/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Music Synthesizer Project (in Matlab)</title>
		<link>http://porg.es/blog/music-synthesizer-project-in-matlab</link>
		<comments>http://porg.es/blog/music-synthesizer-project-in-matlab#comments</comments>
		<pubDate>Fri, 24 Oct 2008 08:35:33 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[massey]]></category>
		<category><![CDATA[matlab]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://porg.es/blog/?p=221</guid>
		<description><![CDATA[This post brought to you as part of fulfilling the requirements for Massey University&#8217;s 143.363. The brief was to write both an additive and subtractive synthesizer, in addition to an effects processor. I generalized this a little bit so that you can combine random parts together, so the additive/subtractive synthesizers aren&#8217;t really separate any more. [...]]]></description>
			<content:encoded><![CDATA[<p><i>This post brought to you as part of fulfilling the requirements for Massey University&#8217;s <a href="http://www.massey.ac.nz/massey/study/programme-course-and-paper-search/paper.cfm?paper_code=143.363">143.363</a>.</i></p>
<p>The brief was to write both an additive and subtractive synthesizer, in addition to an effects processor. I generalized this a little bit so that you can combine random parts together, so the additive/subtractive synthesizers aren&#8217;t really separate any more.</p>
<p>Basically my code allows you to write ‘scores’ like this:</p>
<pre><code>square wave:square:
glassharp:adsr:square wave,0.1,0.2,0.6,0.6
glassharpDelay:delay:glassharp,0.4
glassharpDelayed:gain:glassharpDelay,0.5
instrument:add:glassharp,glassharpDelayed
!instrument c e8 g c4 e8 g c’4 e’ g’ c e8 g c4 e8 g c’4 e’ g’</code></pre>
<p>The first 5 lines are ‘instrument lines’ and the last one is a ‘score line’.</p>
<h3>Instrument lines</h3>
<p>The instrument lines are somewhat <a href="http://en.wikipedia.org/wiki/Single_static_assignment">SSA</a>-like in that you can only do one thing on one line. Each line has the structure <code>[instrument name]:[source or filter]:[parameters]</code>. The provided sources include <code>sine</code>, <code>square</code>, <code>sawtooth</code>, <code>triangle</code>, and <code>additive</code> (this latter has parameters which are the coefficients for <a href="http://en.wikipedia.org/wiki/Additive_synthesis">additive synthesis</a>).</p>
<p>An example of using additive synthesis (here used to approximate a square wave more and more closely):</p>
<pre><code>sq1:additive:1
sq2:additive:1,0,0.333
sq3:additive:1,0,0.333,0,0.2
sq4:additive:1,0,0.333,0,0.2,0,0.14285714
!sq1 c d e f g r !sq2 c d e f g r !sq3 c d e f g r !sq4 c d e f g r</code></pre>
<p>Filters include (parameters in brackets): <code>delay</code> (source instrument, seconds), <code>gain</code> (source instrument, amount), <a href="http://en.wikipedia.org/wiki/ADSR"><code>adsr</code></a> (source instrument, attack time, decay time, sustain gain, release time), <code>lowpass</code> (instrument, frequency, order), <code>highpass</code> (instrument, frequency, order), <code>add</code> (instrument, instrument), <code>subtract</code> (instrument, instrument).</p>
<h3>Score lines</h3>
<p>Score lines specify the notes for the instruments to play. Notes are specified like this: <code>[note name][optional sharp or flat][optional octave shift][optional length]</code>. For example, to specify a <a href="http://en.wikipedia.org/wiki/C_major">C-major</a> <a href="http://en.wikipedia.org/wiki/Arpeggio">arpeggio</a> using <a href="http://en.wikipedia.org/wiki/Crotchet">crotchets</a>, over two <a href="http://en.wikipedia.org/wiki/Octave">octaves</a>, you would use:</p>
<pre><code>c4 e g c' e' g'</code></pre>
<p>The note length ‘sticks’ for all following notes in the same line, and defaults to 4 (a crotchet) at the start of each line. Note length is specified as <img src='/blog/wp-content/plugins/latexrender/pictures/9ba22ee6c5f55c74af52949dd103f942.gif' title='\frac{1}{n}' alt='\frac{1}{n}' align=absmiddle>, so <code>c8</code> is half as long as <code>c4</code>.</p>
<p>Octave shift is indicated using commas or apostrophes:</p>
<pre><code>c,,, c,, c, c c' c'' c'''</code></pre>
<p>Sharps and flats are indicated using ‘s&#8217; and &#8216;b&#8217;, respectively:</p>
<pre><code>c cs d ds e f gb g ab a as b c'</code></pre>
<p>To change instrument in the middle of the score line, use the syntax ‘!instrument_name’. (This operation takes no time in the score.)</p>
<p>Multiple score lines will be played simultaneously. An example:</p>
<pre><code>g2 a g  g
e2 f f  e
c2 c b, c</code></pre>
<p>Rests are specified using the ‘note name’ ‘r’.</p>
<h3>Caveats</h3>
<ul>
<li>The code isn&#8217;t written for widespread consumption (it is <em>very</em> get-the-job-done).</li>
<li>It is possible to send the program into an infinite loop using a filter that refers to itself. (e.g. <code>infinite:delay:infinite,0.5</code>)</li>
<li>Currently you cannot control filter parameters via the score lines; this means you cannot (e.g.) create sound from white noise using a series of filters, as you cannot change the pitch.</li>
<li>Wavetables aren’t implemented, but should be easy to add.</li>
<li>The tempo is currently fixed at 120 BPM.</li>
<li>Gain for the whole audio file will be reduced automatically to prevent clipping.</li>
<li>The file format itself is not very forgiving. It is best to stick closely to the examples shown above! (In particular, white space at the end of a score line will break things with obscure messages.)</li>
</ul>
<h3>Code &amp; example</h3>
<p>You can listen to an example rendered by my code <a href="http://porg.es/blog/wp-content/uploads/2008/10/example.mp3">here</a>. The code can be downloaded (including the score for that example) <a href='http://porg.es/blog/wp-content/uploads/2008/10/assignment.zip'>here</a>.</p>
<h4>Comments on implementation</h4>
<p>The various files with ‘handle’ in their name are there to support Matlab&#8217;s form of closures (this is what I got from the documentation); if you don&#8217;t do it this way then all the references to ‘synth_options{n}’ end up being to the wrong options as Matlab&#8217;s anonymous functions are in some ways call-by-name.</p>
<p>The file ‘lookup’ is used instead of interfacing directly to <code>java.util.Hashtable</code> because you can&#8217;t (AFAIK) marshal <code>function_handle</code>s across to Java and back.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/music-synthesizer-project-in-matlab/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://porg.es/blog/wp-content/uploads/2008/10/example.mp3" length="720391" type="audio/mpeg" />
		</item>
		<item>
		<title>Robot Love Video</title>
		<link>http://porg.es/blog/robot-love-video</link>
		<comments>http://porg.es/blog/robot-love-video#comments</comments>
		<pubDate>Sun, 17 Aug 2008 08:06:15 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[self]]></category>
		<category><![CDATA[university]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[massey]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[silly]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://porg.es/blog/?p=158</guid>
		<description><![CDATA[Start music composed using ChucK and Pro Tools. Further credits at end of video. Produced as a pair assignment. Update: Here is a version with some further edits performed in order to learn how to use Shake.]]></description>
			<content:encoded><![CDATA[<p>Start music composed using ChucK and Pro Tools. Further credits at end of video. Produced as a pair assignment.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wmOTIznHdBU&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wmOTIznHdBU&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Update: Here is a version with some further edits performed in order to learn how to use Shake.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/_pYH2Y5WnCc&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_pYH2Y5WnCc&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/robot-love-video/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

