<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://cycling74.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;feed=atom&amp;action=history</id>
		<title>MSP Polyphony Tutorial 3: Granular Synthesis - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;action=history"/>
		<updated>2013-05-24T02:41:24Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=921&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 16:15, 6 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=921&amp;oldid=prev"/>
				<updated>2012-07-06T16:15:49Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:15, 6 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;patches&lt;/del&gt;: [[Media:03hGranularSynth.zip]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;patch and files&lt;/ins&gt;: [[Media:03hGranularSynth.zip]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=894&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 23:01, 5 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=894&amp;oldid=prev"/>
				<updated>2012-07-05T23:01:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:01, 5 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patches: [[Media:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;03hGranularSYnth&lt;/del&gt;.zip]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patches: [[Media:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;03hGranularSynth&lt;/ins&gt;.zip]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=893&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 23:01, 5 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=893&amp;oldid=prev"/>
				<updated>2012-07-05T23:01:17Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:01, 5 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patches: [[Media:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;03hGranularSynth&lt;/del&gt;.zip]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patches: [[Media:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;03hGranularSYnth&lt;/ins&gt;.zip]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=891&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 22:59, 5 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=891&amp;oldid=prev"/>
				<updated>2012-07-05T22:59:23Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 22:59, 5 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;patch&lt;/del&gt;: [[Media:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;03hGranularSynthesis&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;maxpat&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;patches&lt;/ins&gt;: [[Media:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;03hGranularSynth&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zip&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=833&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 15:34, 28 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=833&amp;oldid=prev"/>
				<updated>2012-06-28T15:34:25Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:34, 28 June 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patch: [[03hGranularSynthesis.maxpat]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patch: [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Media:&lt;/ins&gt;03hGranularSynthesis.maxpat]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Granular synthesis===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=748&amp;oldid=prev</id>
		<title>Admin at 20:04, 25 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=748&amp;oldid=prev"/>
				<updated>2012-06-25T20:04:48Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;amp;diff=748&amp;amp;oldid=734&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=734&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;Click here to open the tutorial patch: 03hGranularSynthesis.maxpat  ===Granular synthesis===  In this tutorial we'll look at using the {{maxword|name=poly~}} object to gen...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_3:_Granular_Synthesis&amp;diff=734&amp;oldid=prev"/>
				<updated>2012-06-24T23:02:50Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Click here to open the tutorial patch: &lt;a href=&quot;/wiki/index.php?title=03hGranularSynthesis.maxpat&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;03hGranularSynthesis.maxpat (page does not exist)&quot;&gt;03hGranularSynthesis.maxpat&lt;/a&gt;  ===Granular synthesis===  In this tutorial we&amp;#039;ll look at using the {{maxword|name=poly~}} object to gen...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Click here to open the tutorial patch: [[03hGranularSynthesis.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Granular synthesis===&lt;br /&gt;
&lt;br /&gt;
In this tutorial we'll look at using the {{maxword|name=poly~}} object&lt;br /&gt;
to generate large amounts of polyphony in order the play the&lt;br /&gt;
contents of one {{maxword|name=buffer~}} of sample data. We'll&lt;br /&gt;
leverage the ability of MSP to play sample data from the&lt;br /&gt;
same {{maxword|name=buffer~}} at multiple arbitrary speeds and time&lt;br /&gt;
points to explore the technique of ''granular synthesis''&lt;br /&gt;
&lt;br /&gt;
Put simply, granular synthesis is the use of very short&lt;br /&gt;
(or, sometimes, less short) sonic events called 'grains'&lt;br /&gt;
to generate complex textures. While the musical and written&lt;br /&gt;
literature on the technique is beyond the scope of this&lt;br /&gt;
tutorial (see Curtis Roads' ''Microsound'' (MIT Press: 2004)&lt;br /&gt;
for a great exploration of this topic), we'll cover the basics&lt;br /&gt;
here. While classic granular synthesis relies on the use of&lt;br /&gt;
very small amounts of wavetable data, the technique we'll&lt;br /&gt;
explore in this tutorial uses sample data taken arbitrarily&lt;br /&gt;
from soundfiles.&lt;br /&gt;
&lt;br /&gt;
In our tutorial patcher, we'll create an algorithmic playback&lt;br /&gt;
system based on constrained random values to control the&lt;br /&gt;
following parameters of a polyphonic sample playback engine:&lt;br /&gt;
rate, onset point, duration, pitch, amplitude. We'll also&lt;br /&gt;
look at how adjusting envelopes changes the sonic output.&lt;br /&gt;
&lt;br /&gt;
===Experimenting with the patcher===&lt;br /&gt;
&lt;br /&gt;
Take a look at the tutorial patcher. There are several numbered&lt;br /&gt;
areas, each of which controls part of our granular synthesis&lt;br /&gt;
engine. The patcher area labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is the ''grain emitter''&lt;br /&gt;
proper: a {{maxword|name=metro}} object schedules and fires &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; messages&lt;br /&gt;
into a {{maxword|name=poly~}} object that has loaded 100 voices of an&lt;br /&gt;
abstraction named &amp;lt;code&amp;gt;polygrain~&amp;lt;/code&amp;gt;. Area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; allows us to&lt;br /&gt;
check our CPU usage depending on the parameters of our synthesizer.&lt;br /&gt;
Area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; set the synthesis parameters - the&lt;br /&gt;
sample we're using, which area of it to draw from for grains,&lt;br /&gt;
and the parameters of the grain playback system in&lt;br /&gt;
the &amp;lt;code&amp;gt;polygrain~&amp;lt;/code&amp;gt; abstraction.&lt;br /&gt;
&lt;br /&gt;
* In patcher area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, turn on the audio with the {{maxword|name=toggle}} object&lt;br /&gt;
connected to the {{maxword|name=dac~}}. Turn up either one of&lt;br /&gt;
the {{maxword|name=gain~}} sliders; the other should follow along.&lt;br /&gt;
At the top of the patcher, click the {{maxword|name=button}} object a few&lt;br /&gt;
times and listen to the results. Sending a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; into&lt;br /&gt;
the {{maxword|name=poly~}} object generates a single 'grain' of audio.&lt;br /&gt;
Turn on the {{maxword|name=metro}} object by clicking the {{maxword|name=toggle}} at&lt;br /&gt;
the top of the patcher.&lt;br /&gt;
The {{maxword|name=poly~}} object in our patcher generates grains: single&lt;br /&gt;
bursts of sample playback which we can control dynamically by&lt;br /&gt;
adjusting parameters. The {{maxword|name=metro}} and {{maxword|name=button}} objects&lt;br /&gt;
control the grain emitter. Each time the {{maxword|name=metro}} fires,&lt;br /&gt;
it sends a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; into the {{maxword|name=poly~}}, prepended by&lt;br /&gt;
the &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; message, which assigns the &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; to the&lt;br /&gt;
first available voice within the {{maxword|name=poly~}}. In addition,&lt;br /&gt;
each &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; from the {{maxword|name=metro}} object schedules the&lt;br /&gt;
next one by adjusting the speed of the {{maxword|name=metro}}.&lt;br /&gt;
The {{maxword|name=random}} object generates a random value which is&lt;br /&gt;
then put through a {{maxword|name=scale}} object with a variable output&lt;br /&gt;
range, defined by the &amp;lt;code&amp;gt;speedmin&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;speedmax&amp;lt;/code&amp;gt; parameters&lt;br /&gt;
found in patcher area &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Checking CPU===&lt;br /&gt;
&lt;br /&gt;
* With the grain emitter enabled (i.e. the {{maxword|name=metro}} object set&lt;br /&gt;
to run), turn on the {{maxword|name=metro}} in patcher area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;.&lt;br /&gt;
The {{maxword|name=number}} box at the bottom of the patcher logic should&lt;br /&gt;
output a number. Turn off the grain emitter at the top and watch&lt;br /&gt;
the results. Turn it on again.&lt;br /&gt;
The {{maxword|name=adstatus}} object allows us to control and view aspects&lt;br /&gt;
of the MSP audio driver currently running. All of the viewable&lt;br /&gt;
attributes of the ''Audio Status'' window (available under the&lt;br /&gt;
Max '''Options''' menu) can be accessed via the {{maxword|name=adstatus}} object.&lt;br /&gt;
The &amp;lt;code&amp;gt;cpu&amp;lt;/code&amp;gt; mode of the {{maxword|name=adstatus}} object (set by its argument)&lt;br /&gt;
instructs the object to receive &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; messages and output&lt;br /&gt;
the current CPU usage of MSP. Notice that when the grain emitter&lt;br /&gt;
is turned off, the CPU usage drops to &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt;. This is because&lt;br /&gt;
our {{maxword|name=poly~}} abstraction mutes itself when its playback has&lt;br /&gt;
finished. When no notes are firing, all of the copies of&lt;br /&gt;
the {{maxword|name=poly~}} abstraction should be muted.&lt;br /&gt;
&lt;br /&gt;
===Adjusting parameters===&lt;br /&gt;
&lt;br /&gt;
* In patcher area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;, highlight an area of the {{maxword|name=waveform~}} objects&lt;br /&gt;
to select part of the {{maxword|name=buffer~}} named &amp;lt;code&amp;gt;thegrain&amp;lt;/code&amp;gt;.&lt;br /&gt;
Notice that when you drag on either of the {{maxword|name=waveform~}} objects,&lt;br /&gt;
both of them highlight in the same regions. The rightmost outlet&lt;br /&gt;
of the {{maxword|name=waveform~}} object allows us to ''link'' them&lt;br /&gt;
together so that you can use more than one of the objects to work&lt;br /&gt;
with a multi-channel {{maxword|name=buffer~}}. Load a different sample using&lt;br /&gt;
the {{maxword|name=message}} boxes above the {{maxword|name=buffer~}} object and&lt;br /&gt;
highlight different regions of the sample. The highlighted regions&lt;br /&gt;
of the {{maxword|name=buffer~}} controls where the grain emitter draws its&lt;br /&gt;
sample data.&lt;br /&gt;
* In patcher area &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;, use the {{maxword|name=preset}} object to try out&lt;br /&gt;
different parameters for our grain emitter, then try entering your&lt;br /&gt;
own values. The ''Grain rate'' {{maxword|name=number}} boxes control the&lt;br /&gt;
speed range of the {{maxword|name=metro}} in patcher area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
The ''Grain duration'' controls the ranges for how long each&lt;br /&gt;
grain plays for inside the {{maxword|name=poly~}}. The ''Grain pitch''&lt;br /&gt;
values provide a range for what speed the grains play at.&lt;br /&gt;
The ''Grain amplitude'' controls set the volume range of the&lt;br /&gt;
grain emitter, and the ''Grain slope'' sets the sharpness of&lt;br /&gt;
the attack and decay on each grain's envelope. Notice how different&lt;br /&gt;
densities of grains changes the sound as well as the CPU usage of&lt;br /&gt;
the grains.&lt;br /&gt;
Before we look at our {{maxword|name=poly~}} abstraction, notice the&lt;br /&gt;
effect of longer and shorter grain rates and durations on the&lt;br /&gt;
CPU usage. Longer grain durations and shorter grain rates result&lt;br /&gt;
in more voices inside the {{maxword|name=poly~}} being active at any&lt;br /&gt;
one time - either they are fired more frequently, or they&lt;br /&gt;
take longer to 'free' themselves, or both. The result is a&lt;br /&gt;
higher CPU usage.&lt;br /&gt;
&lt;br /&gt;
* In patcher area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, enable the {{maxword|name=toggle}} object&lt;br /&gt;
attached to the {{maxword|name=message}} box labeled &amp;lt;code&amp;gt;parallel $1&amp;lt;/code&amp;gt;.&lt;br /&gt;
Restart the audio by turning on and off the {{maxword|name=dac~}}. Notice&lt;br /&gt;
the effect, if any, on the CPU.&lt;br /&gt;
Depending on your computer architecture, you can take advantage&lt;br /&gt;
of multiple cores in your computer's CPU (or multiple processors&lt;br /&gt;
if you have a multi-processor machine) by dividing the {{maxword|name=poly~}} object's&lt;br /&gt;
resources over multiple ''threads''. In essence, this divides&lt;br /&gt;
the instances of the {{maxword|name=poly~}} object across the different&lt;br /&gt;
cores or processors of your computer, allowing sets of voices&lt;br /&gt;
to run in parallel. Depending on your computer's CPU architecture,&lt;br /&gt;
this may provide a significant boost in performance.&lt;br /&gt;
&lt;br /&gt;
===Inside the patch===&lt;br /&gt;
&lt;br /&gt;
* Double-click the {{maxword|name=poly~}} object to view an instance of the&lt;br /&gt;
abstraction named &amp;lt;code&amp;gt;polygrain~&amp;lt;/code&amp;gt;. Take a look around the patcher.&lt;br /&gt;
The &amp;lt;code&amp;gt;polygrain~&amp;lt;/code&amp;gt; abstraction recieves a single &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt;&lt;br /&gt;
(via the {{maxword|name=in}} object at the top of the patcher) and uses it&lt;br /&gt;
to generate a grain of audio, using the MSP logic at the bottom&lt;br /&gt;
of the abstraction. The {{maxword|name=trigger}} object at the top of the&lt;br /&gt;
patch clearly sets up the order of events for generating our grain:&lt;br /&gt;
&lt;br /&gt;
First, the {{maxword|name=thispoly~}} object receives a &amp;lt;code&amp;gt;mute 0&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; message in immediate succession. This turns ''on'' (unmutes)&lt;br /&gt;
the signal processing in the instance, and sets it's state to 'busy',&lt;br /&gt;
so that it won't receive any more messages until the grain is finished.&lt;br /&gt;
&lt;br /&gt;
Next, a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; is dispatched to generate a random ''amplitude''&lt;br /&gt;
for the grain, which goes into the right side of the {{maxword|name=*~}} object&lt;br /&gt;
labeled 'how loud is this grain?'. This {{maxword|name=*~}} controls the&lt;br /&gt;
scaling for the output of the {{maxword|name=line~}} object above that sets&lt;br /&gt;
the grain envelope.&lt;br /&gt;
&lt;br /&gt;
Third, a random ''pitch'' is selected which is transformed into&lt;br /&gt;
a duration multiplier for the {{maxword|name=line~}} objects controlling&lt;br /&gt;
the playback of the sample and its amplitude envelope. The {{maxword|name=!/}} object&lt;br /&gt;
divides the incoming pitch into &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt;, so that a requested&lt;br /&gt;
pitch of &amp;lt;code&amp;gt;2.&amp;lt;/code&amp;gt; tells the objects downstream to multiply their&lt;br /&gt;
durations by &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; (half as long, and up an octave).&lt;br /&gt;
&lt;br /&gt;
Fourth, a random ''duration'' is generated, which sets up the&lt;br /&gt;
parameters for the {{maxword|name=line~}} objects so that they generate&lt;br /&gt;
the appropriately scaled and offset values for the grain length.&lt;br /&gt;
&lt;br /&gt;
Finally, a grain is triggered by generating a random ''start point''&lt;br /&gt;
based on the highlighted areas in the {{maxword|name=waveform~}} object in the&lt;br /&gt;
main patcher. This &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; eventually generates two messages&lt;br /&gt;
which command the two {{maxword|name=line~}} objects to generate the playback&lt;br /&gt;
curve for the {{maxword|name=play~}} object and the amplitude envelope for&lt;br /&gt;
the {{maxword|name=*~}} objects.&lt;br /&gt;
&lt;br /&gt;
Once the 'envelope' {{maxword|name=line~}} is finished, it sends a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt;&lt;br /&gt;
to &amp;lt;code&amp;gt;mute&amp;lt;/code&amp;gt; the instance and set it to 'free' (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;), so it&lt;br /&gt;
can receive a new message.&lt;br /&gt;
&lt;br /&gt;
* Under the '''File''' menu in Max, select ''Modify Read Only''.&lt;br /&gt;
This will allow you to unlock the copy of the &amp;lt;code&amp;gt;simplegrain~&amp;lt;/code&amp;gt; abstraction&lt;br /&gt;
you are viewing. Unlock the patcher, and place 'watchpoints' on some&lt;br /&gt;
of the patchcords to monitor their values. In the ''Watchpoints''&lt;br /&gt;
window, you should see how different values in the grain settings&lt;br /&gt;
in the main patcher translate into values for the synthesis algorithm&lt;br /&gt;
at work here.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=poly~}} object allows you to have a large number of instances&lt;br /&gt;
of a single, simple MSP patcher. You can use {{maxword|name=send}}&lt;br /&gt;
and {{maxword|name=receive}} to communicate to all instances of a {{maxword|name=poly~}}&lt;br /&gt;
abstraction, which can be distributed across multiple cores or&lt;br /&gt;
processors with the &amp;lt;code&amp;gt;parallel&amp;lt;/code&amp;gt; message.&lt;br /&gt;
The {{maxword|name=adstatus}} object allows you to access and change&lt;br /&gt;
aspects of the MSP audio driver; the &amp;lt;code&amp;gt;cpu&amp;lt;/code&amp;gt; argument to the&lt;br /&gt;
object lets you see how much of your computer's CPU you are using&lt;br /&gt;
with a patcher.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=adstatus}} - Report and control audio driver settings&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>