<?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; ide</title>
	<atom:link href="http://codehop.com/tag/ide/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>On the Importance of Docstrings</title>
		<link>http://codehop.com/on-the-importance-of-docstrings/</link>
		<comments>http://codehop.com/on-the-importance-of-docstrings/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 15:23:22 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[doctring]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[max]]></category>
		<category><![CDATA[pd]]></category>
		<category><![CDATA[reaktor]]></category>
		<category><![CDATA[sphinx]]></category>

		<guid isPermaLink="false">http://slipmat.noisepages.com/?p=51</guid>
		<description><![CDATA[Docstrings can do wondrous things. Wikipedia describes a docstring as &#8220;a string literal specified in source code that is used, like a comment, to document a specific segment of code.&#8221; I&#8217;ve rewritten sine_arp() to demonstrate a theoretical docstring example: def &#8230; <a href="http://codehop.com/on-the-importance-of-docstrings/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://codehop.com/wp-content/uploads/2010/03/sine_arp_object.gif" alt="sine_arp visual object" title="sine_arp visual object" width="433" height="250" class="alignnone size-full wp-image-52" /></p>
<p>Docstrings can do wondrous things. Wikipedia describes a <a href="http://en.wikipedia.org/wiki/Docstring">docstring</a> as <em>&#8220;a string literal specified in source code that is used, like a comment, to document a specific segment of code.&#8221;</em> I&#8217;ve rewritten sine_arp() to demonstrate a theoretical docstring example:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
def sine_arp(dur, amp, pitch, lfo_freq):
    '''Generates an arpeggiated sine tone.
    
    dur - Duration
    amp - Amp
    pitch - Pitch, in pitch-class format
    lfo_freq - Frequency of lfo arpeggiator    
    output - Audio signal
    '''
    
    self['dur'] = dur                            # Set life of instance
    notes = [0, 3, 7, 8]                         # List of half-steps
    arp = Wavetable.osc(1, lfo_freq, notes)      # Cycle through note list
    pitch = cpspch(pitch) * 2 ** (arp / 12.0)    # Modulate pitch with arp    
    osc = Wavetable.osc(amp, pitch, sine(1000))  # Generate audio
    output osc                                   # Return audio
</pre>
<p>The docstring is the string block between the matching triple quotes. It gives a basic description of what the function/opcode/unit generator does and descriptions for the inputs and output.</p>
<p>What are the advantages of building docstring capabilities directly into a computer music language?</p>
<p>One. A proper description of a function and its interface will allow other users to import and reuse code with ease, propagating a remix culture within the community.</p>
<p>Two. With a utility like the <a href="http://sphinx.pocoo.org/">Sphinx Python Documentation Generator</a>, complete documentation can be auto-generated in the form of HTML, PDF, LaTeX, etc. This gives users the opportunity to browse a library of synths, patterns, note generators without ever having to browse the code.</p>
<p>Three. They can provide interactive help from within an integrated development environment. For example, if your cursor is resting in the middle of a function, the description can automatically be displayed from somewhere within the IDE.</p>
<p>Four. Imagine if a visual GUI environment, such as Max or PD or Reaktor, was built <del datetime="2010-03-31T17:51:49+00:00">on top of</del> with slipmat. Docstring data could automatically be relayed to the visual object, as seen in the picture above. Furthermore, I have a hunch that if slipmat is designed properly, than all text function definitions could be visual objects, and vice versa, without modificaiton.</p>
<p><strong>Question:</strong> Are there any other music languages that utilize a Docstring-like system.  If so, I want to study them.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/on-the-importance-of-docstrings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
