<?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=Arguments_and_Special_Characters_in_Max&amp;feed=atom&amp;action=history</id>
		<title>Arguments and Special Characters in Max - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/index.php?title=Arguments_and_Special_Characters_in_Max&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=Arguments_and_Special_Characters_in_Max&amp;action=history"/>
		<updated>2013-05-24T18:28:55Z</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=Arguments_and_Special_Characters_in_Max&amp;diff=3201&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net: Created page with &quot;==Arguments and Special Characters in Max - $ and #== ===''$'' in a '''message''' box=== The dollar sign (''$'') is a special character which can be used in  a '''message''' b...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=Arguments_and_Special_Characters_in_Max&amp;diff=3201&amp;oldid=prev"/>
				<updated>2012-10-16T03:07:17Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Arguments and Special Characters in Max - $ and #== ===&amp;#039;&amp;#039;$&amp;#039;&amp;#039; in a &amp;#039;&amp;#039;&amp;#039;message&amp;#039;&amp;#039;&amp;#039; box=== The dollar sign (&amp;#039;&amp;#039;$&amp;#039;&amp;#039;) is a special character which can be used in  a &amp;#039;&amp;#039;&amp;#039;message&amp;#039;&amp;#039;&amp;#039; b...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Arguments and Special Characters in Max - $ and #==&lt;br /&gt;
===''$'' in a '''message''' box===&lt;br /&gt;
The dollar sign (''$'') is a special character which can be used in &lt;br /&gt;
a '''message''' box to indicate a changeable argument. When &lt;br /&gt;
the '''message''' box contains a $ and a number in the range 1-9 (such as ''$2'') &lt;br /&gt;
as one of its arguments, that argument will be replaced by the corresponding &lt;br /&gt;
argument in the incoming message before the '''message''' box sends out &lt;br /&gt;
its own message.&lt;br /&gt;
&lt;br /&gt;
When a '''message''' box is triggered without receiving values for all of &lt;br /&gt;
its changeable arguments (for instance, when it is triggered by a ''bang''), &lt;br /&gt;
it uses the most recently received values. The initial value of all changeable &lt;br /&gt;
arguments is 0.&lt;br /&gt;
&lt;br /&gt;
A '''message''' box will not be triggered by a word received in its inlet &lt;br /&gt;
(except for ''bang''), unless the word is preceded by the word ''symbol''. In that &lt;br /&gt;
case, the $1 argument will be replaced.&lt;br /&gt;
&lt;br /&gt;
If you want to use a dollar sign in a message without it &lt;br /&gt;
having this special meaning, you should precede the character with a backslash (\).&lt;br /&gt;
===''$'' in an object box===&lt;br /&gt;
The '''expr''', '''if''', '''sxformat''' and '''vexpr''' objects also use &lt;br /&gt;
the changeable ''$'' arguments. When you use the ''$'' character with &lt;br /&gt;
these objects, it must be followed immediately by the letter ''i'', ''f'', or ''s'', which indicates &lt;br /&gt;
whether the argument is to be replaced by an int, a float, or a symbol.&lt;br /&gt;
&lt;br /&gt;
If a message received in the inlet does not match the type of the changeable &lt;br /&gt;
argument when using these objects (e.g., if an int is received to replace a $f argument), the &lt;br /&gt;
object will try to convert the input to the proper type. The '''expr''' and '''if''' objects&lt;br /&gt;
cannot convert symbols to numbers, so an error message will be printed if a symbol &lt;br /&gt;
is received to replace a $i or $f argument.&lt;br /&gt;
===Using the pound sign (''#'') in objects and '''message''' box objects===&lt;br /&gt;
When you are editing a patcher which will be used as a subpatch within &lt;br /&gt;
another Patcher, '''message''' box objects and most object boxes in the subpatch &lt;br /&gt;
can be given a changeable argument by typing in a pound sign and a number &lt;br /&gt;
(e.g. ''#1'') as an argument. When the subpatch is used inside another &lt;br /&gt;
Patcher, an argument typed into the object box in the Patcher replaces the &lt;br /&gt;
''#'' argument inside the subpatch.&lt;br /&gt;
&lt;br /&gt;
This lets you use typed-in arguments to supply information to '''patcher'''&lt;br /&gt;
objects and abstractions you create just as you with with regular Max objects. &lt;br /&gt;
This ''#1''-style argument is a changeable argument that is replaced by whatever &lt;br /&gt;
number or symbol you type in as the corresponding argument when you use the &lt;br /&gt;
patch as an object inside another patch. You cannot use a changeable argument &lt;br /&gt;
to supply the name of an object itself, but you can use it anywhere inside your&lt;br /&gt;
object as an argument.&lt;br /&gt;
&lt;br /&gt;
You can use a pound sign and a number to provide &lt;br /&gt;
variations on a name as a part of a symbol argument&lt;br /&gt;
(e.g. ''#1_velocity''), but &lt;br /&gt;
''the changeable argument must be the first part of the symbol'' -&lt;br /&gt;
(e.g. ''#1-dial'' will work, but ''dial_#1'' will not). &lt;br /&gt;
&lt;br /&gt;
You can use this technique to create unique names for '''send''' and &lt;br /&gt;
'''receive''' objects in a subpatch (e.g. ''send #1_currentvalue'')&lt;br /&gt;
in order to guarantee that the exchange of messages between objects &lt;br /&gt;
will only happen within a single (local) instance of your subpatch.&lt;br /&gt;
&lt;br /&gt;
If you are opening a patcher file automatically by sending a ''load'' message &lt;br /&gt;
to a '''pcontrol''' object, you can use this method to set values inside the&lt;br /&gt;
patcher being loaded by providing changeable ''#'' arguments as a part of&lt;br /&gt;
the ''load'' message.&lt;br /&gt;
===Unique identifiers - using pound sign zero (''#0'') in objects and '''message''' box objects===&lt;br /&gt;
Using a zero as with the pound sign has a particular and special meaning. &lt;br /&gt;
When used as the beginning of a symbol argument (e.g., ''#0_value'') &lt;br /&gt;
it transforms that argument into an identifier that is unique to each &lt;br /&gt;
and every patcher (and its subpatchers) when it is loaded. This special &lt;br /&gt;
usage lets you open multiple copies of a patcher that contains objects like&lt;br /&gt;
'''send''' and '''receive''' while having the send and receive destinations&lt;br /&gt;
remain separate for each copy of the patcher.&lt;br /&gt;
''Note: the numbering of these unique identifiers is done by Max itself, and is&lt;br /&gt;
not under user control''.&lt;br /&gt;
==Symbols and name spaces in Max==&lt;br /&gt;
Max uses a ''global name space'' - Max objects that have names &lt;br /&gt;
associated with them for collections of data (such as '''coll''', &lt;br /&gt;
'''table''', or '''buffer~''') or objects that specify named&lt;br /&gt;
sources or destinations (such as '''send''' and '''receive''') share&lt;br /&gt;
data. This allows you to share data between subpatches and abstractions&lt;br /&gt;
in Max patch, or to share data between Max for Live devices (in the&lt;br /&gt;
case of Max for Live devices, the name space is shared, but the &amp;quot;signal&lt;br /&gt;
processing space&amp;quot; is separate; each Max for Live device processes&lt;br /&gt;
its audio or data separately).&lt;br /&gt;
&lt;br /&gt;
If you want a named object to be unique to a device, use three dashes (---) to &lt;br /&gt;
start the name of your '''buffer''' or '''send'''/'''receive''' destination.&lt;br /&gt;
&lt;br /&gt;
[[Category:MaxTopics]]&lt;/div&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	</feed>