<?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; event</title>
	<atom:link href="http://codehop.com/tag/event/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>Score Events</title>
		<link>http://codehop.com/score-events/</link>
		<comments>http://codehop.com/score-events/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:20:45 +0000</pubDate>
		<dc:creator><![CDATA[Jacob Joaquin]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[instrument]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scheduler]]></category>
		<category><![CDATA[score]]></category>

		<guid isPermaLink="false">http://slipmat.noisepages.com/?p=230</guid>
		<description><![CDATA[No computer music system is complete without the ability to place notes into a score/timeline. Read and download today&#8217;s script here. The mechanisms that schedule score events and print the results are still a bit wonky. So I&#8217;m going to &#8230; <a href="http://codehop.com/score-events/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>No computer music system is complete without the ability to place notes into a score/timeline. Read and download today&#8217;s script <a href="http://snipt.org/Muj">here</a>.</p>
<p>The mechanisms that schedule score events and print the results are still a bit wonky. So I&#8217;m going to omit the explanation for now, and instead just focus on how they&#8217;re used. The following is the __main__ from the script:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
if __name__ == "__main__":
    @Instr
    def RingTine(dur, amp, freq_1, freq_2):
        return Sine(amp, freq_1) * Sine(amp, freq_2) * RiseFall(dur, 0)

    s = ScoreEvents()
    s.event(0, 0.25, RingTine(0.25, 1, 440, 44))
    s.event(0.5, 0.125, RingTine(0.125, 0.333, 262, 44))
    s.event(0.75, 0.25, RingTine(0.25, 0.25, 262, 44))
    s.event(0.75, 0.25, RingTine(0.25, 0.5, 440, 44))
    for frame in PrintSamples(s): pass
</pre>
<p>The first part of __main__ defines an instrument called RingTine that generates a percussive ring-modulated timbre. At least in theory; Still no sound output.</p>
<p>The next step creates a ScoreEvents() object. This is where events are scheduled. This is followed by 4 lines of code that schedule events for @Instr RingTine with the ScoreEvents class method event(). The method takes three arguments:</p>
<pre style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 1.2em; padding-bottom: 16px">
ScoreEvents.event(start_time, duration, UnitGenerator(*args))
</pre>
<p>The very last line prints the samples generates by the score with the PrintSamples() iterator. The implementation is seriously lame at the moment, but is perfectly acceptable for a crude prototype.</p>
]]></content:encoded>
			<wfw:commentRss>http://codehop.com/score-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
