<?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>Code Log</title>
	<atom:link href="http://code.compartmental.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.compartmental.net</link>
	<description>Prototypes and Other Bits of Code</description>
	<lastBuildDate>Tue, 09 Mar 2010 07:53:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Teaser</title>
		<link>http://code.compartmental.net/2010/03/09/teaser/</link>
		<comments>http://code.compartmental.net/2010/03/09/teaser/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 07:53:13 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Minim]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=202</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.compartmental.net/wp-content/uploads/2010/03/Screen-shot-2010-03-08-at-11.41.45-PM.png"><img src="http://code.compartmental.net/wp-content/uploads/2010/03/Screen-shot-2010-03-08-at-11.41.45-PM-300x162.png" alt="Amplitude Modulated Sine Wave" title="Amplitude Modulated Sine Wave" width="300" height="162" class="alignnone size-medium wp-image-203" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2010/03/09/teaser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>And we&#8217;re back&#8230;</title>
		<link>http://code.compartmental.net/2009/12/30/and-were-back/</link>
		<comments>http://code.compartmental.net/2009/12/30/and-were-back/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 20:26:02 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/2009/12/30/and-were-back/</guid>
		<description><![CDATA[Sorry for the down-time. The index file for wordpress was hacked, ultimately resulting in the site being disabled by my host. I&#8217;m all upgraded now and cleaned out the malicious php scripts that had been generated.
]]></description>
			<content:encoded><![CDATA[<p>Sorry for the down-time. The index file for wordpress was hacked, ultimately resulting in the site being disabled by my host. I&#8217;m all upgraded now and cleaned out the malicious php scripts that had been generated.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/12/30/and-were-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Minim with Git and Eclipse.</title>
		<link>http://code.compartmental.net/2009/11/02/building-minim-with-git-and-eclipse/</link>
		<comments>http://code.compartmental.net/2009/11/02/building-minim-with-git-and-eclipse/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 03:01:35 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Minim]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=190</guid>
		<description><![CDATA[Minim on Github
The project with Numediart has gotten off to a great start. I&#8217;m excited about the additional music programming capabilities that will result from that work. However, the beginning of the project has already brought a much needed improvement to Minim: a better way for people to contribute to the project. I&#8217;ve been developing [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Minim on Github</strong></p>
<p>The project with <a href="http://www.numediart.org/">Numediart</a> has gotten off to a great start. I&#8217;m excited about the additional music programming capabilities that will result from that work. However, the beginning of the project has already brought a much needed improvement to Minim: a better way for people to contribute to the project. I&#8217;ve been developing Minim pretty much solo and working in an undisclosed Subversion repository. My intent had been to eventually make that repository publicly known, but I had not figured out a good way to review changes that people might make before committing them. Github was suggested to me as a good site for managing this sort of thing and we decided to try the process out by using Github for the Numediart project. My initial experience with it has been fantastic, so I plan to keep Minim there.  Visit the project page to see what it&#8217;s all about:</p>
<p><a href="http://github.com/ddf/Minim">http://github.com/ddf/Minim</a></p>
<p>If you would like to contribute to the development of Minim, all you need to do is create a Github account and click the Fork button on the Minim project page. This will create a branch of the project that you can push to. When you&#8217;ve fixed a bug that&#8217;s been bothering you, or create a new feature that you think is worthy of being included, you simply send me a pull request and I will be able to review your patch and accept it or not. Totally sweet, I say.</p>
<p><strong>Building Minim</strong></p>
<p>I develop Minim in Eclipse, so the repository is structured such that you can clone it into your Eclipse workspace and then import it as an already existing project. Here are the instructions for acquiring and building Minim, if you fork the project, you&#8217;d follow these same instructions but use the &#8220;Your Clone URL&#8221; from the fork you create. Keep in mind that Eclipse doesn&#8217;t support two projects with the same name in the same workspace.</p>
<p>What you will need:</p>
<ol>
<li><a href="http://www.eclipse.org/downloads/">Eclipse</a></li>
<li><a href="http://git-scm.com/">Git</a></li>
</ol>
<p>What you will do:</p>
<ol>
<li>From your workspace directory, clone the github Minim repo. On the command line that&#8217;d be this command:<br/><br/>git clone git://github.com/ddf/Minim.git<br/><br/>This should create a local git repo in a directory named Minim.</li>
<li>Then go into Eclipse, right click in the Package Explorer and choose &#8220;Import&#8230;&#8221;</li>
<li>Under &#8220;General&#8221; choose &#8220;Existing Projects into Workspace&#8221;</li>
<li>Click &#8220;Next&#8221;</li>
<li>With &#8220;Select Root Directory&#8221; selected, choose &#8220;Browse&#8230;&#8221; and browse to the the directory that git just created.</li>
<li>Click &#8220;Finish&#8221;. You should now have a browsable and buildable project named &#8220;Minim&#8221; in your package explorer.</li>
<li>Create the folder libraries/minim/library inside of you sketchbook folder.</li>
<li>Export the packages ddf.minim, ddf.minim.analysis, ddf.minim.effects, and ddf.minim.signals, as a single jar file named minim.jar into the folder you just created.</li>
<li>Export the package ddf.minim.javasound as a jar file named jsminim.jar to the same folder.</li>
<li>Export the package ddf.minim.spi as a jar file named minim-spi.jar to the same folder.</li>
<li>Copy all of the jar files in the lib directory of the project, except for core.jar, into the same directory you exported the first three jars into.</li>
<li>Run Processing and sketches that use Minim will use the build you just made, instead of the build that Processing comes with.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/11/02/building-minim-with-git-and-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minim 2.0.2 Released!</title>
		<link>http://code.compartmental.net/2009/10/04/minim-2-0-2-released/</link>
		<comments>http://code.compartmental.net/2009/10/04/minim-2-0-2-released/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 01:21:09 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Minim]]></category>
		<category><![CDATA[Releases]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=186</guid>
		<description><![CDATA[I am happy to announce the release of Minim 2.0.2! Download and installation instructions are available on the project page. Here&#8217;s what&#8217;s fixed and new, which you will also find in the changelog.txt file included with the distribution:
Fixed Bugs:

filenames were being parsed incorrectly by createRecorder.
fixed audio processing routines for AudioPlayer and AudioSnippet so that they [...]]]></description>
			<content:encoded><![CDATA[<p>I am happy to announce the release of Minim 2.0.2! Download and installation instructions are available on the <a href="http://code.compartmental.net/tools/minim">project page</a>. Here&#8217;s what&#8217;s fixed and new, which you will also find in the changelog.txt file included with the distribution:</p>
<p>Fixed Bugs:</p>
<ul>
<li>filenames were being parsed incorrectly by createRecorder.</li>
<li>fixed audio processing routines for AudioPlayer and AudioSnippet so that they don&#8217;t spend cycles doing nothing while not in the &#8220;play&#8221; state.</li>
<li>fixed the zombie thread bug, which kept audio processing Threads from exiting when close() was called.</li>
<li>fixed out-of-memory problems that could occur when large files were played. this does come at the cost of slower seek times.</li>
<li>fixed the isEnabled(AudioEffect) function, which, uh, wasn&#8217;t working.</li>
<li>fixed the pan() function, which was returning the BALANCE control.</li>
</ul>
<p>New Features:</p>
<ul>
<li>added functions to FFT for doing forward transforms with an offset: forward(float[] samples, offset) and forward(AudioBuffer samples, offset)</li>
<li>added a freqToIndex(float freq) method to FFT for finding out the index of the spectrum band that contains the passed in frequency.</li>
<li>added a stop() method to AudioSample, so that playing samples can be immediately silenced.</li>
<li>added setPanNoGlide(float pan) to Controller, which will snap the panning setting of a sound to the provided value.</li>
<li>added setInputMixer(Mixer) and setOutputMixer(Mixer), which allow you to specify which Java Mixer object should be used when obtaining inputs (AudioInput) and outputs (AudioOuput, AudioPlayer, AudioSnippet, AudioSample).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/10/04/minim-2-0-2-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Minim Release Imminent</title>
		<link>http://code.compartmental.net/2009/10/03/minim-release-imminent/</link>
		<comments>http://code.compartmental.net/2009/10/03/minim-release-imminent/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 02:44:13 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Minim]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=179</guid>
		<description><![CDATA[I am close close close to releasing 2.0.2! Today I wrote a couple new examples to demonstrate a couple additional features that have been added and I made sure the javadocs all looked good. Then I got sidetracked by writing a song. Well, so it goes, one doesn&#8217;t say no to songwriting when inspiration strikes. [...]]]></description>
			<content:encoded><![CDATA[<p>I am close close close to releasing 2.0.2! Today I wrote a couple new examples to demonstrate a couple additional features that have been added and I made sure the javadocs all looked good. Then I got sidetracked by writing a song. Well, so it goes, one doesn&#8217;t say no to songwriting when inspiration strikes. So! I plan to do the release tomorrow. As mentioned, there won&#8217;t be a whole lot new in this release, but a number of nasty bugs have been fixed. A full run down of what&#8217;s been fixed and what&#8217;s new will be provided with the release.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/10/03/minim-release-imminent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bug Fixing, Build Process.</title>
		<link>http://code.compartmental.net/2009/10/02/bug-fixing-build-process/</link>
		<comments>http://code.compartmental.net/2009/10/02/bug-fixing-build-process/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 23:04:08 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Minim]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=168</guid>
		<description><![CDATA[Among all of the things that I have learned while working as a professional game dev, two very important things are 1) how to document and test bug fixes and 2) the importance of having a sane build process. I didn&#8217;t have a terribly good handle on either of these things when I first created [...]]]></description>
			<content:encoded><![CDATA[<p>Among all of the things that I have learned while working as a professional game dev, two very important things are 1) how to document and test bug fixes and 2) the importance of having a sane build process. I didn&#8217;t have a terribly good handle on either of these things when I first created Minim and as a result pushing out a release was a very painful process.</p>
<p><strong>Bug Fixing</strong></p>
<p>I&#8217;ve not always been good about keeping track of exactly which bugs I&#8217;ve fixed in a release, or which new features I&#8217;ve added. No longer! The past two days have seen verbose comments in my check-ins, which means I should be able to create a pretty exact changelog for the next release. Here&#8217;s my most recent check-in comment, to give you an idea of the kinds of things coming up:</p>
<pre>
FourierTransform:

	- added freqToIndex method for converting a frequency to an index (duh)

	- added getAverageCenterFrequency to get the center frequency of an average band from an index

	- added forward(float[], int) and forward(AudioBuffer,int) so an offset into the array of floats can be provided, in case a user has a large buffer they want to analyze only parts of.

JSMinim:

    - added setInputMixer(Mixer) so users can specify which Mixer to use when getting TargetDataLines

    - added setOutputMixer(Mixer) so users can specify which Mixer to use when getting SourceDataLines

Minim:

	- added getServiceProvider() so that you can get a handle on the implementation being used by Minim.

	- added createSample functions to get an AudioSample using a buffer(s) of floats.

MinimServiceProvider:

	- added getAudioSample(float[], AudioFormat, int) and getAudioSample(float[], float[], AudioFormat, int) interface functions for requesting AudioSamples with buffers instead of from files.
</pre>
<p><strong>Build Process</strong></p>
<p>Creating and uploading new JAR files is not the hard part of doing a release. No, the hard part is making sure all of my online examples are up-to-date and making sure the Manual reflects any additions or changes to the API. The <em>biggest</em> pain with the examples is that the directory structure that I use on the website does not match the local directory structure, so it&#8217;s not just an easy drag-and-drop. I have my examples set up as a subdirectory in my Processing sketch folder, but what actually gets uploaded to the website are the contents of the <em>applet</em> directory that is generated for each sketch when I export it. Man, I would love to know a way to tell Processing to export an applet to a location other than the sketch folder, because then I could export to a directory structure that is the same as what&#8217;s on the web. </p>
<p>In any event, that&#8217;s a pain, and I need to figure that out, but I also finally got around to creating a subversion repository for all of the example source files. This will at least make it easier for me to tell at a glace which sketches need to have applets re-exported and uploaded. Maybe I can even figure out how to create an automated process for this. But, one thing I had to do before I could commit all of the examples, was <em>delete</em> all of the applet directories. To do that, I googled around and found this totally helpful batch file:</p>
<p><code><br />
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q %%G<br />
</code></p>
<p>That particular code will delete all subdirectories that match the name &#8220;*.svn*&#8221; under the directory it is executed in. All I had to do was change the name to match to &#8220;applet&#8221;. It&#8217;s all really clearly explained in this <a href="http://www.daniweb.com/forums/post326614.html#post326614">forum post</a> and worked liked a charm.</p>
<p>So, that&#8217;s at least one part of my build process that&#8217;s been sanitized (by which I mean: made sane)!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/10/02/bug-fixing-build-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Month of Code.</title>
		<link>http://code.compartmental.net/2009/10/01/a-month-of-code/</link>
		<comments>http://code.compartmental.net/2009/10/01/a-month-of-code/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 16:49:50 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=165</guid>
		<description><![CDATA[Welcome to October! I&#8217;ve taken this entire month off of work to catch up on several personal projects that have been languishing. Here&#8217;s what I hope to accomplish this month:
Minim
I haven&#8217;t released an update of Minim for an entire year! This is totally unacceptable! I will be spending the next few days fixing as many [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to October! I&#8217;ve taken this entire month off of work to catch up on several personal projects that have been languishing. Here&#8217;s what I hope to accomplish this month:</p>
<p><strong>Minim</strong></p>
<p>I haven&#8217;t released an update of Minim for an entire year! This is totally unacceptable! I will be spending the next few days fixing as many of the TODOs I&#8217;ve got lying around in the code base as I can and putting together a new release. This will be a bug fix release.</p>
<p>Today is the first day of a project initiated by <a href="http://academic.konfuzo.net/">Dr. J. Anderson Mills III</a>, a good friend of mine who is working at <a href="http://www.numediart.org/">Numediart</a> in Mons, Belgium. This project aims to outfit Minim with easy-to-use and easy-to-extend audio generating classes. The current suite of classes in the <code>ddf.minim.signals</code> package will likely be replaced with whatever we come up with. I will be working closely with Anderson on the project, including traveling to Mons in the middle of the month to participate in a kickoff workshop. The project will culminate with a presentation at Numediart and a new release of Minim.</p>
<p><strong>iPhone</strong></p>
<p>I&#8217;ve got several ideas for iPhone apps that I hope to be able to at least start work on this month. I will endeavor to post about progress on those as I make it.</p>
<p><strong>Top Secret Music Game</strong></p>
<p>I&#8217;ll be working more on the music game I mentioned several months ago. I don&#8217;t know how much I&#8217;ll be able to say about this, but hopefully there will be some kind of announcement that can be made in a couple month&#8217;s time.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/10/01/a-month-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Sequencer Quirk</title>
		<link>http://code.compartmental.net/2009/06/07/java-sequencer-quirk/</link>
		<comments>http://code.compartmental.net/2009/06/07/java-sequencer-quirk/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 22:03:24 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaSound]]></category>
		<category><![CDATA[MIDI]]></category>
		<category><![CDATA[Sequencer]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=154</guid>
		<description><![CDATA[I&#8217;m working on a music app that involves using Midi to trigger audio. Yesterday I wound up in a situation where after adding a new Track to my Sequence, I wasn&#8217;t receiving any of the MidiEvents that I added to the track. The problem, it turns out, is that the default Java Sequencer appears to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a music app that involves using Midi to trigger audio. Yesterday I wound up in a situation where after adding a new Track to my Sequence, I wasn&#8217;t receiving any of the MidiEvents that I added to the track. The problem, it turns out, is that the default Java Sequencer appears to cache all of the Tracks in a Sequence when you initially set the Sequence on the Sequencer using the setSequence method. If you modify the Sequence itself, as opposed to modifying the contents of the Tracks in the Sequence, the Sequencer won&#8217;t know about it until you call setSequence again. Just thought I&#8217;d throw this little tidbit out there, in case someone else runs into the same problem. Here&#8217;s some code to illustrate my point:</p>
<p>[snip java]<br />
// make a sequence<br />
Sequence s = new Sequence(Sequence.PPQ, 4);</p>
<p>// make a track in the sequence<br />
Track t = s.createTrack();</p>
<p>// add midi events to the track<br />
// &#8230;</p>
<p>// make a sequencer<br />
Sequencer seq = MidiSystem.getSequencer();<br />
seq.open();<br />
seq.setSequence(s);<br />
seq.start();</p>
<p>// at this point, we can modify the Track<br />
// and the Sequencer will pick up those new notes<br />
// but if we do this:<br />
Track t2 = s.createTrack();<br />
// and then add notes to this track<br />
// the Sequencer will NOT play these notes<br />
// because it doesn&#8217;t know about the track we just created<br />
// we have to SET THE SEQUENCE AGAIN!<br />
seq.setSequence(s);<br />
// now the sequencer will play the notes in the track we just created.<br />
[/snip]</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/06/07/java-sequencer-quirk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minim In The Wild</title>
		<link>http://code.compartmental.net/2009/04/14/minim-in-the-wild/</link>
		<comments>http://code.compartmental.net/2009/04/14/minim-in-the-wild/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 18:07:46 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[Minim]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=150</guid>
		<description><![CDATA[Recently had this neat little interview with Andrew Bayazkus pop up in my feed reader. He&#8217;s made some pretty cool audio-visual sketches in Processing using Minim for the audio end of things. Check them out at his site Kosmotrope. I love seeing this kind of stuff and am glad that people have been able to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently had this neat little <a href="http://digitaltools.node3000.com/interview/827-andrew-bayazkus-on-his-soundsynth-processing-works">interview with Andrew Bayazkus</a> pop up in my feed reader. He&#8217;s made some pretty cool audio-visual sketches in Processing using Minim for the audio end of things. Check them out at his site <a href="http://www.kosmotrope.com/">Kosmotrope</a>. I love seeing this kind of stuff and am glad that people have been able to use Minim to make it!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2009/04/14/minim-in-the-wild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frequency Modulation Is Easy</title>
		<link>http://code.compartmental.net/2008/12/23/frequency-modulation-is-easy/</link>
		<comments>http://code.compartmental.net/2008/12/23/frequency-modulation-is-easy/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 04:01:56 +0000</pubDate>
		<dc:creator>ddf</dc:creator>
				<category><![CDATA[DSP]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Minim]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fm]]></category>
		<category><![CDATA[frequency modulation]]></category>

		<guid isPermaLink="false">http://code.compartmental.net/?p=141</guid>
		<description><![CDATA[I&#8217;m working on adding the ability to do frequency modulation in Minim. I didn&#8217;t figure it was a very complicated thing. I knew that I&#8217;d have to do it while generating each sample, so it couldn&#8217;t be done as an AudioEffect. But when I went looking online about how to do it, I found a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on adding the ability to do frequency modulation in Minim. I didn&#8217;t figure it was a very complicated thing. I knew that I&#8217;d have to do it while generating each sample, so it couldn&#8217;t be done as an <code>AudioEffect</code>. But when I went looking online about how to do it, I found a number of articles that described the technique in words, with somewhat dense equations, but none that had easy to understand code examples. I did find <a href="http://ccrma.stanford.edu/software/snd/snd/fm.html">this article</a>, but the code in it is some form of Lisp, a language I am not familiar with. I thought I had it figured out a couple times, but every time I tried something new I still wasn&#8217;t achieving the correct result. </p>
<p>So today I asked my friend <a href="http://www.myspace.com/themysterioush">The Mysterious H</a> how it works because he&#8217;s a smart guy and builds synths out of Atari sound chips and shit like that. He goes, &#8220;Oh it&#8217;s easy.&#8221;</p>
<p>Every time you want to generate a sample of the signal you are  modulating (the carrier), generate a sample of your modulator and add that to the phase you use to generate your carrier sample. </p>
<p>Said another way: Say you&#8217;ve got a signal called <em>f</em>. At every time step <em>t</em> (which is your phase), you generate a sample <em>s</em> by evaluating <em>f(t)</em>. If you want to modulate the frequency of <em>f</em> with a modulator called <em>m</em>, then at every <em>t</em> you will do this:</p>
<pre>
s = f(t + m(t))
</pre>
<p>The speed of the modulation is determined by the frequency of your modulator and the amount of the modulation (how many hertz above and below the frequency of your carrier signal the audible signal will swing) is determined by the amplitude of the modulator. In my tests I found that the amplitude had to be around 0.001 to achieve what one would consider vibrato. Setting it to 0.1 made for some pretty intense alien sounds when the frequency of the modulator was up in audio signal range (20 Hz and up, say).</p>
<p>It&#8217;s lots of fun to play with and will be coming soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.compartmental.net/2008/12/23/frequency-modulation-is-easy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
