<?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>codehop &#187; oscillator</title>
	<atom:link href="http://codehop.com/tag/oscillator/feed/" rel="self" type="application/rss+xml" />
	<link>http://codehop.com</link>
	<description>#code #art #music</description>
	<lastBuildDate>Mon, 23 Apr 2012 18:37:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>Rendering 1 Second of Audio Data</title>
		<link>http://codehop.com/rendering-1-second-of-audio-data/</link>
		<comments>http://codehop.com/rendering-1-second-of-audio-data/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 18:08:42 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[iterator]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://slipmat.noisepages.com/?p=194</guid>
		<description><![CDATA[Yesterday&#8217;s python script rendered 1 frame of a rudimentary additive synthesizer. Today&#8217;s script renders 1 second. You can download the complete example at textsnip or at snipt. To render multiple frames of audio, I added two classes: Mixer and Run. &#8230; <a href="http://codehop.com/rendering-1-second-of-audio-data/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Yesterday&#8217;s <a href="http://slipmat.noisepages.com/2010/04/python-iterator-as-a-sine-oscillator/">python script</a> rendered 1 frame of a rudimentary additive synthesizer. Today&#8217;s script renders 1 second. You can download the complete example at <a href="http://textsnip.com/9e138b/python">textsnip</a> or at <a href="http://snipt.org/Lnlo">snipt</a>.</p>
<p>To render multiple frames of audio, I added two classes: Mixer and Run. </p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
class Mixer:
    '''A simple mixer.'''
    
    def __init__(self, source1, source2):
        self.s1 = source1
        self.s2 = source2
    
    def __iter__(self):
        self.index = 0
        self.iter_1 = (i for i in self.s1)
        self.iter_2 = (i for i in self.s2)
        return self
    
    def next(self): 
        if self.index >= ksmps:
            raise StopIteration

        self.index += 1
        return self.iter_1.next() + self.iter_2.next()
    
class Run:
    '''Render frames over time.'''
    
    def __init__(self, dur=1.0):
        self.dur = dur  
    
    def __iter__(self):
        self.index = 0
        return self
    
    def next(self): 
        if self.index >= (self.dur * sr) / ksmps:
            raise StopIteration

        self.index += 1
        return self.index
</pre>
<p>Mixer is an iterator class that takes two iterator objects as its input. The values yielded by the inputs are summed together. Yesterday&#8217;s method was only good for one frame; A Mixer object does not have this restriction.</p>
<p>The Run iterator class is designed to loop through the iterator/audio graph over a user-defined duration of time, creating multiple frames of audio data.</p>
<p>The follow snippet of code resembles yesterday&#8217;s example as it creates a graph of two sine waves (a1 &#038; a2) being fed into a mixer (amix.) The Run object is given a duration of 1 second, which produces 4410 frames (sr / ksmps) and 44100 samples (10 samples per frame.)</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
if __name__ == "__main__":
    a1 = Sine(0.5, 440)
    a2 = Sine(0.5, 440 * 2 ** (7 / 12.0))
    amix = Mixer(a1, a2)
    
    for frame in Run(1.0):
        print frame, ':'
        for sample in amix:
            print 't', sample
</pre>
<p>Still no output to an audio file. What it does output is a printed list of frames and samples. Here&#8217;s frame 4276:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
4276 :
    0.128148365438
    0.138541849949
    0.14709747835
    0.153592896452
    0.157826911985
    0.15962183375
    0.158825589584
    0.155313602303
    0.148990404968
    0.139790979215
</pre>
<p>BTW, I&#8217;m trying a new service, <a href="http://textsnip.com/">textsnip.com</a>, for storing and sharing my scripts online. If you have a better recommendation, let me know. Update: textsnip seems to add a couple of gremlins to the autodocs, so I&#8217;m trying out <a href="http://snipt.org/Lnlo">snipt.org</a> as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/rendering-1-second-of-audio-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Iterator as a Sine Oscillator</title>
		<link>http://codehop.com/python-iterator-as-a-sine-oscillator/</link>
		<comments>http://codehop.com/python-iterator-as-a-sine-oscillator/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 21:54:34 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[iterator]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://slipmat.noisepages.com/?p=186</guid>
		<description><![CDATA[I wrote a sine oscillator as a Python iterator class. Not the fastest digital oscillator in the world. Though for now, doing prototype work in pure Python will do just fine, even if it means slow render times. In the &#8230; <a href="http://codehop.com/python-iterator-as-a-sine-oscillator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I wrote a sine oscillator as a Python iterator class. Not the fastest digital oscillator in the world. Though for now, doing prototype work in pure Python will do just fine, even if it means slow render times. In the long run, Slipmat will require a powerhouse of an engine for real-time audio synthesis and DSP, probably written in C. All in good time.</p>
<p>Here&#8217;s the script:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
#!/usr/bin/env python
import math
import itertools

class Sine:
    '''A sine wave oscillator.'''
    
    sr = 44100
    ksmps = 10    
    
    def __init__(self, amp=1.0, freq=440, phase=0.0):
        self.amp = amp
        self.freq = float(freq)
        self.phase = phase
        
    def __iter__(self):
        self.index = 0
        return self
    
    def next(self):
        if self.index >= self.ksmps:
            raise StopIteration

        self.index += 1
        v = math.sin(self.phase * 2 * math.pi)
        self.phase += self.freq / self.sr
        return v * self.amp

if __name__ == "__main__":
    a1 = Sine(1, 4410, 0.25)
    a2 = Sine(0.5, 8820)
    amix = (i + j for i, j in itertools.izip(a1, a2))
    
    for i in amix:
        print i
</pre>
<p>Currently, it produces the same sound as a tree falling in the woods with no one around to hear it; It doesn&#8217;t write to a DAC or sound file. At least we can still view the results:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
1.0
1.28454525252
0.602909620521
-0.602909620521
-1.28454525252
-1.0
-0.333488736227
-0.0151243682287
0.0151243682287
0.333488736227
</pre>
<p>Near the bottom of the code is a very simple graph, where two sine wave generators (a1 &#038; a2) are patched into a mixer generator (amix), creating a very rudimentary additive synthesizer. The signals aren&#8217;t generated until the for-block at the very end. The script only prints one control-block&#8217;s worth of data, 10 samples, which coincides with the value of ksmps found in class Sine. The sample rate and control rate is built right into class Sine, and needs to be moved out.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/python-iterator-as-a-sine-oscillator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deep Synth &#8212; Dynamically Generated Oscillators</title>
		<link>http://codehop.com/deep-synth-dynamically-generated-oscillators/</link>
		<comments>http://codehop.com/deep-synth-dynamically-generated-oscillators/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 18:26:56 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[compound instrument]]></category>
		<category><![CDATA[deep note]]></category>
		<category><![CDATA[dr. james a. moorer]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[supercollider]]></category>

		<guid isPermaLink="false">http://csound.noisepages.com/?p=154</guid>
		<description><![CDATA[The situation &#8212; You want an instrument that can play any number of oscillators, determined by a p-field value in the score. The problem &#8212; Unit generators cannot be dynamically created in an instrument with a simple loop. One possible &#8230; <a href="http://codehop.com/deep-synth-dynamically-generated-oscillators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The situation &#8212; You want an instrument that can play any number of oscillators, determined by a p-field value in the score. The problem &#8212; Unit generators cannot be dynamically created in an instrument with a simple loop. One possible solution &#8212; Multiple events can be generated in a loop, with each event triggering an oscillator-based instrument.</p>
<p><strong>Download:</strong> <a href="http://www.thumbuki.com/TheCsoundBlog/Deep_Synth.csd">Deep_Synth.csd</a><br />
<strong>Listen:</strong> <a href="http://www.thumbuki.com/TheCsoundBlog/Deep_Synth.mp3">Deep_Synth.mp3</a></p>
<p>The Csound file <a href="http://www.thumbuki.com/TheCsoundBlog/Deep_Synth.csd">Deep_Synth.csd</a> provides an example of how to dynamically generate oscillators using the compound instrument technique. A compound instrument is two or more instruments that operate as a single functioning unit. This particular compound instrument is built from two instruments: DeepSynth and SynthEngine. SynthEngine is, you guessed it, the synth engine, while DeepSynth is a player instrument that generates multiple events for SynthEngine using the opcodes <em>loop_lt</em> and <em>event_i</em>:</p>
<pre>
i_index = 0
loop_start:
    ...
    event_i "i", $SynthEngine, 0, idur, iamp, ipch, iattack, idecay, ipan,
            irange, icps_min, icps_max, ifn
loop_lt i_index, 1, ivoices, loop_start
</pre>
<p>
If you are wondering why we can&#8217;t just place a unit generator, such as <em>oscil</em>, inside of a loop, read Steven Yi&#8217;s articles Control Flow <a href="http://csounds.com/journal/2006spring/controlFlow.html">Pt I</a> and <a href="http://csounds.com/journal/2006summer/controlFlow_part2.html">Pt II</a>. Pay special attention to the section <em>IV. Recursion &#8211; Tecnical Explanation</em> near the end of Pt. II.  Not only does Mr. Yi do an excellent job explaining these technical reasons, but he also provides another applicable solution for creating multiple unit generator instances utilizing recursion and user-defined opcodes.</p>
<h4>Sound Design</h4>
<p>The instrument SynthEngine uses a single wavetable oscillator, an amplitude envelope and the jitter opcode to randomly modulate frequency. A single instance of DeepSynth can generate multiple instances of SynthEngine. DeepSynth can generate a single instance, or 10,000+. Users have control over the depth of frequency modulation, as well as the rate in which jitter ramps from one random value to the next. Panning between instances of SynthEngine is evenly distributed.</p>
<h4>&#8220;Turn it up!&#8221; &#8211; Abe Simpson</h4>
<p>The name DeepSynth is a homage to <a href="http://www.jamminpower.com/jam.html">Dr. James A. Moorer</a>&#8216;s piece <a href="http://en.wikipedia.org/wiki/Deep_Note">Deep Note</a>, also known as the infamous <a href="http://www.thx.com/">THX</a> Logo Theme. Very early in the design, it became evident that DeepSynth is capable of making very Deep Note like drones. This is due to the fact that it does utilize some of the defining techniques used in Dr. Moorer&#8217;s piece.</p>
<p>I highly recommend reading <a href="http://www.batuhanbozkurt.com/instruction/recreating-the-thx-deep-note">Recreating the THX Deep Note</a> by Batuhan Bozkurt at <a href="http://www.batuhanbozkurt.com/">EarSlap</a>. The author conveniently walks readers through each step of the process, providing both audio and <a href="http://www.audiosynth.com/">Supercollider</a> code examples. If you have ever yearned to create that amazing sound for yourself, here&#8217;s your opportunity.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/deep-synth-dynamically-generated-oscillators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.thumbuki.com/TheCsoundBlog/Deep_Synth.mp3" length="1083756" type="audio/mpeg" />
		</item>
		<item>
		<title>Punchcard Oscillator Poster</title>
		<link>http://codehop.com/punchcard-oscillator-poster/</link>
		<comments>http://codehop.com/punchcard-oscillator-poster/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 01:53:03 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[computer music]]></category>
		<category><![CDATA[old school]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[poster]]></category>
		<category><![CDATA[punchcard]]></category>
		<category><![CDATA[retro]]></category>

		<guid isPermaLink="false">http://csound.noisepages.com/?p=34</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-32" title="The Csound Blog Retro Poster" src="http://codehop.com/wp-content/uploads/2009/10/TheCsoundBlogRetroPoster.jpg" alt="The Csound Blog Retro Poster" width="500" height="500" /></p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/punchcard-oscillator-poster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Backlog</title>
		<link>http://codehop.com/the-backlog/</link>
		<comments>http://codehop.com/the-backlog/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 16:28:57 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[adsr]]></category>
		<category><![CDATA[convolution]]></category>
		<category><![CDATA[dtfm]]></category>
		<category><![CDATA[envelope]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[morse code]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[sequencer]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[spatializer]]></category>
		<category><![CDATA[vocoder]]></category>

		<guid isPermaLink="false">http://csound.noisepages.com/?p=25</guid>
		<description><![CDATA[I&#8217;m reposting all the Csound Blog posts from the original site.  The write-ups are stored within the Csound files themselves.  I&#8217;m really looking forward to posting new content, and will hopefully have something up by the end of the week. &#8230; <a href="http://codehop.com/the-backlog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m reposting all the Csound Blog posts from the original site.  The write-ups are stored within the Csound files themselves.  I&#8217;m really looking forward to posting new content, and will hopefully have something up by the end of the week.  Without further ado:</p>
<ul>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20061222.csd">An Experiment in Csound Blogging</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20061227.csd">Back in the ADSR</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070122.csd">Oscillator Arrays and Multi-Band Spatializers</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070206.csd">Robot Voices and Android Grooves</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070214.csd">Home Brewed Convolution</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070410.csd">Adding Zak to the Mix</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070420.csd">A Micro Intro to Macros</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070502.csd">Drum Sequencer Event Generator</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070620.csd">Modular Instruments</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20070702.csd">Modular Instruments Part II</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20080102.csd">The Infamous mcseq</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20080126.csd">SineBox</a></li>
<li><a href="http://www.thumbuki.com/csound/files/thumbuki20080602.csd">Touch-Tone DTMF Generator</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/the-backlog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plan B Complex VCO</title>
		<link>http://codehop.com/plan-b-complex-vco/</link>
		<comments>http://codehop.com/plan-b-complex-vco/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 13:17:55 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[the cosmos]]></category>
		<category><![CDATA[morph]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[planb]]></category>
		<category><![CDATA[pulse]]></category>
		<category><![CDATA[pwm]]></category>
		<category><![CDATA[saw]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[square]]></category>
		<category><![CDATA[synthesizer]]></category>
		<category><![CDATA[triangle]]></category>
		<category><![CDATA[vco]]></category>

		<guid isPermaLink="false">http://www.thumbuki.com/?p=203</guid>
		<description><![CDATA[Flickr photo by me. I only have one of these babies, and have plans to pick up two more sometime in the future. Here&#8217;s the description of the Plan B Model 15 Complex VCO at ear-group.net.]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/thumbuki/2751548304/" title="Plan B Complex VCO by thumbuki, on Flickr"><img src="http://farm3.static.flickr.com/2143/2751548304_c129f60420.jpg" width="500" height="333" alt="Plan B Complex VCO" /></a><br />
Flickr photo by <a href="http://flickr.com/photos/thumbuki/">me</a>.</p>
<p>I only have one of these babies, and have plans to pick up two more sometime in the future.  Here&#8217;s the description of the <a href="http://www.ear-group.net/model_15.html">Plan B Model 15 Complex VCO</a> at <a href="http://www.ear-group.net/earhome.php">ear-group.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/plan-b-complex-vco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginning Csound @ NYC Resistor</title>
		<link>http://codehop.com/beginning-csound-nyc-resistor/</link>
		<comments>http://codehop.com/beginning-csound-nyc-resistor/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 15:09:15 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[the cosmos]]></category>
		<category><![CDATA[amplifier]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[computermusic]]></category>
		<category><![CDATA[csound]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[envelope]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[jacobjoaquin]]></category>
		<category><![CDATA[maxmathews]]></category>
		<category><![CDATA[modulation]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[musicn]]></category>
		<category><![CDATA[nycr]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[synthesizer]]></category>

		<guid isPermaLink="false">http://www.thumbuki.com/?p=193</guid>
		<description><![CDATA[Beginning Csound July 28, 2008 @ NYC Resistor 1 Session, 3 hours, with personalized post-session project with instructor via email. Cost $75 Csound is the most powerful computer music language in the world, with a direct lineage to Max Mathews&#8217; &#8230; <a href="http://codehop.com/beginning-csound-nyc-resistor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.eventbrite.com/event/129871449"><img src="http://www.thumbuki.com/images/BeginningCsoundAtNYCR.jpg" width="400px" height="300px" alt="Beginning Csound" title="Beginning Csound"></a></p>
<p><a href="http://www.eventbrite.com/event/129871449">Beginning Csound</a><br />
July 28, 2008 @ <a href="http://www.nycresistor.com/">NYC Resistor</a><br />
1 Session, 3 hours, with personalized post-session project with instructor via email.<br />
Cost $75</p>
<p>Csound is the most powerful computer music language in the world, with a direct lineage to Max Mathews&#8217; original Music-N languages. The focus of this class will be a synthesis of three topics: The Csound language, synthesizer theory, and composing weird alien music.</p>
<p>Together, we will demystify the assembly-like syntax of the Csound language. We will cover the fundamentals of synthesizer theory, including: oscillators, filters, envelopes, amplifiers and modulation. Finally, we&#8217;ll tie it all together by composing sounds in the vein of classic Sci-Fi movies.</p>
<p>Taught by Jacob Joaquin (that&#8217;s me.) <a href="http://www.eventbrite.com/event/129871449">Click here</a> to enroll.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/beginning-csound-nyc-resistor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Csound and the OLPC</title>
		<link>http://codehop.com/csound-and-the-olpc/</link>
		<comments>http://codehop.com/csound-and-the-olpc/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 21:59:07 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[the cosmos]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[amplitude]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[csndsugui]]></category>
		<category><![CDATA[csound]]></category>
		<category><![CDATA[envelope]]></category>
		<category><![CDATA[kick]]></category>
		<category><![CDATA[musical]]></category>
		<category><![CDATA[olpc]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[snare]]></category>
		<category><![CDATA[stepsequencer]]></category>
		<category><![CDATA[synthesizer]]></category>
		<category><![CDATA[tempo]]></category>
		<category><![CDATA[toy]]></category>
		<category><![CDATA[xo]]></category>

		<guid isPermaLink="false">http://www.thumbuki.com/20080310/csound-and-the-olpc.html</guid>
		<description><![CDATA[Flickr photo by me Since friday, I&#8217;ve been learning the ins and outs of my XO computer. I finally got to a point this morning where I can start writing csound-based activities for it. Using the csndsugui toolkit, I slapped &#8230; <a href="http://codehop.com/csound-and-the-olpc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/thumbuki/2324702204/" title="OLPC by thumbuki, on Flickr"><img src="http://farm3.static.flickr.com/2233/2324702204_43876b42ef.jpg" width="500" height="375" alt="OLPC" /></a></p>
<p><a href="http://www.flickr.com/photos/thumbuki/2324702204/">Flickr photo</a> by <a href="http://www.flickr.com/photos/thumbuki/">me</a></p>
<p>Since friday, I&#8217;ve been learning the ins and outs of my <a href="http://laptop.org/">XO computer</a>.  I finally got to a point this morning where I can start writing <a href="http://www.csounds.com/">csound</a>-based <a href="http://wiki.laptop.org/go/Software_components">activities</a> for it.</p>
<p>Using the csndsugui toolkit, I slapped together a primitive step-sequencer in about five hours.  It features: An 8-step pitch slider array, two oscillators for notes, AD envelope for amplitude, tempo control, volume control, 8-step kick row and an 8-step snare row.  So while it might not do much at the moment, I can certainly see myself fixing it up to a point where it&#8217;ll be a fun musical toy in the near future.  I&#8217;ll post a pic in a few days, once it shapes up a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/csound-and-the-olpc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oscillator Experiment Update: Piecewise Sine</title>
		<link>http://codehop.com/oscillator-experiment-update-piecewise-sine/</link>
		<comments>http://codehop.com/oscillator-experiment-update-piecewise-sine/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 22:07:48 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[the cosmos]]></category>
		<category><![CDATA[adamsomers]]></category>
		<category><![CDATA[analog]]></category>
		<category><![CDATA[csound]]></category>
		<category><![CDATA[digital]]></category>
		<category><![CDATA[distortion]]></category>
		<category><![CDATA[doktorfuture]]></category>
		<category><![CDATA[harmonicdistortion]]></category>
		<category><![CDATA[matrixsynth]]></category>
		<category><![CDATA[model15]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[petergrenader]]></category>
		<category><![CDATA[piecewise]]></category>
		<category><![CDATA[planb]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[synthesizer]]></category>
		<category><![CDATA[wavetable]]></category>

		<guid isPermaLink="false">http://www.thumbuki.com/20070601/oscillator-experiment-update-piecewise-sine.html</guid>
		<description><![CDATA[After matrixsynth.com picked up &#8220;My Sine Oscillator Experiment,&#8221; doktor future started a discussion about different ways of emulating analog oscillators in digital. Adam S mentioned that he thought the Plan B sine looked like a piecewise quadratic to him and &#8230; <a href="http://codehop.com/oscillator-experiment-update-piecewise-sine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>After <a href="http://matrixsynth.blogspot.com/">matrixsynth.com</a> picked up &#8220;<a href="http://www.thumbuki.com/20070528/my-sine-oscillator-experiment.html">My Sine Oscillator Experiment</a>,&#8221; <a href="http://www.blogger.com/profile/03296063693804241211">doktor future</a> started a <a href="https://www.blogger.com/comment.g?blogID=17775202&#038;postID=6607874390477067660">discussion</a> about different ways of emulating analog oscillators in digital.  <a href="http://music.calarts.edu/~asomers/">Adam S</a> mentioned that he thought the Plan B sine looked like a piecewise quadratic to him and provided the following function:<br />
<blockquote>y=<br />
-(4/pi^2)[x &#8211; (pi/2)]^2+1, x from 0 to pi<br />
(4/pi^2)[x-(3pi/2)]^2-1, x from pi to 2pi</p></blockquote>
<p>After having checked it out in <a href="http://en.wikipedia.org/wiki/Grapher">grapher.app</a> myself, and confirmed it did look similar to the Plan B sine, I implemented this as a wave table in Csound.  See <a href="http://www.thumbuki.com/csound/files/outsideblogs/piecewise.csd">piecewise.csd</a>.</p>
<div id="postimage" class="right" style="width: 302px"><img src="http://www.thumbuki.com/images/Sine/SinePiecewisePlusPlanB.gif" width=300 height=200></div>
<p><b>Piecewise + Plan B Model 15</b></p>
<p>In this image, I have superimposed Adam&#8217;s recommended piecewise function over the Plan B&#8217;s <a href="http://www.ear-group.net/model_15.html">Model 15</a> sine wave.  As you can see, their contours are not quite identical, though very, very similar.</p>
<p>After listening to both waves side-by-side, the harmonic distortion in the piecewise sine example is a tad louder, and the frequencies are just slightly off.  At least to my ears.  However, I consider it to be a wonderful approximation of the Model 15.</p>
<div style="clear: both"></div>
<p><b>Oh, the Irony</b></p>
<p><a href="http://www.ear-group.net/who_are_we.html#P">Peter Grenader</a>, the principle designer at Plan B, has this written in his bio:<br />
<blockquote>&#8220;In 2001 , Peter returned to analog after a 22 year hiatus because he tired of trying to force digital instruments to behave in like manner.&#8221;</p></blockquote>
<p>I&#8217;m finding this whole discussion a bit humorous as the three of us are doing exactly this, trying to force digital instruments to sound like analog.  In this case, Mr. Grenader&#8217;s analog oscillator.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/oscillator-experiment-update-piecewise-sine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Sine Oscillator Experiment</title>
		<link>http://codehop.com/my-sine-oscillator-experiment/</link>
		<comments>http://codehop.com/my-sine-oscillator-experiment/#comments</comments>
		<pubDate>Mon, 28 May 2007 17:05:19 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[the cosmos]]></category>
		<category><![CDATA[apogee]]></category>
		<category><![CDATA[cable]]></category>
		<category><![CDATA[csound]]></category>
		<category><![CDATA[cwejman]]></category>
		<category><![CDATA[distortion]]></category>
		<category><![CDATA[doepfer]]></category>
		<category><![CDATA[ensemble]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[lfo]]></category>
		<category><![CDATA[modular]]></category>
		<category><![CDATA[oscillator]]></category>
		<category><![CDATA[peak]]></category>
		<category><![CDATA[planb]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[synthesizers]]></category>
		<category><![CDATA[vco]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://www.thumbuki.com/20070528/my-sine-oscillator-experiment.html</guid>
		<description><![CDATA[Over the weekend, I recorded/generated four sine waves of different synthesizer modules and compared the results. Each of the four oscillators are tuned to approximately to 440Hz, close enough to get a sense of each wave shape. This is a &#8230; <a href="http://codehop.com/my-sine-oscillator-experiment/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Over the weekend, I recorded/generated four sine waves of different synthesizer modules and compared the results.  Each of the four oscillators are tuned to approximately to 440Hz, close enough to get a sense of each wave shape.</p>
<p>This is a very casual observation of contour and contour only, so please do not read too much into my findings.  Here are the results:</p>
<div id="postimage" class="right" style="width: 302px"><img src="http://www.thumbuki.com/images/Sine/SineCsound.gif" width=300 height=200></div>
<p><b>Csound Digital Oscillator</b></p>
<p>This first graph shows a digital sine wave generated within the computer music language Csound.  This is what I used as my test reference.  Being that this is a purely mathematical construct, I figured this would be the perfect wave to compare against its analog counterparts.</p>
<div style="clear: both"></div>
<div id="postimage" class="right" style="width: 302px"><img src="http://www.thumbuki.com/images/Sine/SineDoepferA110.gif" width=300 height=200></div>
<p><b>Doepfer A-110 Standard VCO</b></p>
<p>Upon casual observation, you may notice that the sine isn&#8217;t the most accurate in the world.  In fact, you might go as far to say this isn&#8217;t a sine wave at all.  One noticable feature of this oscillator is that little glitch you see at 90º.  This is consistent among every cycle at the stated frequency.  I have two of these modules, and there were no significant differences when compared to each other.</p>
<p>Now it might sound like I&#8217;m completely down on this module.  The truth is, I&#8217;m actually quite happy with this dirtiness of this unit, as it adds character.  It is sometimes the imperfections that make something great.</p>
<div style="clear: both"></div>
<div id="postimage" class="right" style="width: 302px"><img src="http://www.thumbuki.com/images/Sine/SinePlanBModel15.gif" width=300 height=200></div>
<p><b>Plan B Model 15</b></p>
<p>This unit has the smoothest contour of the three analog examples.  Though the shape doesn&#8217;t adhere completely to the perfectly generated Csound test reference, it certainly gets close.  The peak and the dip seem to be a bit rounder, almost as if they are slightly compressed.</p>
<div style="clear: both"></div>
<div id="postimage" class="right" style="width: 302px"><img src="http://www.thumbuki.com/images/Sine/SineCwejmanDLFO.gif" width=300 height=200></div>
<p><b>Cwejman D-LFO</b></p>
<p>Now, I must say that it probably isn&#8217;t fair that I&#8217;m comparing a device designed specifically for low frequencies.  With that being said, the contour fared noticeably better than the Doepfer.  You might notice that the peak and the dip are both a little on the sharp side.  The D-LFO comes with two oscillators, both of which I tested.  I found both to be consistent with one another.</p>
<div style="clear: both"></div>
<div id="postimage" class="right" style="width: 302px"><img src="http://www.thumbuki.com/images/Sine/SineAll.gif" width=300 height=200></div>
<p><b>All Examples Compared</b></p>
<p>For fun, I thought it would be nice to superimpose each example over one another so we can better observe how much variation can exist between sine wave oscillators.</p>
<div style="clear: both"></div>
<p><b>Other Variables in the Equation</b></p>
<p>Since I recorded the three analog signals, there were at least two extra variables that may have introduced distortion to the resulting wave shapes.  The first would be the recording device, an Apogee Ensemble with the soft limit feature set to off.  The second is the cable.  I used the same cable for all the recordings.  I always patched directly from the sine wave outputs to the Ensemble input.</p>
<p>I did go the extra step and recorded the Csound sine wave with the Ensemble and cable.  I found there were no significant differences, in terms of contour, between the original generated wave and the recorded version.</p>
<p><b>My Methods</b></p>
<p>Last, I want to share the methods I used to collect and present the data.  I recorded the three analog signals with the Apogee Ensemble, and with the software Peak.  I took screen captures of peak, and then processed them in Photoshop.  In Photoshop, I removed the dotted zero line, and replaced it with a solid line.  I also resized each image so the waves would have matching periods.  Though I compressed the width of each waveform, the contours of the waves were not affected.</p>
<p>And like I said, this experiment is just the casual observations of one guy, and completely non-scientific.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/my-sine-oscillator-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
