<?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_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;feed=atom&amp;action=history</id>
		<title>MSP MIDI Tutorial 1: Mapping MIDI to MSP - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;action=history"/>
		<updated>2013-05-18T12:51:33Z</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_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=916&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 16:13, 6 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=916&amp;oldid=prev"/>
				<updated>2012-07-06T16:13: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:13, 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:01iMappingMIDI.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:01iMappingMIDI.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;===Introduction===&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;===Introduction===&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_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=902&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 15:58, 6 July 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=902&amp;oldid=prev"/>
				<updated>2012-07-06T15:58:41Z</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:58, 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;patch&lt;/del&gt;: [[Media:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;01iMappingMIDItoMSP&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;01iMappingMIDI&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;===Introduction===&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;===Introduction===&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_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=828&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 15:32, 28 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=828&amp;oldid=prev"/>
				<updated>2012-06-28T15:32: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:32, 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: [[01iMappingMIDItoMSP.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;01iMappingMIDItoMSP.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;===Introduction===&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;===Introduction===&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_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=729&amp;oldid=prev</id>
		<title>Admin at 22:53, 24 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=729&amp;oldid=prev"/>
				<updated>2012-06-24T22:53:52Z</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:53, 24 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;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;chapter name=&amp;quot;MSP MIDI Tutorial 1: Mapping MIDI to MSP&amp;quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&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;Click here to open the tutorial patch: [[01iMappingMIDItoMSP.maxpat]]&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;Click here to open the tutorial patch: [[01iMappingMIDItoMSP.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;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=728&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;&lt;chapter name=&quot;MSP MIDI Tutorial 1: Mapping MIDI to MSP&quot;&gt; Click here to open the tutorial patch: 01iMappingMIDItoMSP.maxpat  ===Introduction===  In this group of tutorials...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_MIDI_Tutorial_1:_Mapping_MIDI_to_MSP&amp;diff=728&amp;oldid=prev"/>
				<updated>2012-06-24T22:53:27Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;chapter name=&amp;quot;MSP MIDI Tutorial 1: Mapping MIDI to MSP&amp;quot;&amp;gt; Click here to open the tutorial patch: &lt;a href=&quot;/wiki/index.php?title=01iMappingMIDItoMSP.maxpat&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;01iMappingMIDItoMSP.maxpat (page does not exist)&quot;&gt;01iMappingMIDItoMSP.maxpat&lt;/a&gt;  ===Introduction===  In this group of tutorials...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;chapter name=&amp;quot;MSP MIDI Tutorial 1: Mapping MIDI to MSP&amp;quot;&amp;gt;&lt;br /&gt;
Click here to open the tutorial patch: [[01iMappingMIDItoMSP.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
In this group of tutorials, we'll look at different strategies for integrating&lt;br /&gt;
MIDI control into MSP patchers. Commercial hardware synthesizers and samplers&lt;br /&gt;
typically implement MIDI in some form or another in fairly standardized ways;&lt;br /&gt;
software systems that mimic these devices (such as Max patches) can use all&lt;br /&gt;
the same routing and mapping systems to successfully control our sound-producing&lt;br /&gt;
systems with MIDI controllers.&lt;br /&gt;
&lt;br /&gt;
A review of the tutorials that cover&lt;br /&gt;
&amp;lt;link type=&amp;quot;tutorial&amp;quot; module=&amp;quot;max&amp;quot; name=&amp;quot;midichapter01&amp;quot;&amp;gt;MIDI objects&amp;lt;/link&amp;gt;&lt;br /&gt;
in Max may be useful before reading these tutorials.&lt;br /&gt;
&lt;br /&gt;
* To use the tutorial patchers in this section of the tutorial, make sure you&lt;br /&gt;
have a correctly configured MIDI controller connected to your computer. The&lt;br /&gt;
tutorials in this section use a variety of MIDI messages as example input; if&lt;br /&gt;
your controller lacks any of these features, you can simulate their input with&lt;br /&gt;
user interface objects in the tutorial.&lt;br /&gt;
&lt;br /&gt;
===MIDI, Redux===&lt;br /&gt;
&lt;br /&gt;
The MIDI standard was developed to enable the control of electronic music devices&lt;br /&gt;
through the use of a simple serial communications standard that would be easy to&lt;br /&gt;
implement on any platform and could be used by anyone. As music performance&lt;br /&gt;
equipment has evolved in the 25 years since, MIDI has remained a standard-issue&lt;br /&gt;
interface protocol for nearly all music-making equipment, whether we're talking&lt;br /&gt;
about hardware or software. Whether you're interested in routing a keyboard,&lt;br /&gt;
slider box, or software sequencer in Max, you need to deal with translating&lt;br /&gt;
MIDI messages into numbers that make sense for MSP.&lt;br /&gt;
&lt;br /&gt;
* Take a look at the tutorial patcher. The patcher logic consists of an FM synthesis&lt;br /&gt;
abstraction called &amp;lt;code&amp;gt;simpleFM~&amp;lt;/code&amp;gt; controlled by a number of signal objects, the&lt;br /&gt;
values of which are set by floating-point {{maxword|name=number}} boxes. Turn on the &lt;br /&gt;
audio in the patcher by clicking on the {{maxword|name=ezdac~}} object and turn &lt;br /&gt;
up the {{maxword|name=gain~}} slider. Familiarize yourself with the&lt;br /&gt;
way the audio portion of the patcher works by trying different values is in&lt;br /&gt;
the {{maxword|name=number}} boxes labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; through &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Our patcher uses frequency modulation synthesis as we looked at earlier in the&lt;br /&gt;
tutorials, with the addition of a circuit that provides ''vibrato'' to the&lt;br /&gt;
main frequency of the synthesizer. The {{maxword|name=cycle~}} object labeled &amp;lt;code&amp;gt;Vibrato rate&amp;lt;/code&amp;gt;&lt;br /&gt;
is scaled by the &amp;lt;code&amp;gt;Vibrato depth&amp;lt;/code&amp;gt; control to oscillate the main frequency (the&lt;br /&gt;
output of the {{maxword|name=line~}} object on the right of the patcher. Unlike a vibrato circuit&lt;br /&gt;
which ''adds'' the output of a modulating oscillator to a constant frequency, this&lt;br /&gt;
patcher logic ''multiplies'' the constant frequency by the output of the oscillator&lt;br /&gt;
treated as an exponent by the {{maxword|name=pow~}} object. A vibrato depth of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;,&lt;br /&gt;
therefore, has the equivalent of turning off the vibrato (raising &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to&lt;br /&gt;
any power yields &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, which leaves our main frequency untouched). A depth&lt;br /&gt;
of &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; scales the {{maxword|name=cycle~}} object to the range of &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt;,&lt;br /&gt;
scaling the main frequency up and down by an octave.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Octave bend&amp;lt;/code&amp;gt; value on the left allows us to use a value as a&lt;br /&gt;
frequency multiplier in a range where each unit of value transposes the&lt;br /&gt;
pitch by an octave. Like the vibrato circuit, it uses an exponential&lt;br /&gt;
scaling logic; a value of &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; as the bend amount raises &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; to&lt;br /&gt;
the power of &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt;, yielding a multiplier of &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; for the frequency.&lt;br /&gt;
An octave bend of &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; yields a multiple of &amp;lt;code&amp;gt;2.&amp;lt;/code&amp;gt;; a bend of &amp;lt;code&amp;gt;-1.&amp;lt;/code&amp;gt;&lt;br /&gt;
yields a multiple of &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Scaling MIDI for signal control===&lt;br /&gt;
&lt;br /&gt;
* Configure a MIDI continuous controller connected to your computer so that&lt;br /&gt;
it sends CC#1 on any MIDI channel (the modulation wheel on a keyboard&lt;br /&gt;
controller is a good candidate for this mapping). From the {{maxword|name=umenu}} object&lt;br /&gt;
labeled &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, select option &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; ('Octave Pitch Bend'). Move your&lt;br /&gt;
controller and listen to and watch the result.&lt;br /&gt;
&lt;br /&gt;
The Max {{maxword|name=ctlin}} object transmits our controller through the {{maxword|name=slider}} object&lt;br /&gt;
in the patcher and from there through a {{maxword|name=scale}} object. The {{maxword|name=gate}} object&lt;br /&gt;
allows us to route the controller to different destination {{maxword|name=number}} boxes&lt;br /&gt;
in the patcher. Notice that, with the default scaling, our MIDI number&lt;br /&gt;
range (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;127&amp;lt;/code&amp;gt;) maps to a floating-point value between &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When working with MIDI messages, the general rule of thumb is that they&lt;br /&gt;
transmit integers which are typically in the range of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;127&amp;lt;/code&amp;gt;.&lt;br /&gt;
While these values make sense within the MIDI domain, when applied to signal&lt;br /&gt;
values these ranges are usually wrong. When we want to control an oscillator,&lt;br /&gt;
we need to think in terms of ''frequency'' (cycles per second or Hz), not&lt;br /&gt;
the ''pitch'' that MIDI note numbers refer to. When thinking about ''amplitude'',&lt;br /&gt;
we might want these numbers scaled between &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; to control the output&lt;br /&gt;
of a {{maxword|name=*~}} object. The {{maxword|name=scale}} object is an important utility object in Max&lt;br /&gt;
for performing these calculations.&lt;br /&gt;
&lt;br /&gt;
* In the {{maxword|name=preset}} object at the right of the patcher, click the first circle.&lt;br /&gt;
The values for the {{maxword|name=scale}} object should change so that the &amp;lt;code&amp;gt;xmin&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;xmax&amp;lt;/code&amp;gt; values read &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;127&amp;lt;/code&amp;gt;; the &amp;lt;code&amp;gt;ymin&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ymax&amp;lt;/code&amp;gt;&lt;br /&gt;
values should read &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2.&amp;lt;/code&amp;gt; Move the MIDI controller and notice the&lt;br /&gt;
difference.&lt;br /&gt;
&lt;br /&gt;
Using the settings controlled by this preset, we can take a MIDI controller&lt;br /&gt;
and use it to give us an octave bend range of two octaves. Setting the&lt;br /&gt;
controller to its lowest value will leave our FM synthesizer untransposed.&lt;br /&gt;
Moving it all the way up will cause the frequency to output two octaves&lt;br /&gt;
higher, at &amp;lt;code&amp;gt;880&amp;lt;/code&amp;gt; Hz.&lt;br /&gt;
&lt;br /&gt;
* Click in the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;ymin&amp;lt;/code&amp;gt; and enter the value of &amp;lt;code&amp;gt;-2.&amp;lt;/code&amp;gt;&lt;br /&gt;
Move your MIDI controller and notice the difference.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=scale}} object can map any range to any other range, including&lt;br /&gt;
negative values. Now our controller leaves the synthesizer untransposed in&lt;br /&gt;
the ''middle'' of its range; moving it downwards and upwards gives us&lt;br /&gt;
two octaves of shift in either direction.&lt;br /&gt;
&lt;br /&gt;
* Click the other {{maxword|name=preset}} states available and try them out; each one&lt;br /&gt;
contains a different mapping and routing:&lt;br /&gt;
&lt;br /&gt;
1 - Octave Pitch Bend. The controller outputs values from &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2 - Vibrato Rate. The controller outputs values from &amp;lt;code&amp;gt;2.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt;, inverting&lt;br /&gt;
the scaling so that it runs from high to low.&lt;br /&gt;
&lt;br /&gt;
3 - Vibrato Depth. The controller scales its input to run from &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4 - Modulation Index. The MIDI gets scaled from &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;20.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5 - Amplitude. The MIDI goes from &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; with an ''exponential scaling'' factor of &amp;lt;code&amp;gt;1.06&amp;lt;/code&amp;gt;. Using this value means that upper values of the MIDI range control a wider part of the mapping than lower values.&lt;br /&gt;
&lt;br /&gt;
Notice that different MSP parameters in our patch require different scalings,&lt;br /&gt;
none of which directly correspond to the default values of MIDI controllers.&lt;br /&gt;
&lt;br /&gt;
* In patcher area &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, look at the {{maxword|name=number}} boxes below the&lt;br /&gt;
{{maxword|name=notein}} object. Play some notes on a MIDI keyboard connected to&lt;br /&gt;
your computer.&lt;br /&gt;
&lt;br /&gt;
When dealing with pitch in MIDI values, a utility Max object called {{maxword|name=mtof}} allows&lt;br /&gt;
us to convert directly to frequency. The {{maxword|name=stripnote}} object in this patch is&lt;br /&gt;
necessary to prevent double-triggering of values due to the note-off events&lt;br /&gt;
generated by the keyboard. Notice that because our MSP synth in this patch is&lt;br /&gt;
monophonic, only one note can be sounded at a time.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Working with MIDI controllers within the Max environment is extremely simple.&lt;br /&gt;
Using these values with MSP patches requires an understanding of how to ''map'' the&lt;br /&gt;
MIDI values appropriately for the different parameters of a digital signal&lt;br /&gt;
network. The Max {{maxword|name=scale}} and {{maxword|name=mtof}} objects are incredibly useful&lt;br /&gt;
for performing this function, and allow you to map MIDI input into&lt;br /&gt;
appropriate ranges for any number of applications.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=scale}} - Map an input range of values to an output range&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=mtof}} - Convert a MIDI note number to frequency&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>