https://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&feed=atom&action=history20Concepts Lesson 03 - Messages Part 1 - Revision history2016-12-10T01:12:00ZRevision history for this page on the wikiMediaWiki 1.19.1https://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=4069&oldid=prevCorymetcalf at 01:18, 10 May 20132013-05-10T01:18:46Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 01:18, 10 May 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 58:</td>
<td colspan="2" class="diff-lineno">Line 58:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[[Image:20Concepts-<del class="diffchange diffchange-inline">0301</del>.jpg|border]]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>[[Image:20Concepts-<ins class="diffchange diffchange-inline">0304</ins>.jpg|border]]</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td></tr>
</table>Corymetcalfhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=4068&oldid=prevCorymetcalf: /* Data Types */2013-05-10T01:18:22Z<p>‎<span dir="auto"><span class="autocomment">Data Types</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 01:18, 10 May 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 58:</td>
<td colspan="2" class="diff-lineno">Line 58:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">&lt;patch example&gt;</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[[Image:20Concepts-0301.jpg|border]]</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td></tr>
</table>Corymetcalfhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=4066&oldid=prevCorymetcalf at 01:07, 10 May 20132013-05-10T01:07:45Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 01:07, 10 May 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 48:</td>
<td colspan="2" class="diff-lineno">Line 48:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>If you create a number box, connect it to a print object, then click and drag (in a vertical direction), you'll see that you can rapidly change the value in the number box - and output the data as you step through the number range:</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>If you create a number box, connect it to a print object, then click and drag (in a vertical direction), you'll see that you can rapidly change the value in the number box - and output the data as you step through the number range:</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">&lt;patch example&gt;</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[[Image:20Concepts-0302.jpg|border]]</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>Numbers with decimals are another kind of data: floating point numbers (or floats). These are very similar to integers, but they include decimal as well as whole number components. Many of the objects that work with integers will also work with floating point numbers - as long as you tell them to expect floats. When it comes to user interface objects, though, you need to use a different object: the floating point number box.</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>Numbers with decimals are another kind of data: floating point numbers (or floats). These are very similar to integers, but they include decimal as well as whole number components. Many of the objects that work with integers will also work with floating point numbers - as long as you tell them to expect floats. When it comes to user interface objects, though, you need to use a different object: the floating point number box.</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 54:</td>
<td colspan="2" class="diff-lineno">Line 54:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a floating point number box by selecting it off the palette, or by typing &quot;F&quot; on an unlocked patcher. This object looks almost identical to the integer number box, but it has a &quot;dot&quot; in it to remind us that it is for floating point numbers. It also works somewhat different: it still responds to vertical click-drag movement, but the portion of the number that changes is based on the location of the cursor when you click. If you click (then drag) on the whole number portion, it will increment the whole number portion of the float. But if you click on one of the decimal positions, it will increment that column of the decimal contents.</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a floating point number box by selecting it off the palette, or by typing &quot;F&quot; on an unlocked patcher. This object looks almost identical to the integer number box, but it has a &quot;dot&quot; in it to remind us that it is for floating point numbers. It also works somewhat different: it still responds to vertical click-drag movement, but the portion of the number that changes is based on the location of the cursor when you click. If you click (then drag) on the whole number portion, it will increment the whole number portion of the float. But if you click on one of the decimal positions, it will increment that column of the decimal contents.</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">&lt;patch example&gt;</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[[Image:20Concepts-0303.jpg|border]]</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</div></td></tr>
</table>Corymetcalfhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3890&oldid=prevDdg@cycling74.com at 15:39, 12 April 20132013-04-12T15:39:58Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:39, 12 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 40:</td>
<td colspan="2" class="diff-lineno">Line 40:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a message box by selecting it from the Object Palette, or more conveniently by pressing the letter &quot;M&quot;. This gives you a blank message box - one that contains no symbol at all. If you click inside the message box and type a word (&quot;open&quot;, for example), then click outside the box, you will have stored that word within the message box. Now, connect the message box to a print object, lock the patch and click on the your word. You will see that the symbol is transmitted along the patch cord to the print object, and your word appears in the Max Window. Therefore, the message box not only stores the symbol, it also acts like a button that can send out the symbol as well.</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a message box by selecting it from the Object Palette, or more conveniently by pressing the letter &quot;M&quot;. This gives you a blank message box - one that contains no symbol at all. If you click inside the message box and type a word (&quot;open&quot;, for example), then click outside the box, you will have stored that word within the message box. Now, connect the message box to a print object, lock the patch and click on the your word. You will see that the symbol is transmitted along the patch cord to the print object, and your word appears in the Max Window. Therefore, the message box not only stores the symbol, it also acts like a button that can send out the symbol as well.</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">&lt;patch example&gt;</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[[Image:20Concepts-0301.jpg|border]]</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While symbol data is useful for both information and commands, the heart of Max lives in the use of numbers. The primary number data type (and one that is at the heart of most UI elements) is the integer. Integers are numbers that have no fractional portion, so it includes numbers like 550, 0 and -12. Numbers are important within Max because we use them in so many ways, and often interact with hardware using only integer data. As a result, integers provide a privileged place in the Max World.</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>While symbol data is useful for both information and commands, the heart of Max lives in the use of numbers. The primary number data type (and one that is at the heart of most UI elements) is the integer. Integers are numbers that have no fractional portion, so it includes numbers like 550, 0 and -12. Numbers are important within Max because we use them in so many ways, and often interact with hardware using only integer data. As a result, integers provide a privileged place in the Max World.</div></td></tr>
</table>Ddg@cycling74.comhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3885&oldid=prevDdg@cycling74.com at 02:48, 12 April 20132013-04-12T02:48:49Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 02:48, 12 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 74:</td>
<td colspan="2" class="diff-lineno">Line 74:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Using Messages to Control Objects ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Using Messages to Control Objects ==</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">(Needed: </del>text<del class="diffchange diffchange-inline">)</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">By combining </ins>text <ins class="diffchange diffchange-inline">with other value, we can create messages that will modify and control other objects. Let's take a look at a simple example.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The {{maxword|name=comment}} object has many properties; one of them is the ''fontsize'', which controls the size of the font used for displaying the comment text. You can change this value within the Object Inspector, but you can also change it programmatically using messages. Create the following patch, containing a comment, message box and number box:</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">&lt;patch example&gt;</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">You will notice that we are using the $1 replaceable parameter to create a message containing the symbol &quot;fontsize&quot; followed by the incoming value from the number box. If you click and drag on the number box, you will change the font size without having to use the inspector.</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== ''Web Links'' ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== ''Web Links'' ==</div></td></tr>
</table>Ddg@cycling74.comhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3881&oldid=prevDdg@cycling74.com at 00:37, 11 April 20132013-04-11T00:37:34Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:37, 11 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 66:</td>
<td colspan="2" class="diff-lineno">Line 66:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>However, we can use a special characteristic of the message box to produce variable output based on the contents of incoming message. In order to do this, we have to use a special message formatting device:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>However, we can use a special characteristic of the message box to produce variable output based on the contents of incoming message. In order to do this, we have to use a special message formatting device <ins class="diffchange diffchange-inline">- the replaceable argument ($1)</ins>:</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">&lt;patch example&gt;</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">When a message comes into the message box that has a $1 in it, the object outputs the contained message, but replaces the &quot;$1&quot; entry with the incoming message. Using the patch above, we can see that sending numbers, words or even the bang message produces a message with the incoming value in it.</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Using Messages to Control Objects ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Using Messages to Control Objects ==</div></td></tr>
</table>Ddg@cycling74.comhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3862&oldid=prevDdg@cycling74.com at 00:32, 10 April 20132013-04-10T00:32:07Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 00:32, 10 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 53:</td>
<td colspan="2" class="diff-lineno">Line 53:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a floating point number box by selecting it off the palette, or by typing &quot;F&quot; on an unlocked patcher. This object looks almost identical to the integer number box, but it has a &quot;dot&quot; in it to remind us that it is for floating point numbers. It also works somewhat different: it still responds to vertical click-drag movement, but the portion of the number that changes is based on the location of the cursor when you click. If you click (then drag) on the whole number portion, it will increment the whole number portion of the float. But if you click on one of the decimal positions, it will increment that column of the decimal contents.</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a floating point number box by selecting it off the palette, or by typing &quot;F&quot; on an unlocked patcher. This object looks almost identical to the integer number box, but it has a &quot;dot&quot; in it to remind us that it is for floating point numbers. It also works somewhat different: it still responds to vertical click-drag movement, but the portion of the number that changes is based on the location of the cursor when you click. If you click (then drag) on the whole number portion, it will increment the whole number portion of the float. But if you click on one of the decimal positions, it will increment that column of the decimal contents.</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">&lt;patch example&gt;</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">While we can use the type-specific UI objects to store each of the data types, the message box actually has the ability to store, display and output them all. When a number is entered into a message box, it is understood to be a numeric (integer or floating point) value and output as such. But how do we set the value of a message box with incoming data? This is what the right inlet is for: anything that comes into the right inlet of a message box replaces the current value, and that data is used the next time the message box is clicked (or receives a bang message).</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 58:</td>
<td colspan="2" class="diff-lineno">Line 62:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">(Needed</del>: <del class="diffchange diffchange-inline">text)</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Message boxes have another useful function: they can produce messages when a message is received. If we send any message into the left inlet of a message box, it will output the value that is stored in the message box.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">&lt;patch example&gt;</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">However, we can use a special characteristic of the message box to produce variable output based on the contents of incoming message. In order to do this, we have to use a special message formatting device</ins>:</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Using Messages to Control Objects ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Using Messages to Control Objects ==</div></td></tr>
</table>Ddg@cycling74.comhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3861&oldid=prevDdg@cycling74.com: /* Data Types */2013-04-08T22:38:14Z<p>‎<span dir="auto"><span class="autocomment">Data Types</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 22:38, 8 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 47:</td>
<td colspan="2" class="diff-lineno">Line 47:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>If you create a number box, connect it to a print object, then click and drag (in a vertical direction), you'll see that you can rapidly change the value in the number box - and output the data as you step through the number range:</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>If you create a number box, connect it to a print object, then click and drag (in a vertical direction), you'll see that you can rapidly change the value in the number box - and output the data as you step through the number range:</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">&lt;patch example&gt;</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Numbers with decimals are another kind of data: floating point numbers (or floats). These are very similar to integers, but they include decimal as well as whole number components. Many of the objects that work with integers will also work with floating point numbers - as long as you tell them to expect floats. When it comes to user interface objects, though, you need to use a different object: the floating point number box.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">You create a floating point number box by selecting it off the palette, or by typing &quot;F&quot; on an unlocked patcher. This object looks almost identical to the integer number box, but it has a &quot;dot&quot; in it to remind us that it is for floating point numbers. It also works somewhat different: it still responds to vertical click-drag movement, but the portion of the number that changes is based on the location of the cursor when you click. If you click (then drag) on the whole number portion, it will increment the whole number portion of the float. But if you click on one of the decimal positions, it will increment that column of the decimal contents.</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td></tr>
</table>Ddg@cycling74.comhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3856&oldid=prevDdg@cycling74.com: /* Data Types */2013-04-08T05:37:41Z<p>‎<span dir="auto"><span class="autocomment">Data Types</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 05:37, 8 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 39:</td>
<td colspan="2" class="diff-lineno">Line 39:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a message box by selecting it from the Object Palette, or more conveniently by pressing the letter &quot;M&quot;. This gives you a blank message box - one that contains no symbol at all. If you click inside the message box and type a word (&quot;open&quot;, for example), then click outside the box, you will have stored that word within the message box. Now, connect the message box to a print object, lock the patch and click on the your word. You will see that the symbol is transmitted along the patch cord to the print object, and your word appears in the Max Window. Therefore, the message box not only stores the symbol, it also acts like a button that can send out the symbol as well.</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>You create a message box by selecting it from the Object Palette, or more conveniently by pressing the letter &quot;M&quot;. This gives you a blank message box - one that contains no symbol at all. If you click inside the message box and type a word (&quot;open&quot;, for example), then click outside the box, you will have stored that word within the message box. Now, connect the message box to a print object, lock the patch and click on the your word. You will see that the symbol is transmitted along the patch cord to the print object, and your word appears in the Max Window. Therefore, the message box not only stores the symbol, it also acts like a button that can send out the symbol as well.</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">&lt;patch example&gt;</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">While symbol data is useful for both information and commands, the heart of Max lives in the use of numbers. The primary number data type (and one that is at the heart of most UI elements) is the integer. Integers are numbers that have no fractional portion, so it includes numbers like 550, 0 and -12. Numbers are important within Max because we use them in so many ways, and often interact with hardware using only integer data. As a result, integers provide a privileged place in the Max World.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">You can store or generate integers using a number box object. These are most easily created by typing the &quot;I&quot; key while hovering over the Max work area. An integer number box, like the message box, is used for both storing and producing data. You update the number box's content by sending it a value over a patch cord, or by click-dragging when the patch is locked. This last option is quite efficient, and is one of the unique user-interface controls provided by the Max environment.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">If you create a number box, connect it to a print object, then click and drag (in a vertical direction), you'll see that you can rapidly change the value in the number box - and output the data as you step through the number range:</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>&lt;patch example&gt;</div></td></tr>
</table>Ddg@cycling74.comhttps://cycling74.com/wiki/index.php?title=20Concepts_Lesson_03_-_Messages_Part_1&diff=3838&oldid=prevDdg@cycling74.com: /* Data Types */2013-04-04T03:39:11Z<p>‎<span dir="auto"><span class="autocomment">Data Types</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 03:39, 4 April 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 34:</td>
<td colspan="2" class="diff-lineno">Line 34:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Data Types ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Data Types ==</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">(Needed</del>: text)</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">One of the things that is important to understand about Max is the concept of a &quot;data type&quot; - an indication to the system of what kind of data can be found within any message. Max works with several types of data; in this lesson we will focus on three main types</ins>: <ins class="diffchange diffchange-inline">symbols, integers and floating point numbers.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The bang message tells objects to perform their action, but the contents of a bang message is just a small bit of </ins>text <ins class="diffchange diffchange-inline">called a &quot;symbol&quot;. Within Max, any textual information can be contained within a symbol. So the words &quot;on&quot;, &quot;off&quot;, &quot;read&quot; and &quot;start&quot; (all of which we can find in our previous Vizzie experiments) are all considered symbols within Max. Symbols are seen (and created) within many objects, but the primary object for storing and sending symbols is the message box.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">You create a message box by selecting it from the Object Palette, or more conveniently by pressing the letter &quot;M&quot;. This gives you a blank message box - one that contains no symbol at all. If you click inside the message box and type a word (&quot;open&quot;, for example</ins>)<ins class="diffchange diffchange-inline">, then click outside the box, you will have stored that word within the message box. Now, connect the message box to a print object, lock the patch and click on the your word. You will see that the symbol is transmitted along the patch cord to the print object, and your word appears in the Max Window. Therefore, the message box not only stores the symbol, it also acts like a button that can send out the symbol as well.</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>&#160;</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">&lt;patch example&gt;</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td><td class='diff-marker'>&#160;</td><td style="background: #eee; color:black; font-size: smaller;"><div>== Variables ==</div></td></tr>
</table>Ddg@cycling74.com