<?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_2:_Using_the_poly~_Object&amp;feed=atom&amp;action=history</id>
		<title>MSP Polyphony Tutorial 2: Using the poly~ Object - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_2:_Using_the_poly~_Object&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_2:_Using_the_poly%7E_Object&amp;action=history"/>
		<updated>2013-05-24T16:58:53Z</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_2:_Using_the_poly%7E_Object&amp;diff=918&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 16:14, 6 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_2:_Using_the_poly%7E_Object&amp;diff=918&amp;oldid=prev"/>
				<updated>2012-07-06T16:14:30Z</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:14, 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 patch: [[Media:02hUsingPoly.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 patch &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and files&lt;/ins&gt;: [[Media:02hUsingPoly.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;===A different approach to polyphony===&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;===A different approach to polyphony===&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_2:_Using_the_poly%7E_Object&amp;diff=889&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 22:17, 5 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_2:_Using_the_poly%7E_Object&amp;diff=889&amp;oldid=prev"/>
				<updated>2012-07-05T22:17:36Z</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:17, 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 patch: [[Media:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;02hUsingpoly~&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 patch: [[Media:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;02hUsingPoly&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;===A different approach to polyphony===&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;===A different approach to polyphony===&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_2:_Using_the_poly%7E_Object&amp;diff=832&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_2:_Using_the_poly%7E_Object&amp;diff=832&amp;oldid=prev"/>
				<updated>2012-06-28T15:34:11Z</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: [[02hUsingpoly~.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;02hUsingpoly~.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;===A different approach to polyphony===&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;===A different approach to polyphony===&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_2:_Using_the_poly%7E_Object&amp;diff=735&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;Click here to open the tutorial patch: 02hUsingpoly~.maxpat  ===A different approach to polyphony===  In an earlier MSP tutorial on using &lt;link type=&quot;tutorial&quot; module=&quot;msp...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Polyphony_Tutorial_2:_Using_the_poly%7E_Object&amp;diff=735&amp;oldid=prev"/>
				<updated>2012-06-24T23:03: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=02hUsingpoly%7E.maxpat&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;02hUsingpoly~.maxpat (page does not exist)&quot;&gt;02hUsingpoly~.maxpat&lt;/a&gt;  ===A different approach to polyphony===  In an earlier MSP tutorial on using &amp;lt;link type=&amp;quot;tutorial&amp;quot; module=&amp;quot;msp...&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: [[02hUsingpoly~.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===A different approach to polyphony===&lt;br /&gt;
&lt;br /&gt;
In an earlier MSP tutorial on using&lt;br /&gt;
&amp;lt;link type=&amp;quot;tutorial&amp;quot; module=&amp;quot;msp&amp;quot; name=&amp;quot;midichapter02&amp;quot;&amp;gt;MIDI with MSP&amp;lt;/link&amp;gt; ,&lt;br /&gt;
we demonstrated how to use the {{maxword|name=poly}} object to make polyphonic&lt;br /&gt;
voice assignments in a simple case. This chapter will describe a&lt;br /&gt;
more elegant and efficient way to handle polyphonic voice&lt;br /&gt;
allocation - the {{maxword|name=poly~}} object.&lt;br /&gt;
&lt;br /&gt;
In the example in the previous chapter, we created multiple&lt;br /&gt;
copies of our synthesizer subpatch and used the poly object's&lt;br /&gt;
voice numbering to route messages to different copies of the&lt;br /&gt;
subpatch. Our example could just as easily have used any kind&lt;br /&gt;
of sound-producing subpatch.&lt;br /&gt;
&lt;br /&gt;
* Take a look at the tutorial patcher. Open the {{maxword|name=patcher}} object&lt;br /&gt;
labeled 'thehardway'. The example inside uses the&lt;br /&gt;
subpatch &amp;lt;code&amp;gt;littlesynth~&amp;lt;/code&amp;gt; to implement a simple four-voice&lt;br /&gt;
polyphonic synthesizer:&lt;br /&gt;
[[Image:Polychapter02a.png|border]]&lt;br /&gt;
While this method works, it has two disadvantages. First, there's&lt;br /&gt;
a lot of housekeeping necessary to duplicate and patch the multiple&lt;br /&gt;
copies of &amp;lt;code&amp;gt;littlesynth~&amp;lt;/code&amp;gt; together. But there is also a&lt;br /&gt;
problem in terms of CPU usage. All four copies of&lt;br /&gt;
the &amp;lt;code&amp;gt;littlesynth~&amp;lt;/code&amp;gt; subpatcher are always on, processing their&lt;br /&gt;
audio even when there is no sound being produced.&lt;br /&gt;
&lt;br /&gt;
There is a way to solve this problem - the {{maxword|name=poly~}} object&lt;br /&gt;
allows you to create and manage multiple copies of the same MSP&lt;br /&gt;
subpatch all within one object. You can also control the signal&lt;br /&gt;
processing activity within each copy of the subpatch to conserve&lt;br /&gt;
CPU resources.&lt;br /&gt;
&lt;br /&gt;
===The {{maxword|name=poly~}} object===&lt;br /&gt;
&lt;br /&gt;
* Close the 'thehardway' subpatch and open the {{maxword|name=patcher}} object&lt;br /&gt;
labeled 'simple_poly'. Turn on the audio in the subpatch by&lt;br /&gt;
clicking the &amp;lt;code&amp;gt;startwindow&amp;lt;/code&amp;gt; message to the {{maxword|name=dac~}}. Click&lt;br /&gt;
the {{maxword|name=toggle}} object at the top of the patcher and turn up&lt;br /&gt;
the volume on the {{maxword|name=gain~}} slider.&lt;br /&gt;
The {{maxword|name=poly~}} object takes as its argument the name of a patcher&lt;br /&gt;
file, followed by a number that specifies the number of copies&lt;br /&gt;
(or ''instances'') of the patch to be created. You'll want to&lt;br /&gt;
specify the same number of copies as you would have had to duplicate&lt;br /&gt;
manually when implementing polyphony the old-fashioned way.&lt;br /&gt;
&lt;br /&gt;
* Double-click on the {{maxword|name=poly~}} object. This opens up the&lt;br /&gt;
subpatcher to show you the inside of the &amp;lt;code&amp;gt;littlebeep~&amp;lt;/code&amp;gt; object.&lt;br /&gt;
Let's look at the &amp;lt;code&amp;gt;littlebeep~&amp;lt;/code&amp;gt; patch for a minute. While you&lt;br /&gt;
haven't seen the {{maxword|name=in}}, {{maxword|name=out~}}, or {{maxword|name=thispoly~}} objects&lt;br /&gt;
before, the rest of the patcher is pretty straightforward; it takes&lt;br /&gt;
an incoming MIDI note number, converts it to a frequency value using&lt;br /&gt;
the {{maxword|name=mtof}} object, and outputs a sine wave at that frequency with&lt;br /&gt;
a duration of 140 milliseconds and an amplitude envelope supplied by&lt;br /&gt;
the {{maxword|name=line~}} object for &amp;lt;code&amp;gt;140&amp;lt;/code&amp;gt; ms with an envelope on it.&lt;br /&gt;
&lt;br /&gt;
But what about the {{maxword|name=in}} and {{maxword|name=out~}} objects? Subpatches&lt;br /&gt;
created for use in the {{maxword|name=poly~}} object use special objects for inlets&lt;br /&gt;
and outlets. The objects {{maxword|name=in}} and {{maxword|name=out}} create control inlets&lt;br /&gt;
and outlets, and the {{maxword|name=in~}} and {{maxword|name=out~}} objects create signal&lt;br /&gt;
inlets and outlets. You specify which inlet is assigned to which object&lt;br /&gt;
by adding a number argument to the object - the {{maxword|name=in}} &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; object&lt;br /&gt;
corresponds to the leftmost inlet on the {{maxword|name=poly~}} object, and so on.&lt;br /&gt;
The {{maxword|name=poly~}} object keeps track of the number of inlets and outlets it&lt;br /&gt;
needs to create when you tell it which subpatch to load.&lt;br /&gt;
&lt;br /&gt;
Messages sent to a {{maxword|name=poly~}} object are directed to different&lt;br /&gt;
instances of the subpatch dynamically using the &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;midinote&amp;lt;/code&amp;gt; messages, and manually using the &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
When {{maxword|name=poly~}} receives a &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; message in its left inlet,&lt;br /&gt;
it scans through the copies of the subpatch it has in memory until it&lt;br /&gt;
finds one that is currently not busy, and then passes the message to it.&lt;br /&gt;
A subpatch instance can tell its parent {{maxword|name=poly~}} object that it is&lt;br /&gt;
busy using the {{maxword|name=thispoly~}} object. The {{maxword|name=thispoly~}} object accepts&lt;br /&gt;
either a signal or number in its inlet to set its busy state. A zero signal&lt;br /&gt;
or a value of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; sent to its inlet tells the parent {{maxword|name=poly~}} that&lt;br /&gt;
this instance is available for &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;midinote&amp;lt;/code&amp;gt; messages. A&lt;br /&gt;
non-zero signal or value sent to its inlet tells the parent {{maxword|name=poly~}} that&lt;br /&gt;
the instance is busy; no &amp;lt;code&amp;gt;note&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;midinote&amp;lt;/code&amp;gt; messages will be sent&lt;br /&gt;
to the object until it is no longer busy. The busy state was intended to&lt;br /&gt;
correspond to the duration of a note being played by the subpatcher instance,&lt;br /&gt;
but it could be used to mean anything. In the example above, when the audio&lt;br /&gt;
level out of the {{maxword|name=*~}} is nonzero -- that iteration of the subpatch is&lt;br /&gt;
currently busy. Once the amplitude envelope out of {{maxword|name=line~}} reaches zero&lt;br /&gt;
and the sound stops, that subpatch's copy of {{maxword|name=thispoly~}} tells {{maxword|name=poly~}} that&lt;br /&gt;
it is ready for more input.&lt;br /&gt;
&lt;br /&gt;
===Muting voices===&lt;br /&gt;
&lt;br /&gt;
* Close the 'simple_poly' subpatch and open the {{maxword|name=patcher}} object&lt;br /&gt;
named 'poly_using_mute'. Start it running as you did the last&lt;br /&gt;
patcher, and double-click the {{maxword|name=poly~}} object.&lt;br /&gt;
The {{maxword|name=thispoly~}} object can also control the activity of&lt;br /&gt;
signal processing within each copy of the subpatch. When&lt;br /&gt;
the &amp;lt;code&amp;gt;mute&amp;lt;/code&amp;gt; message is sent to {{maxword|name=thispoly~}} followed by&lt;br /&gt;
a &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, all signal processing in that subpatch stops. When&lt;br /&gt;
a &amp;lt;code&amp;gt;mute 0 &amp;lt;/code&amp;gt;message is received, signal processing starts again.&lt;br /&gt;
&lt;br /&gt;
In this patcher, we've rewriten the &amp;lt;code&amp;gt;littlebeep~&amp;lt;/code&amp;gt; subpatcher&lt;br /&gt;
to take advantage of this by turning off signal processing when a&lt;br /&gt;
note is finished and turning it on again when a new event is&lt;br /&gt;
received. While this doesn't change the function of the patch,&lt;br /&gt;
it would be more efficient, since the amount of CPU allocated is&lt;br /&gt;
always based on the number of notes currently sounding.&lt;br /&gt;
&lt;br /&gt;
===Targeting individual voices===&lt;br /&gt;
&lt;br /&gt;
* Close the 'poly_using_mute' subpatch and open the one&lt;br /&gt;
named 'poly_using_target'. Start the program and examine the&lt;br /&gt;
patcher logic both inside and outside the {{maxword|name=poly~}} object.&lt;br /&gt;
Another way to allocate events using {{maxword|name=poly~}} is through&lt;br /&gt;
the &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; message. Sending a &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; message followed&lt;br /&gt;
by an integer in the left inlet of a {{maxword|name=poly~}} subpatch&lt;br /&gt;
tells {{maxword|name=poly~}} to send all subsequent messages to that instance&lt;br /&gt;
of the subpatch. You can then use {{maxword|name=poly~}} in conjunction with&lt;br /&gt;
the {{maxword|name=poly}} object to create a MIDI synthesizer.&lt;br /&gt;
&lt;br /&gt;
In this example {{maxword|name=patcher}}, pairs of incoming MIDI pitches&lt;br /&gt;
and velocities are used to synthesize a sine tone. When a list&lt;br /&gt;
is received, the subpatcher sends a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; to {{maxword|name=thispoly~}},&lt;br /&gt;
causing it to output the instance or voice number. In our tutorial&lt;br /&gt;
patcher, the voice number is sent out an outlet so you can watch it&lt;br /&gt;
from the parent patch.&lt;br /&gt;
&lt;br /&gt;
In the parent patch the {{maxword|name=poly}} object assigns voice&lt;br /&gt;
numbers to MIDI pitch/velocity pairs output by {{maxword|name=makenote}}.&lt;br /&gt;
The voice number from the {{maxword|name=poly}} object is sent to {{maxword|name=poly~}}&lt;br /&gt;
with the &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; message prepended to it, telling {{maxword|name=poly~}}&lt;br /&gt;
to send subsequent data to the instance of the &amp;lt;code&amp;gt;targetbeep~&amp;lt;/code&amp;gt;&lt;br /&gt;
subpatcher specified by {{maxword|name=poly~}}. When a new note is generated,&lt;br /&gt;
the target will change. Since {{maxword|name=poly}} keeps track of note-offs,&lt;br /&gt;
it should recycle voices properly. The second outlet of {{maxword|name=poly~}} reports&lt;br /&gt;
the voice that last received a message -- it should be the same as&lt;br /&gt;
the voice number output by {{maxword|name=poly}}, since we're using {{maxword|name=poly}} to&lt;br /&gt;
specify a specific target.&lt;br /&gt;
&lt;br /&gt;
===Using {{maxword|name=poly~}} for audio processing.===&lt;br /&gt;
&lt;br /&gt;
* Close the 'poly_using_target' patcher and open the one&lt;br /&gt;
named 'poly_using_signal_input'. Turn on the audio by clicking the {{maxword|name=ezdac~}} object, raise&lt;br /&gt;
the {{maxword|name=gain~}} slider, and start the {{maxword|name=metro}} by clicking&lt;br /&gt;
the {{maxword|name=toggle}} object. Change the value in the rightmost inlet&lt;br /&gt;
from &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;50.&amp;lt;/code&amp;gt; and listen to the result.&lt;br /&gt;
The floating-point {{maxword|name=number}} box can be used to specify&lt;br /&gt;
parameters to specific instances of a {{maxword|name=poly~}} subpatcher.&lt;br /&gt;
By connecting a {{maxword|name=loadbang}} object to {{maxword|name=thispoly~}}, we&lt;br /&gt;
can use the voice number to control the center frequency of a filter.&lt;br /&gt;
&lt;br /&gt;
* Open the &amp;lt;code&amp;gt;littlefilter~&amp;lt;/code&amp;gt; subpatch by double-clicking&lt;br /&gt;
the {{maxword|name=poly~}} object.&lt;br /&gt;
The &amp;lt;code&amp;gt;littlefilter~&amp;lt;/code&amp;gt; abstraction uses the voice number&lt;br /&gt;
from {{maxword|name=thispoly~}} and multiplies it by the base frequency&lt;br /&gt;
received in the second inlet. The incoming signal is filtered&lt;br /&gt;
by all sixteen instances simultaneously, with the output amplitude&lt;br /&gt;
of each instance being controlled by an integer coming into the&lt;br /&gt;
first inlet.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=metro}} object in the main patcher is hooked up to both&lt;br /&gt;
a {{maxword|name=counter}} and a {{maxword|name=random}}. The {{maxword|name=counter}}, which&lt;br /&gt;
feeds the &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; message, cycles through the 16 voices&lt;br /&gt;
of &amp;lt;code&amp;gt;littlefilter~&amp;lt;/code&amp;gt; loaded into the {{maxword|name=poly~}} object,&lt;br /&gt;
supplying each with a random number which is used to control the&lt;br /&gt;
amplitude of that voice.&lt;br /&gt;
&lt;br /&gt;
A signal connected to an inlet of {{maxword|name=poly~}} will be sent&lt;br /&gt;
to the corresponding {{maxword|name=in~}} objects of all subpatcher&lt;br /&gt;
instances, so the {{maxword|name=noise~}} object in the example&lt;br /&gt;
above feeds noise to all the subpatchers inside the {{maxword|name=poly~}}.&lt;br /&gt;
The second inlet (which corresponds to the {{maxword|name=in}} &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; box&lt;br /&gt;
in the subpatcher) controls the base frequency of the filters.&lt;br /&gt;
Note that for the frequency to get sent to all {{maxword|name=poly~}}&lt;br /&gt;
iterations it is preceded by a &amp;lt;code&amp;gt;target 0&amp;lt;/code&amp;gt; message. You&lt;br /&gt;
can open a specific instance of a {{maxword|name=poly~}} subpatch by&lt;br /&gt;
giving the object the &amp;lt;code&amp;gt;open&amp;lt;/code&amp;gt; message, followed by the&lt;br /&gt;
voice you want to look at.&lt;br /&gt;
&lt;br /&gt;
* Open voice &amp;lt;code&amp;gt;15&amp;lt;/code&amp;gt; of the &amp;lt;code&amp;gt;littlefilter~&amp;lt;/code&amp;gt; abstraction&lt;br /&gt;
by typing that number in to the {{maxword|name=number}} box attached&lt;br /&gt;
to the &amp;lt;code&amp;gt;open&amp;lt;/code&amp;gt; message. The patcher assigned to voice&lt;br /&gt;
number 15 should look like this:&lt;br /&gt;
[[Image:Polychapter02b.png|border]]&lt;br /&gt;
As you can see, the base frequency of this particular iteration&lt;br /&gt;
of &amp;lt;code&amp;gt;littlefilter~&amp;lt;/code&amp;gt; is 1500. Hz, which is the multiple of&lt;br /&gt;
the voice number (15) with the most recently entered base frequency&lt;br /&gt;
into the second inlet (100. Hz).&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=poly~}} is a powerful way to manage multiple copies of the same&lt;br /&gt;
subpatch for polyphonic voice allocation. The {{maxword|name=thispoly~}} object works&lt;br /&gt;
inside a subpatch to control its busy state and turn signal processing on&lt;br /&gt;
and off. The objects {{maxword|name=in}}, {{maxword|name=in~}}, {{maxword|name=out}}, and {{maxword|name=out~}} create&lt;br /&gt;
special control and signal inputs and outputs that work with the inlets and&lt;br /&gt;
outlets of the {{maxword|name=poly~}} object.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=poly~}} - Polyphony/DSP manager for patchers&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=thispoly~}} - Control {{maxword|name=poly~}} voice allocation and muting&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=in}} - Message input for a patcher loaded by {{maxword|name=poly~}}&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=in~}} - Signal input for a patcher loaded by {{maxword|name=poly~}}&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=out}} - Message output for a patcher loaded by {{maxword|name=poly~}}&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=out~}} - Signal output for a patcher loaded by {{maxword|name=poly~}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>