<?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; string</title>
	<atom:link href="http://codehop.com/tag/string/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>x Trigger Notation</title>
		<link>http://codehop.com/x-trigger-notation/</link>
		<comments>http://codehop.com/x-trigger-notation/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 15:10:59 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[docstring]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[notation]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://slipmat.noisepages.com/?p=166</guid>
		<description><![CDATA[In Roll You Own Syntax, I theorized how users could construct their own systems of notation using strings. I&#8217;ve constructed a working function, called trig(), to show how it&#8217;s done. First, let&#8217;s see trig() in action. The following is complete &#8230; <a href="http://codehop.com/x-trigger-notation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://slipmat.noisepages.com/2010/04/roll-your-own-score-syntax/">Roll You Own Syntax</a>, I theorized how users could construct their own systems of notation using strings. I&#8217;ve constructed a working function, called trig(), to show how it&#8217;s done.</p>
<p>First, let&#8217;s see trig() in action. The following is complete conceptual prototype Slipmat program that generates a rock drum groove with 8th note hats:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
#!/usr/bin/env slipmat

from JakeLib.Generators import trig
from EasyKit import hat, snare, kick
    
@trig('x.x. x.x. x.x. x.x.') hat()
@trig('.... x... .... x...') snare()
@trig('x... .... x... ....') kick()
</pre>
<p>This horizontal system for notating triggers, and others like it, can greatly improve the legibility of a piece, while catering to a composer&#8217;s preferred style of working. A composer quickly scans this and comprehends it without having to reconstruct it in their head from a list of individual events:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
@0    hat()
@0    kick()
@0.5  hat()
@1    hat()
@1    snare()
@1.5  hat()
@2    hat()
@2    kick()
@2.5  hat()
@3    hat()
@3    snare()
@3.5  hat()
</pre>
<p>The form is lost in translation.</p>
<p>Building the function is pretty straight forward if you&#8217;re somewhat experienced with Python. I put together the following function definition, with <a href="http://slipmat.noisepages.com/2010/03/on-the-importance-of-docstrings/">docstrings</a>, in roughly 15 minutes:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
def trig(seq, res=0.25):
    '''
    Creates a numeric sequence from a string and returns a list.

    Description:
    A string trigger sequencer, where an 'x' creates a trigger, and a
    '.' creates a rest. All other glyphs are ignored. The resolution
    of triggers and rests are determined by the argument res.

    Input:
    seq -- A string containing a sequence of 'x' triggers and '.' rests
    res -- Resolution of note triggers and rests
        
    Output:
    return -- A numeric list
    '''    
    
    L = []  # The return list
    p = 0   # Position in sequence

    for c in seq:
        if c == 'x':
            L.append(p * res)
            p += 1            
        elif c == '.':
            p += 1

    return L
</pre>
<p>The trig() function accepts a string formatted in what I call &#8216;x trigger notation.&#8217; The function parses the string and <a href="http://slipmat.noisepages.com/2010/04/auto-generating-lists/">auto-generates a list</a> of numbers representing trigger times. A trigger is denoted by an &#8216;x&#8217;, while a rest is a &#8216;.&#8217;. All other glyphs are ignored. I use a single space between beats for clarity. The default resolution is a 16th note, though trig() accepts an optional argument for changing the resolution, increasing its usefulness.</p>
<p><strong>Import, Reuse, Remix</strong></p>
<p>The best part about custom functions is that they can be reused multiple times in multiple programs by multiple people with the use of the <a href="http://slipmat.noisepages.com/2010/03/importing-modules-and-reusing-code/">import</a>. No refactoring of code, no copy and paste, no reinventing of the wheel. Just import, reuse, remix.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/x-trigger-notation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bowed String Additive Synth</title>
		<link>http://codehop.com/bowed-string-additive-synth/</link>
		<comments>http://codehop.com/bowed-string-additive-synth/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 16:46:18 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[additive]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://csound.noisepages.com/?p=333</guid>
		<description><![CDATA[About 12 years ago, someone told me that additive synthesis will never be practical. My initial reaction was, &#8220;we&#8217;ll see about that.&#8221; This person&#8217;s background was that of modular subtractive synths, and was quite knowledgeable. From that perspective, I could &#8230; <a href="http://codehop.com/bowed-string-additive-synth/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>About 12 years ago, someone told me that additive synthesis will never be practical. My initial reaction was, &#8220;we&#8217;ll see about that.&#8221; This person&#8217;s background was that of modular subtractive synths, and was quite knowledgeable. From that perspective, I could see their point. Who want&#8217;s to take the time to create complex envelopes for each individual harmonic? My mind has often wondered back to this incident.</p>
<p>Today, additive synths are becoming more common thanks to faster computers. Many of their UIs do help programmers with the large amounts of complexity additive brings to the table. And there are many useful and valid approaches, each with their own strengths and weaknesses.</p>
<object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F2871332&amp;g=1&amp;auto_play=false&amp;show_comments=true&amp;color=&amp;theme_color="></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F2871332&amp;g=1&amp;auto_play=false&amp;show_comments=true&amp;color=&amp;theme_color=" type="application/x-shockwave-flash" width="100%"> </embed></object>
<p><strong>Download:</strong> <a href="http://www.thumbuki.com/TheCsoundBlog/bowed_string.csd">bowed_string.csd</a></p>
<p>My approach has been floating around my head on and off for about a decade. The first iteration was completed around 2002, and was shelved until recently. Today&#8217;s csd is a continuation of the second iteration of the design, which I had originally intended to use with Fragments (see <a href="http://csound.noisepages.com/2010/02/fragments-of-a-bohlen-pierce-composition-pt-4/">here</a>), but ran out of time. For the next couple of weeks, I plan on taking this instrument to its illogical conclusion (I have no idea what it&#8217;ll be like when it&#8217;s done.) When I am finished, I&#8217;ll write an in depth article for The Csound Journal on the final design.</p>
<p>The premise for my approach is to use f-tables as a shortcut for specifying and controlling additive synth data. In today&#8217;s example, the audio generator produces a 32 band-limited sawtooth wave. However, before the sine waves are generated with oscil, the synth data is run through two transfer functions, stored as f-tables. One transfer function changes the amplitudes of the harmonics, emulating the EQ of a virtual acoustic body. The other bends the frequencies, causing frequency distortions. Frequencies continue to be processed by the transfer functions, even as they are modulated, which I believe is key to convincing acoustic viability.</p>
<p>The reason why this sounds similar to a bowed stringed instrument is because the amplitude transfer function is filled with the right amount of bipolar noise. The truth is, I had no intention of creating a string-like sound. I was just toying with it and thought I&#8217;d try something drastic like using a table filled with noise. After the discovery, I spent considerable time tweaking the values trying to get it to sound a little bit more expressive.</p>
<p>I should warn you, there are some clear cases of aliasing occurring in today&#8217;s example. I think I know what&#8217;s causing it, but I&#8217;ll have to go back and run some tests to be certain. In the mean time, I hope you enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/bowed-string-additive-synth/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
