<?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/api.php?action=feedcontributions&amp;user=Admin&amp;feedformat=atom</id>
		<title>Cycling '74 Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/api.php?action=feedcontributions&amp;user=Admin&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=Special:Contributions/Admin"/>
		<updated>2013-05-19T01:39:33Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=colorpicker</id>
		<title>colorpicker</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=colorpicker"/>
				<updated>2012-11-14T18:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==[//www.cycling74.com/docs/max6/dynamic/c74_docs.html#colorpicker colorpicker online refpage]==&lt;br /&gt;
&lt;br /&gt;
==Using the {{maxword|name=colorpicker}} object==&lt;br /&gt;
&lt;br /&gt;
=={{maxword|name=colorpicker}} Tutorials==&lt;br /&gt;
&lt;br /&gt;
=={{maxword|name=colorpicker}} Tips and Workarounds==&lt;br /&gt;
&lt;br /&gt;
==Third-Party Max externals similar to the {{maxword|name=colorpicker}} object==&lt;br /&gt;
&lt;br /&gt;
[//www.maxobjects.com/?request=colorpicker Maxobjects.com listing for the colorpicker object]&lt;br /&gt;
&lt;br /&gt;
==People who looked at/used this object also looked at....==&lt;br /&gt;
&lt;br /&gt;
==Errors or Clarifications==&lt;br /&gt;
&lt;br /&gt;
(please list things that you believe to be errors or omissions from the existing refpage)&lt;br /&gt;
&lt;br /&gt;
[[Category:Max Refpage extensions ( symbol, A - F)]]&lt;br /&gt;
[[Category:Refpage extensions]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=colorpicker</id>
		<title>colorpicker</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=colorpicker"/>
				<updated>2012-11-14T18:59:06Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: jus testing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==[//www.cycling74.com/docs/max6/dynamic/c74_docs.html#colorpicker colorpicker online refpage]==&lt;br /&gt;
&lt;br /&gt;
==Using the {{maxword|name=colorpicker}} object==&lt;br /&gt;
&lt;br /&gt;
=={{maxword|name=colorpicker}} Tutorials==&lt;br /&gt;
&lt;br /&gt;
=={{maxword|name=colorpicker}} Tips and Workarounds==&lt;br /&gt;
&lt;br /&gt;
==Third-Party Max externals similar to the {{maxword|name=colorpicker}} object==&lt;br /&gt;
&lt;br /&gt;
[//www.maxobjects.com/?request=colorpicker Maxobjects.com listing for the colorpicker object]&lt;br /&gt;
&lt;br /&gt;
==People who looked at/used this object also looked at....==&lt;br /&gt;
&lt;br /&gt;
==Errors or Clarifications==&lt;br /&gt;
&lt;br /&gt;
(please list things that you believe to be errors or omissions from the existing refpage)&lt;br /&gt;
&lt;br /&gt;
[[Category:Max Refpage extensions ( symbol, A - F)]]&lt;br /&gt;
[[Category:Refpage extensions]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://www.google.ca GOOoooOOgle]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:04hAudioRateControl.maxpat</id>
		<title>File:04hAudioRateControl.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:04hAudioRateControl.maxpat"/>
				<updated>2012-06-26T14:35:00Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: uploaded a new version of &amp;amp;quot;File:04hAudioRateControl.maxpat&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:06sRecordPlayAIFFFiles.maxpat</id>
		<title>File:06sRecordPlayAIFFFiles.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:06sRecordPlayAIFFFiles.maxpat"/>
				<updated>2012-06-26T14:35:00Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:05yFMSynthesis.maxpat</id>
		<title>File:05yFMSynthesis.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:05yFMSynthesis.maxpat"/>
				<updated>2012-06-26T14:35:00Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:05sWaveshapingSynthesis.maxpat</id>
		<title>File:05sWaveshapingSynthesis.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:05sWaveshapingSynthesis.maxpat"/>
				<updated>2012-06-26T14:35:00Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:04hAudioRateControl.maxpat</id>
		<title>File:04hAudioRateControl.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:04hAudioRateControl.maxpat"/>
				<updated>2012-06-26T14:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:04mRoutingSignals.maxpat</id>
		<title>File:04mRoutingSignals.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:04mRoutingSignals.maxpat"/>
				<updated>2012-06-26T14:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:04sVariableLengthWavetable.maxpat</id>
		<title>File:04sVariableLengthWavetable.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:04sVariableLengthWavetable.maxpat"/>
				<updated>2012-06-26T14:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:04yVibratoAndFM.maxpat</id>
		<title>File:04yVibratoAndFM.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:04yVibratoAndFM.maxpat"/>
				<updated>2012-06-26T14:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:05fParallelFilters.maxpat</id>
		<title>File:05fParallelFilters.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:05fParallelFilters.maxpat"/>
				<updated>2012-06-26T14:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:04fSubtractiveSynthesis.maxpat</id>
		<title>File:04fSubtractiveSynthesis.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:04fSubtractiveSynthesis.maxpat"/>
				<updated>2012-06-26T14:32:25Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03yAmplitudeModulation.maxpat</id>
		<title>File:03yAmplitudeModulation.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03yAmplitudeModulation.maxpat"/>
				<updated>2012-06-26T14:32:25Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03sSamplePlaybackWithLoops.maxpat</id>
		<title>File:03sSamplePlaybackWithLoops.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03sSamplePlaybackWithLoops.maxpat"/>
				<updated>2012-06-26T14:32:25Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03qMSPandITM.maxpat</id>
		<title>File:03qMSPandITM.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03qMSPandITM.maxpat"/>
				<updated>2012-06-26T14:32:25Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03nDistortion.maxpat</id>
		<title>File:03nDistortion.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03nDistortion.maxpat"/>
				<updated>2012-06-26T14:32:25Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02yTremoloAndRingMod.maxpat</id>
		<title>File:02yTremoloAndRingMod.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02yTremoloAndRingMod.maxpat"/>
				<updated>2012-06-26T14:30:50Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03fAnalogStyleSynthesis.maxpat</id>
		<title>File:03fAnalogStyleSynthesis.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03fAnalogStyleSynthesis.maxpat"/>
				<updated>2012-06-26T14:30:49Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03hGranularSynthesis.maxpat</id>
		<title>File:03hGranularSynthesis.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03hGranularSynthesis.maxpat"/>
				<updated>2012-06-26T14:30:49Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03iMIDISampler.maxpat</id>
		<title>File:03iMIDISampler.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03iMIDISampler.maxpat"/>
				<updated>2012-06-26T14:30:49Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:03mWavetableOscillator.maxpat</id>
		<title>File:03mWavetableOscillator.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:03mWavetableOscillator.maxpat"/>
				<updated>2012-06-26T14:30:49Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02sPlayingFromMultiplePoints.maxpat</id>
		<title>File:02sPlayingFromMultiplePoints.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02sPlayingFromMultiplePoints.maxpat"/>
				<updated>2012-06-26T14:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02qBufferSequencing.maxpat</id>
		<title>File:02qBufferSequencing.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02qBufferSequencing.maxpat"/>
				<updated>2012-06-26T14:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02nDynamicsProcessing.maxpat</id>
		<title>File:02nDynamicsProcessing.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02nDynamicsProcessing.maxpat"/>
				<updated>2012-06-26T14:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02mAdjustableOscillator.maxpat</id>
		<title>File:02mAdjustableOscillator.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02mAdjustableOscillator.maxpat"/>
				<updated>2012-06-26T14:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02iMIDISynthesizer.maxpat</id>
		<title>File:02iMIDISynthesizer.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02iMIDISynthesizer.maxpat"/>
				<updated>2012-06-26T14:29:29Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01qAudioRateSequencing.maxpat</id>
		<title>File:01qAudioRateSequencing.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01qAudioRateSequencing.maxpat"/>
				<updated>2012-06-26T14:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01sRecordAndPlaySamples.maxpat</id>
		<title>File:01sRecordAndPlaySamples.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01sRecordAndPlaySamples.maxpat"/>
				<updated>2012-06-26T14:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01yAdditiveSynthesis.maxpat</id>
		<title>File:01yAdditiveSynthesis.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01yAdditiveSynthesis.maxpat"/>
				<updated>2012-06-26T14:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02fVariableTypeFilters.maxpat</id>
		<title>File:02fVariableTypeFilters.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02fVariableTypeFilters.maxpat"/>
				<updated>2012-06-26T14:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:02hUsingpoly%7E.maxpat</id>
		<title>File:02hUsingpoly~.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:02hUsingpoly%7E.maxpat"/>
				<updated>2012-06-26T14:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01nEnvelopeFollowing.maxpat</id>
		<title>File:01nEnvelopeFollowing.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01nEnvelopeFollowing.maxpat"/>
				<updated>2012-06-26T14:27:39Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01mTestTone.maxpat</id>
		<title>File:01mTestTone.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01mTestTone.maxpat"/>
				<updated>2012-06-26T14:27:39Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01iMappingMIDItoMSP.maxpat</id>
		<title>File:01iMappingMIDItoMSP.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01iMappingMIDItoMSP.maxpat"/>
				<updated>2012-06-26T14:27:38Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01hTurningSignalsOn-Off.maxpat</id>
		<title>File:01hTurningSignalsOn-Off.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01hTurningSignalsOn-Off.maxpat"/>
				<updated>2012-06-26T14:27:38Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=File:01fSimpleFilters.maxpat</id>
		<title>File:01fSimpleFilters.maxpat</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=File:01fSimpleFilters.maxpat"/>
				<updated>2012-06-26T14:27:38Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_4:_Subtractive_Synthesis</id>
		<title>MSP Filter Tutorial 4: Subtractive Synthesis</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_4:_Subtractive_Synthesis"/>
				<updated>2012-06-25T21:19:47Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[04fSubtractiveSynthesis.maxpat]]		&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we'll look at using filters creatively with a group of MSP audio generators that create different kinds of {{maxword|name=noise~}}. Noise generation is a core component of ''subtractive synthesis'', a sound design methodology that works by taking complex signsl and sculpting them with filters, subtracting energy from the original signal (compare this with additive synthesis, which works in the opposite fashion). Along the way, we'll discuss ways to shape this noise using an object that creates and controls a ''bank'' of parallel filters.&lt;br /&gt;
&lt;br /&gt;
===Noise===&lt;br /&gt;
&lt;br /&gt;
Take a look at our tutorial patcher. It consists of three patcher regions. If we look at the area labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, we can see that we have three new MSP objects connected through {{maxword|name=*~}} objects to the {{maxword|name=dac~}}.&lt;br /&gt;
&lt;br /&gt;
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. Adjust the {{maxword|name=number}} box that controls the volume for the {{maxword|name=noise~}} object and listen to the result. Turn it down and turn up the volume for the {{maxword|name=pink~}} object. Do the same for the {{maxword|name=rand~}} object. Click in the {{maxword|name=number}} box that is connected to the inlet of the {{maxword|name=rand~}} object (labeled 'Frequency'). Type &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; and hit return. Try &amp;lt;code&amp;gt;1000&amp;lt;/code&amp;gt; and hit return.Experiment with other values.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=noise~}}, {{maxword|name=pink~}}, and {{maxword|name=rand~}} objects all generate ''noise'' at a signal rate. Noise, at its essence, is a type of random number generation; as a result, these objects behave in a similar manner to Max objects such as {{maxword|name=random}} and {{maxword|name=drunk}}.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=noise~}} object generates ''white noise'', which means that all possible frequencies in the audio spectrum are equally represented over time. The process of generating white noise digitally is quite simple: every sample, pick a random number between &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter04a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A waveform and spectrogram plot of white noise.''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=pink~}} object generates ''pink noise'', which means that every ''octave'' in the audio spectrum has equal weight. This is sometimes referred to as ''1/f'' noise, as the probability of a frequency occuring is the inverse of its value, e.g. frequencies of 100 Hz are twice as probable as 200 Hz. The aural difference between the two is fairly obvious: white noise has far more high frequency content and sounds 'harsher' than pink noise:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter04b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Pink (1/f) noise: waveform and spectrogram.''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=rand~}} object is a random number generator that generates a signal, picking a new random value for that signal at a variable rate. It takes an argument (or a value at its inlet) to set the frequency of the random number selection. A frequency of &amp;lt;code&amp;gt;44100&amp;lt;/code&amp;gt; makes the object indistinguishable from white noise. This allows us to create ''band-limited'' noise that has an upper boundary we can specify:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter04c.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A {{maxword|name=rand~}} object picking values at &amp;lt;code&amp;gt;1000&amp;lt;/code&amp;gt; Hz: waveform and spectrogram.''&lt;br /&gt;
&lt;br /&gt;
===Filtering noise===&lt;br /&gt;
&lt;br /&gt;
Because noise has such broadband frequency content, it can be filtered and sculpted to create very precise timbres. The compositional technique of subtractive synthesis relies on this attribute of noise generation; it's often easier (or more efficient) to start with noise and filter it down then attempt to create the desired timbre through adding oscillators.&lt;br /&gt;
&lt;br /&gt;
* Turn down the volumes in patcher area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and take a look at patcher area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. Turn up the volume using the {{maxword|name=number}} box at the bottom of the signal chain (controlling the {{maxword|name=*~}} object connected to the {{maxword|name=dac~}}). Click in the {{maxword|name=number}} box labeled 'Frequency' connected to the {{maxword|name=phasor~}} object, type &amp;lt;code&amp;gt;0.1&amp;lt;/code&amp;gt; and hit return. Type a higher frequency (e.g. &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt;) and hit return. Experiment with different values.&lt;br /&gt;
&lt;br /&gt;
Patcher area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; contains a {{maxword|name=noise~}} object sending its signal into a {{maxword|name=lores~}} filter. The frequency of the lowpass filter is being modulated by a {{maxword|name=phasor~}}, which we've scaled to ramp between &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;600&amp;lt;/code&amp;gt; at the frequency we specify. As a result, the cutoff frequency of the filter 'sweeps' at regular intervals. This is an example of an ''LFO'', or ''low-frequency oscillator'', being used to modulate a parameter of an audio processing system. As you can hear, the {{maxword|name=lores~}} object attenuates the high frequencies output from the {{maxword|name=noise~}} object. In addition, the resonance value of the {{maxword|name=lores~}} causes the filter to have a peak just below its cutoff frequency, giving a notably 'pitched' sound to the filtered noise.&lt;br /&gt;
&lt;br /&gt;
===Banks of filters===&lt;br /&gt;
&lt;br /&gt;
* Turn down the volume on area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; in the tutorial patcher and take a look at area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;. One-by-one, turn up and down the {{maxword|name=gain~}} sliders connected to the {{maxword|name=dac~}} object.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=fffb~}} object stands for ''Fast, Fixed, Filter Bank''. Unlike the {{maxword|name=cascade~}} object, which implements a number of {{maxword|name=biquad~}} filters in series, the {{maxword|name=fffb~}} object arranges a number of {{maxword|name=reson~}} objects in ''parallel'', which is to say that the settings of one filter will not affect any of the others. The {{maxword|name=fffb~}} object takes a number of arguments which set its behavior: the ''number'' of filters, the ''base frequency'' of the filter bank, the ''ratio'' between filters, and the ''Q'' of the filters. All of the parameters of the object with the exception of the number of filters can be changed with Max messages; the number is fixed because, as we can see, each filter connects to a separate outlet. This allows us to create filter banks, where we can 'tap' each bandpass filter individually:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter04d.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Output of the lowest and highest two filters in our {{maxword|name=fffb~}} object: waveform and spectrogram.''&lt;br /&gt;
&lt;br /&gt;
* Using the mouse, click and drag on the {{maxword|name=dial}} object in patcher area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;. This has the audible effect of shifting the entire filter bank upwards or downwards. Turn up different {{maxword|name=gain~}} sliders to hear the results.&lt;br /&gt;
&lt;br /&gt;
The value from the {{maxword|name=dial}} is interpreted as a MIDI pitch, converted to frequency (via the {{maxword|name=mtof}}) object, and used to format the &amp;lt;code&amp;gt;freqRatio&amp;lt;/code&amp;gt; message to the {{maxword|name=fffb~}} object. The &amp;lt;code&amp;gt;freqRatio&amp;lt;/code&amp;gt; message takes two arguments: the center frequency of the first (lowest) filter, and the ''ratio'' between it and subsequent filters. The letter &amp;lt;code&amp;gt;H&amp;lt;/code&amp;gt;, when used as the ratio, tells the {{maxword|name=fffb~}} object to set the filters in the bank to ''harmonic'' multiples of the base frequency. So the message &amp;lt;code&amp;gt;freqRatio 100. H&amp;lt;/code&amp;gt; would set our ten filters up to be centered to &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; Hz increments.&lt;br /&gt;
&lt;br /&gt;
* Click in the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects connected to the {{maxword|name=pak}} object. Type &amp;lt;code&amp;gt;200.&amp;lt;/code&amp;gt; in the lefthand {{maxword|name=number}} box, and &amp;lt;code&amp;gt;1.5&amp;lt;/code&amp;gt; in the righthand {{maxword|name=number}} box. Click on the {{maxword|name=number}} box connect to the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box containing the message &amp;lt;code&amp;gt;QAll $1&amp;lt;/code&amp;gt;. Enter the value &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; and hit return. Turn up and down the different {{maxword|name=gain~}} sliders to hear the results.&lt;br /&gt;
&lt;br /&gt;
We can easily set our filters in a frequency ratio other than a harmonic series. Setting our base frequency to &amp;lt;code&amp;gt;200.&amp;lt;/code&amp;gt; and our ratio to &amp;lt;code&amp;gt;1.5&amp;lt;/code&amp;gt; results in a bank of ten filters set to the frequencies &amp;lt;code&amp;gt;200, 300, 450, 675, 1012.5, 1518.75, 2278.125, 3417.1875, 5125.78125, 7688.671875, and 11533.0078125&amp;lt;/code&amp;gt; Hz, respectively. As with the {{maxword|name=reson~}} object, we have direct control over the ''Q'' of these filters. A Q of &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; r esults in a bandwidth of 1/100 the frequency, creating narrow, pitched filters.&lt;br /&gt;
&lt;br /&gt;
* Click the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box to the right of patcher area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; that contains a series of lists. Listen to the results by adjusting the {{maxword|name=gain~}} sliders.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=fffb~}} object takes many other messages, enabling us to set the filters not in ratio at all. Sending lists in the format &amp;lt;code&amp;gt;filter_# frequency Q&amp;lt;/code&amp;gt; allows us to set each filter in the bank individually. In our example, we've set the ten filters to frequencies from a musical chord.&lt;br /&gt;
&lt;br /&gt;
===Metering===&lt;br /&gt;
&lt;br /&gt;
Next to each {{maxword|name=gain~}} slider in patcher area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; is a user-interface object that registers the amplitude of the signal connected to it. These {{maxword|name=meter~}} objects allow us to see the gain of each filter in the {{maxword|name=fffb~}} ''pre-fader'', i.e. before we listen to it.&lt;br /&gt;
&lt;br /&gt;
* Turn down all the {{maxword|name=gain~}} sliders in patcher area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;. Click in the {{maxword|name=number}} box that triggers the &amp;lt;code&amp;gt;Qall&amp;lt;/code&amp;gt; message. Type &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and hit return. Type &amp;lt;code&amp;gt;10.&amp;lt;/code&amp;gt; and hit return. Listen to the results and notice the effect of the Q on the gain of each filter, and look at how the {{maxword|name=meter~}} objects respond.&lt;br /&gt;
&lt;br /&gt;
Because the {{maxword|name=fffb~}} object works in parallel, the output gain of all the filters in the bank will typically be ''greater'' than the gain of the incoming signal. Depending on the Q values and the frequencies used, the potential volume output from the {{maxword|name=fffb~}} can be quite high. The {{maxword|name=meter~}} object lets you observe your volumes visually in the patcher window ''before'' you listen (and potentially hurt your ears).&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
MSP has three simple-to-use noise generator objects, which generate white noise ({{maxword|name=noise~}}), pink noise ({{maxword|name=pink~}}), and band-limited random signals ({{maxword|name=rand~}}). These objects are ideal candidates for filtering. The {{maxword|name=fffb~}} object implements a fixed filter bank of parallel bandpass filters which can be controlled via ratios of a base frequency or individually. The {{maxword|name=meter~}} object allows you to visually see the amplitude of any part of the MSP signal path, and is incredibly useful for metering and debugging your audio patchers.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=noise~}} - White noise generator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=pink~}} - Pink noise generator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=rand~}} - Band-limited random signal&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=fffb~}} - Fast fixed filter bank&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=meter~}} - Visual peak level indicator&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_3:_Analog-Style_Synthesis</id>
		<title>MSP Filter Tutorial 3: Analog-Style Synthesis</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_3:_Analog-Style_Synthesis"/>
				<updated>2012-06-25T21:18:38Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: /* The many aliases of digital oscillators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[03fAnalogStyleSynthesis.maxpat]]&lt;br /&gt;
&lt;br /&gt;
Now that we are familiar with some basic types of filters, we can think about different sounds to use with them. Most of the synthesis work we've looked at thus far has involved working with sinusoidal oscillators (the {{maxword|name=cycle~}}) object, creating complex spectra through different types of modulation synthesis (e.g. FM) or waveshaping. MSP has a number of oscillators that create more complex sounds on their own, and they are quite useful for creating richer sounds that can be shaped by filters. We'll introduce these oscillators here. briefly looking at a couple of objects that allow you to plot signal data along the way.&lt;br /&gt;
&lt;br /&gt;
===Waveforms===&lt;br /&gt;
&lt;br /&gt;
Look at the tutorial patcher. It consists of a {{maxword|name=kslider}} object controlling the frequencies of four different MSP objects: {{maxword|name=cycle~}}, {{maxword|name=tri~}}, {{maxword|name=saw~}}, and {{maxword|name=rect~}}. These oscillators each have their own volume control (a {{maxword|name=*~}} object) that feeds them through a {{maxword|name=lores~}} object to the {{maxword|name=dac~}} and to a pair of graphical objects at the bottom. Some additional logic in the patcher exposes some other features of these oscillators.&lt;br /&gt;
&lt;br /&gt;
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object and pick a note on the {{maxword|name=kslider}}. One-by-one, turn up and listen to the different oscillators by adjusting the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects below each one. Listen to the sound, and look at the images that appear in the objects at the bottom of the patcher.&lt;br /&gt;
&lt;br /&gt;
Our tutorial features four oscillators that are commonly used in analog sound generation and, as a result, are very common in digital synthesizers that are modeled on analog-style synthesizers from the 1960s and 1970s.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} object, as we already know, generates a cosine wave which, when discussed in the context of a basic synthesizer setup, is indistinguishable from a '''sine''' wave. It generates a roller-coaster shaped waveform that is generated by solving a sine (or cosine) function on the angle of a line tracing a circle. The property of a sine wave that is of sonic interest is it's ''spectrum''; it contains only one frequency, and is the purest tone we can generate:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''How to make a sine wave, the Max way.''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=tri~}} object generates a triangular waveform. This triangle can be equilateral (i.e. the rising part of the ramp is the same percentage of the entire wave as the falling part), or it can be unequal. This proportion of rising versus falling is called the ''duty cycle'' of the waveform. In an equal triangle wave, the spectrum contains only ''odd'' harmonics, at a power of 1/n&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, where ''n'' is the harmonic number. In other words, for a triangle wave at 100 Hz, we hear, in addition to the fundamental, a 300 Hz tone at 1/9th the volume of the fundamental, a 500 Hz tone at 1/25 the volume, a 700 Hz tone at 1/49th the volume, and so on:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Generating a triangle wave in Max.''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=saw~}} object generates a sawtooth waveform. This waveform is simply a rising ramp from &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; that repeats at a set frequency. It contains all the harmonics of the fundamental at a power equal to 1/n. Thus a 100 Hz sawtooth wave contains a 200 Hz tone at 1/2 volume, a 300 Hz tone at 1/3 volume, continuing on upwards:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03c.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A sawtooth (rising ramp) generator in Max.''&lt;br /&gt;
&lt;br /&gt;
Lastly, the {{maxword|name=rect~}} object generates a square wave. This waveform is ''binary'', consisting only of values &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. The duty cycle of a square wave controls the proportion of the wave that is negative versus positive. Like triangle waves, square waves only contain odd harmonics, but at a power of 1/n, resulting in stronger harmonic content than a triangle. A 100 Hz square wave contains a 300 Hz tone at 1/3 volume, a 500 Hz tone at 1/5 volume, etc.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03d.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A square wave in Max with an even (0.5) duty cycle.''&lt;br /&gt;
&lt;br /&gt;
These waveforms are popular in synthesis design because they contain well- understood timbral properties that are easy to predict and, as a result, to manipulate through filtering. Mixing and matching these waveforms (often with slight detuning) allows us to create fairly rich synthesizer sounds reminiscent of classic analog synthesizers.&lt;br /&gt;
&lt;br /&gt;
* Turn up one or more of our oscillators. At the right of the patcher, adjust the controls for the {{maxword|name=lores~}} object, adjusting the {{maxword|name=dial}} and {{maxword|name=number}} box controlling the cutoff frequency and resonance of the filter. Listen to the result, and also look at its effect on the visuals at the bottom of the patcher.&lt;br /&gt;
&lt;br /&gt;
===scope~ing things out===&lt;br /&gt;
&lt;br /&gt;
At the bottom of the tutorial patcher are two MSP user-interface objects that allow us to plot and view a signal. The top one is called the {{maxword|name=scope~}} object, and it functions much like an analog oscilloscope, tracing the incoming signal across the ''X'' at a regular speed, with the amplitude of the waveform corresponding to the height (''Y'' axis) of the line. Two &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects attached to the {{maxword|name=scope~}} control how many samples of audio it chunks into small buffers which it draws as pixels in the object. Adjusting those numbers allows us to get a more or less detailed view of the signal entering the object.&lt;br /&gt;
&lt;br /&gt;
The second (lower) user interface object is called a {{maxword|name=spectroscope~}}: it provides a different view of our signal: that of a spectrogram (or spectrum plot). The ''X'' axis of the graph corresponds not to time, but to ''frequency'', with the ''Y'' axis showing the amplitude of the signal at that corresponding frequency.&lt;br /&gt;
&lt;br /&gt;
* One by one, turn up our waveforms and see how they 'look' in the {{maxword|name=scope~}} and {{maxword|name=spectroscope~}} objects. If the waveform in the {{maxword|name=scope~}} seems to go by too quickly or slowly, adjust the {{maxword|name=number}} boxes attached to the object to see if you can 'tune in' a good setting for the waveform.&lt;br /&gt;
&lt;br /&gt;
* Using the controls for the {{maxword|name=lores~}} object, change the amount of high frequencies filtered out in the sound, and see how that impacts on the waveform. Notice that the {{maxword|name=cycle~}} object is largely immune to the effects of the {{maxword|name=lores~}} object unless the cutoff frequency falls below its fundamental; this is because the sine wave only generates one frequency to begin with.&lt;br /&gt;
&lt;br /&gt;
* When listening to the {{maxword|name=tri~}} and {{maxword|name=rect~}} objects, adjust the {{maxword|name=number}} box labeled 'Duty cycle'. Lowering it towards &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or raising it towards &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; changes the balance of the harmonics in those two waveforms.&lt;br /&gt;
&lt;br /&gt;
===The many aliases of digital oscillators===&lt;br /&gt;
&lt;br /&gt;
The waveforms described above are discussed as optimal shapes: when viewed, a triangle wave should look like a triangle, a sawtooth should resemble its namesake, and a square should look, well, square. Because of the implementation of these oscillators in a ''digital'' system, however, some changes are made to their shapes or, more accurately, the algorithms that generate their shapes. This is to avoid the higher harmonics of the mathematically accurate waveforms exceeding the Nyquist frequency of your audio hardware and ''folding over'' creating unpleasant artifacts. The upshot of this is that {{maxword|name=tri~}}, {{maxword|name=saw~}}, and {{maxword|name=rect~}} are all ''anti-aliased'' (or ''band-limited'') oscillators, and have slightly different shapes than the ideal, even though their generated spectra look (and sound) correct:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03e.png|border]]&lt;br /&gt;
&lt;br /&gt;
''The waveforms and spectra of sine antialiased oscillators'&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03f.png|border]]&lt;br /&gt;
&lt;br /&gt;
''The waveforms and spectra of triangle antialiased oscillators''&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03g.png|border]]&lt;br /&gt;
&lt;br /&gt;
''The waveforms and spectra of sawtooth antialiased oscillators''&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03h.png|border]]&lt;br /&gt;
&lt;br /&gt;
''The waveforms and spectra of square antialiased oscillators''&lt;br /&gt;
&lt;br /&gt;
===Sync or swim===&lt;br /&gt;
&lt;br /&gt;
* In the upper-right of the tutorial patcher, open the {{maxword|name=gate~}} object by checking the {{maxword|name=toggle}} box. Set the frequency of the {{maxword|name=phasor~}} to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; by typing into the {{maxword|name=number}} box connected to its inlet. Turn up the {{maxword|name=tri~}} object, and turn down everything else. You should hear a 'jump' in the waveform once per second. Raise the frequency of the {{maxword|name=phasor~}} by dragging in the {{maxword|name=number}} box. Once you get into the audible frequency range (around &amp;lt;code&amp;gt;20&amp;lt;/code&amp;gt; Hz) you should notice the frequency of the {{maxword|name=phasor~}} dominate over the frequency of the {{maxword|name=tri~}} object. Try turning down the {{maxword|name=tri~}} wave and turning up the {{maxword|name=saw~}} and {{maxword|name=rect~}}. Notice that audible-range settings for the {{maxword|name=phasor~}} seem to eliminate the audio from the square wave generator.&lt;br /&gt;
&lt;br /&gt;
The three complex oscillators have an additional inlet that allows them to be ''synchronized'' by another oscillator. Every time the {{maxword|name=phasor~}} object resets its phase (i.e. repeats its waveform), the oscillator receiving the 'sync' resets itself, i.e. starts drawing its shape over again. This technique of ''oscillator sync'' is useful for using one oscillator as a source of timbre ringing at the frequency of a second (master) oscillator. In this way, we could have a 200 Hz {{maxword|name=phasor~}} signal controlling triangle, sawtooth, and square waves at different frequencies of their own, applying richness to the sound from the interaction of the two waveforms.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
In addition to the {{maxword|name=cycle~}} object, which produces a cosine wave, MSP has three other 'analog-style' antialiased oscillators: {{maxword|name=tri~}}, which produces a triangle wave, {{maxword|name=saw~}}, which generates a sawtooth wave, and {{maxword|name=rect~}}, which creates a square wave. Both {{maxword|name=tri~}} and {{maxword|name=rect~}} can have their duty cycles modified, and all three can receive 'sync' from another oscillator. The {{maxword|name=scope~}} and {{maxword|name=spectroscope~}} objects are very useful for viewing signal data, either unfolding in the time domain ({{maxword|name=scope~}}) or in the frequency domain ({{maxword|name=spectroscope~}}).&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=tri~}} - Antialiased triangular oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=rect~}} - &amp;gt;Antialiased sawtooth oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=saw~}} - Antialiased rectangular (pulse) oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=scope~}} - Signal oscilloscope&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=spectroscope~}} - Signal spectrogram or sonogram&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_3:_Analog-Style_Synthesis</id>
		<title>MSP Filter Tutorial 3: Analog-Style Synthesis</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_3:_Analog-Style_Synthesis"/>
				<updated>2012-06-25T21:16:03Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[03fAnalogStyleSynthesis.maxpat]]&lt;br /&gt;
&lt;br /&gt;
Now that we are familiar with some basic types of filters, we can think about different sounds to use with them. Most of the synthesis work we've looked at thus far has involved working with sinusoidal oscillators (the {{maxword|name=cycle~}}) object, creating complex spectra through different types of modulation synthesis (e.g. FM) or waveshaping. MSP has a number of oscillators that create more complex sounds on their own, and they are quite useful for creating richer sounds that can be shaped by filters. We'll introduce these oscillators here. briefly looking at a couple of objects that allow you to plot signal data along the way.&lt;br /&gt;
&lt;br /&gt;
===Waveforms===&lt;br /&gt;
&lt;br /&gt;
Look at the tutorial patcher. It consists of a {{maxword|name=kslider}} object controlling the frequencies of four different MSP objects: {{maxword|name=cycle~}}, {{maxword|name=tri~}}, {{maxword|name=saw~}}, and {{maxword|name=rect~}}. These oscillators each have their own volume control (a {{maxword|name=*~}} object) that feeds them through a {{maxword|name=lores~}} object to the {{maxword|name=dac~}} and to a pair of graphical objects at the bottom. Some additional logic in the patcher exposes some other features of these oscillators.&lt;br /&gt;
&lt;br /&gt;
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object and pick a note on the {{maxword|name=kslider}}. One-by-one, turn up and listen to the different oscillators by adjusting the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects below each one. Listen to the sound, and look at the images that appear in the objects at the bottom of the patcher.&lt;br /&gt;
&lt;br /&gt;
Our tutorial features four oscillators that are commonly used in analog sound generation and, as a result, are very common in digital synthesizers that are modeled on analog-style synthesizers from the 1960s and 1970s.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} object, as we already know, generates a cosine wave which, when discussed in the context of a basic synthesizer setup, is indistinguishable from a '''sine''' wave. It generates a roller-coaster shaped waveform that is generated by solving a sine (or cosine) function on the angle of a line tracing a circle. The property of a sine wave that is of sonic interest is it's ''spectrum''; it contains only one frequency, and is the purest tone we can generate:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''How to make a sine wave, the Max way.''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=tri~}} object generates a triangular waveform. This triangle can be equilateral (i.e. the rising part of the ramp is the same percentage of the entire wave as the falling part), or it can be unequal. This proportion of rising versus falling is called the ''duty cycle'' of the waveform. In an equal triangle wave, the spectrum contains only ''odd'' harmonics, at a power of 1/n&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, where ''n'' is the harmonic number. In other words, for a triangle wave at 100 Hz, we hear, in addition to the fundamental, a 300 Hz tone at 1/9th the volume of the fundamental, a 500 Hz tone at 1/25 the volume, a 700 Hz tone at 1/49th the volume, and so on:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Generating a triangle wave in Max.''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=saw~}} object generates a sawtooth waveform. This waveform is simply a rising ramp from &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; that repeats at a set frequency. It contains all the harmonics of the fundamental at a power equal to 1/n. Thus a 100 Hz sawtooth wave contains a 200 Hz tone at 1/2 volume, a 300 Hz tone at 1/3 volume, continuing on upwards:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03c.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A sawtooth (rising ramp) generator in Max.''&lt;br /&gt;
&lt;br /&gt;
Lastly, the {{maxword|name=rect~}} object generates a square wave. This waveform is ''binary'', consisting only of values &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. The duty cycle of a square wave controls the proportion of the wave that is negative versus positive. Like triangle waves, square waves only contain odd harmonics, but at a power of 1/n, resulting in stronger harmonic content than a triangle. A 100 Hz square wave contains a 300 Hz tone at 1/3 volume, a 500 Hz tone at 1/5 volume, etc.:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03d.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A square wave in Max with an even (0.5) duty cycle.''&lt;br /&gt;
&lt;br /&gt;
These waveforms are popular in synthesis design because they contain well- understood timbral properties that are easy to predict and, as a result, to manipulate through filtering. Mixing and matching these waveforms (often with slight detuning) allows us to create fairly rich synthesizer sounds reminiscent of classic analog synthesizers.&lt;br /&gt;
&lt;br /&gt;
* Turn up one or more of our oscillators. At the right of the patcher, adjust the controls for the {{maxword|name=lores~}} object, adjusting the {{maxword|name=dial}} and {{maxword|name=number}} box controlling the cutoff frequency and resonance of the filter. Listen to the result, and also look at its effect on the visuals at the bottom of the patcher.&lt;br /&gt;
&lt;br /&gt;
===scope~ing things out===&lt;br /&gt;
&lt;br /&gt;
At the bottom of the tutorial patcher are two MSP user-interface objects that allow us to plot and view a signal. The top one is called the {{maxword|name=scope~}} object, and it functions much like an analog oscilloscope, tracing the incoming signal across the ''X'' at a regular speed, with the amplitude of the waveform corresponding to the height (''Y'' axis) of the line. Two &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects attached to the {{maxword|name=scope~}} control how many samples of audio it chunks into small buffers which it draws as pixels in the object. Adjusting those numbers allows us to get a more or less detailed view of the signal entering the object.&lt;br /&gt;
&lt;br /&gt;
The second (lower) user interface object is called a {{maxword|name=spectroscope~}}: it provides a different view of our signal: that of a spectrogram (or spectrum plot). The ''X'' axis of the graph corresponds not to time, but to ''frequency'', with the ''Y'' axis showing the amplitude of the signal at that corresponding frequency.&lt;br /&gt;
&lt;br /&gt;
* One by one, turn up our waveforms and see how they 'look' in the {{maxword|name=scope~}} and {{maxword|name=spectroscope~}} objects. If the waveform in the {{maxword|name=scope~}} seems to go by too quickly or slowly, adjust the {{maxword|name=number}} boxes attached to the object to see if you can 'tune in' a good setting for the waveform.&lt;br /&gt;
&lt;br /&gt;
* Using the controls for the {{maxword|name=lores~}} object, change the amount of high frequencies filtered out in the sound, and see how that impacts on the waveform. Notice that the {{maxword|name=cycle~}} object is largely immune to the effects of the {{maxword|name=lores~}} object unless the cutoff frequency falls below its fundamental; this is because the sine wave only generates one frequency to begin with.&lt;br /&gt;
&lt;br /&gt;
* When listening to the {{maxword|name=tri~}} and {{maxword|name=rect~}} objects, adjust the {{maxword|name=number}} box labeled 'Duty cycle'. Lowering it towards &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; or raising it towards &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; changes the balance of the harmonics in those two waveforms.&lt;br /&gt;
&lt;br /&gt;
===The many aliases of digital oscillators===&lt;br /&gt;
&lt;br /&gt;
The waveforms described above are discussed as optimal shapes: when viewed, a triangle wave should look like a triangle, a sawtooth should resemble its namesake, and a square should look, well, square. Because of the implementation of these oscillators in a ''digital'' system, however, some changes are made to their shapes or, more accurately, the algorithms that generate their shapes. This is to avoid the higher harmonics of the mathematically accurate waveforms exceeding the Nyquist frequency of your audio hardware and ''folding over'' creating unpleasant artifacts. The upshot of this is that {{maxword|name=tri~}}, {{maxword|name=saw~}}, and {{maxword|name=rect~}} are all ''anti-aliased'' (or ''band-limited'') oscillators, and have slightly different shapes than the ideal, even though their generated spectra look (and sound) correct:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03e.png|border]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03f.png|border]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03g.png|border]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter03h.png|border]]&lt;br /&gt;
&lt;br /&gt;
''The waveforms and spectra of antialiased oscillators. Top-left: sine. top-right: triangle, bottom-left: sawtooth, bottom-right: square.''&lt;br /&gt;
&lt;br /&gt;
===Sync or swim===&lt;br /&gt;
&lt;br /&gt;
* In the upper-right of the tutorial patcher, open the {{maxword|name=gate~}} object by checking the {{maxword|name=toggle}} box. Set the frequency of the {{maxword|name=phasor~}} to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; by typing into the {{maxword|name=number}} box connected to its inlet. Turn up the {{maxword|name=tri~}} object, and turn down everything else. You should hear a 'jump' in the waveform once per second. Raise the frequency of the {{maxword|name=phasor~}} by dragging in the {{maxword|name=number}} box. Once you get into the audible frequency range (around &amp;lt;code&amp;gt;20&amp;lt;/code&amp;gt; Hz) you should notice the frequency of the {{maxword|name=phasor~}} dominate over the frequency of the {{maxword|name=tri~}} object. Try turning down the {{maxword|name=tri~}} wave and turning up the {{maxword|name=saw~}} and {{maxword|name=rect~}}. Notice that audible-range settings for the {{maxword|name=phasor~}} seem to eliminate the audio from the square wave generator.&lt;br /&gt;
&lt;br /&gt;
The three complex oscillators have an additional inlet that allows them to be ''synchronized'' by another oscillator. Every time the {{maxword|name=phasor~}} object resets its phase (i.e. repeats its waveform), the oscillator receiving the 'sync' resets itself, i.e. starts drawing its shape over again. This technique of ''oscillator sync'' is useful for using one oscillator as a source of timbre ringing at the frequency of a second (master) oscillator. In this way, we could have a 200 Hz {{maxword|name=phasor~}} signal controlling triangle, sawtooth, and square waves at different frequencies of their own, applying richness to the sound from the interaction of the two waveforms.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
In addition to the {{maxword|name=cycle~}} object, which produces a cosine wave, MSP has three other 'analog-style' antialiased oscillators: {{maxword|name=tri~}}, which produces a triangle wave, {{maxword|name=saw~}}, which generates a sawtooth wave, and {{maxword|name=rect~}}, which creates a square wave. Both {{maxword|name=tri~}} and {{maxword|name=rect~}} can have their duty cycles modified, and all three can receive 'sync' from another oscillator. The {{maxword|name=scope~}} and {{maxword|name=spectroscope~}} objects are very useful for viewing signal data, either unfolding in the time domain ({{maxword|name=scope~}}) or in the frequency domain ({{maxword|name=spectroscope~}}).&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=tri~}} - Antialiased triangular oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=rect~}} - &amp;gt;Antialiased sawtooth oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=saw~}} - Antialiased rectangular (pulse) oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=scope~}} - Signal oscilloscope&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=spectroscope~}} - Signal spectrogram or sonogram&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters</id>
		<title>MSP Filter Tutorial 2: Variable Type Filters</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters"/>
				<updated>2012-06-25T21:15:06Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[02fVariableTypeFilters.maxpat]]&lt;br /&gt;
&lt;br /&gt;
In the first filter tutorial, we introduced some basic filters in MSP. This tutorial looks at two new filter objects: {{maxword|name=biquad~}}, which can create any kind of simple filter, and {{maxword|name=cascade~}}, which can create and manage multiple independent filters in a single object. We'll also look at a user interface object that helps us edit these filters in an intuitive way.&lt;br /&gt;
&lt;br /&gt;
===Biquadratic filters===&lt;br /&gt;
&lt;br /&gt;
* Look at the tutorial patcher. Just as in the last tutorial, area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; consists of a looping playback system that plays a {{maxword|name=buffer~}} using the {{maxword|name=groove~}} object. Turn on the audio, turn up the {{maxword|name=number}} box labeled 'Dry Volume', click on a note in the {{maxword|name=kslider}}, and make sure you can hear some sound.&lt;br /&gt;
&lt;br /&gt;
* Take a look at area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; of the tutorial. The sound from the {{maxword|name=groove~}} object feeds into an object called {{maxword|name=biquad~}}. Turn down the 'Dry Volume' and turn up the {{maxword|name=number}} box labeled 'Biquad Volume'. Click on the different circles in the {{maxword|name=preset}} object at the top of patcher aread &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. Listen to the changes in the sound.&lt;br /&gt;
&lt;br /&gt;
In the last tutorial, we discussed how filters could be expressed as equations, e.g.&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 0.5x&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 0.5y&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; values in the equation above set the respective gains of the different samples used in the filter. If we wanted a more flexible filter, we could generalize this filter so that those numbers are variable, e.g.:&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = Ax&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + By&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By modifying the values of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, we could control the frequency response of this filter. While the math behind this operation is beyond the scope of this tutorial, it's generally true that the more energy given to the delayed output sample (the y&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; term), the smoother the output and the more the high frequencies are supressed.&lt;br /&gt;
&lt;br /&gt;
A fairly standard tactic in digital filter design is to create a filter equation that can perform any kind of standard filtering operation (lowpass, bandpass, etc.) on an input signal. The most common implementation of this is called the ''biquadratic filter equation'' (or ''biquad''). It consists of the following equation:&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = Ax&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + Bx&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + Cx&amp;lt;sub&amp;gt;n-2&amp;lt;/sub&amp;gt; - Dy&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; - Ey&amp;lt;sub&amp;gt;n-2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation uses the incoming sample, the ''last two'' incoming samples, and the last two ''outgoing'' samples to generate its filter (another term for a biquadratic filter is a ''two-pole'', ''two-zero'' filter, because it has four delay coefficients to affect its behavior). By adjusting the five ''coefficients'' (A, B, C, D, E), you can generate all manner of filters. The MSP {{maxword|name=biquad~}} object implements a biquadratic filter. Unfortunately, it takes as its input the input signal and the five coefficients that define the filter. What we really want to do, though, is specify our filter not by the equation, but by how we want it to sound.&lt;br /&gt;
&lt;br /&gt;
===The filtergraph~ object===&lt;br /&gt;
&lt;br /&gt;
The user-interface object connected to the {{maxword|name=biquad~}} object in the tutorial patcher is called a {{maxword|name=filtergraph~}}. It allows us to physically drag around within a box to set parameters of a filter. In addition, you can send messages to a {{maxword|name=filtergraph~}} object to set its parameters, as well as change what kind of filter it shows. Whenever you make a change to the {{maxword|name=filtergraph~}} object, it outputs a set of coefficients as a Max list which the {{maxword|name=biquad~}} object interprets to perform the equivalent filter equation. The {{maxword|name=message}} box below the {{maxword|name=filtergraph~}} in the patcher shows us these coefficients.&lt;br /&gt;
&lt;br /&gt;
* Using the {{maxword|name=umenu}} object, select a &amp;lt;code&amp;gt;lowpass&amp;lt;/code&amp;gt; filter from the {{maxword|name=filtergraph~}}. Using the mouse, click and drag in the pink region in the middle of the filter response. You can adjust the cutoff frequency of the filter as well as its overall gain. Click on the edges of the pink region and drag inward and outward. This allows you to set the resonance of the filter. The values you are creating (in terms of cutoff frequency, gain, and slope) can be seen in the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects to the right of the object.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=filtergraph~}} object is capable of graphing and generating coefficients for a wide variety of filter curves, including lowpass, highpass, bandpass, bandstop (or notch), ''peaknotch'' (a band filter that can either boost or cut a frequency band), ''lowshelf / highshelf'' (filters that can boost or cut frequencies lower or higher than a cutoff), ''resonant'' (a bandpass filter where its gain increasing with the Q), and ''allpass'' (a filter that changes the phase relationships of frequencies without altering their gains). All of these filters can be modeled by a {{maxword|name=biquad~}} object.&lt;br /&gt;
&lt;br /&gt;
* Acclimatize yourself to the user interface of the {{maxword|name=filtergraph~}} object by selecting different filter types from the {{maxword|name=umenu}} and dragging around to create different filters. Note that some filters have inherently more potential gain than others.&lt;br /&gt;
&lt;br /&gt;
===Filters in series: cascade~===&lt;br /&gt;
&lt;br /&gt;
Filtering plays a huge role in audio-related creative work, whether we're discussing contemporary music production techniques or avant-garde sound art. It's often the case that a simple filter that only affects one range of frequencies isn't enough to perform the task we want. You can easily chain {{maxword|name=biquad~}} objects (or other filters) by hand in an MSP patcher to create filters operating in series. If you have an idea of how many filters you want to operate in this manner, you can instead use a single object that creates and manages up to 24 different filters arranged in series: {{maxword|name=cascade~}}.&lt;br /&gt;
&lt;br /&gt;
* Turn down the 'Biquad Volume' and turn your attention to area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; of the tutorial patcher. Turn up the 'Cascade Volume' {{maxword|name=number}} box and click on the different selections in the {{maxword|name=preset}} object. Notice how the sound changes. Using the {{maxword|name=number}} box labeled 'Select a filter', send the message &amp;lt;code&amp;gt;selectfilt 0&amp;lt;/code&amp;gt; to the {{maxword|name=filtergraph~}} in this part of the patcher. Change the {{maxword|name=number}} box to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;, and see how different component filters within the {{maxword|name=filtergraph~}} highlight themselves. The settings for each of these filters also comes out of the object, setting the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects to the right.&lt;br /&gt;
&lt;br /&gt;
As we can see, the {{maxword|name=filtergraph~}} object is capable of maintaining the state of more than one filter and showing us what the frequency response of these filters would be if they were connected in series. The {{maxword|name=cascade~}} object takes a signal in its left inlet and a set of coefficients in its right, interpreting each incoming list as sets of 5 values, one set for each filter.&lt;br /&gt;
&lt;br /&gt;
* Pick a {{maxword|name=preset}} setting you like for the {{maxword|name=cascade~}} object. Select a filter to edit with the &amp;lt;code&amp;gt;selectfilt&amp;lt;/code&amp;gt; message, and drag your mouse in the {{maxword|name=filtergraph~}} to edit the filter. Notice how the filters interact with one another. For example, a lowpass filter set at the same frequency as a highpass filter will cancel one another out. Similarly, a bandpass filter can sit at the 'slope' of a lowpass filter to simulate a resonation point.&lt;br /&gt;
&lt;br /&gt;
If we unlock the patcher and open the Inspector for the {{maxword|name=filtergraph~}} object, we can edit the specific types of filters that it generates coefficients for; in addition, we could change how many filters are maintained and some features of the user interface. By the opposite token, if you'd rather work with filters without a user interface, the MSP object {{maxword|name=filtercoeff~}} takes the same settings as the {{maxword|name=filtergraph~}} object without a graphical component, allowing you to feed coefficients to a {{maxword|name=biquad~}} or {{maxword|name=cascade~}} object without having to graph the filter yourself.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=biquad~}} object implements a generic filter equation that can model most types of simple filters. Because it expects coefficients for the filter equation, its often useful to use it in conjunction with another object that will compute these numbers. The {{maxword|name=filtergraph~}} object is a user-interface object that lets you visually construct simple and complex filters of many types; the {{maxword|name=filtercoeff~}} object will accomplish the same thing, without the user interface. The {{maxword|name=cascade~}} object acts as a group of {{maxword|name=biquad~}} objects arranged in ''series'', and allows you to easily construct compound filter curves in your patcher.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=biquad~}} - Two-pole, two-zero filter&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=filtergraph~}} - Graphical filter editor&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=cascade~}} - Cascaded series of biquad filters&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=filtercoeff~}} - Signal-rate filter coefficient generator&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_1:_Simple_Filters</id>
		<title>MSP Filter Tutorial 1: Simple Filters</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_1:_Simple_Filters"/>
				<updated>2012-06-25T21:14:13Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[01fSimpleFilters.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
This group of tutorials look at different ways to use ''filters'' in MSP. This includes the basic uses of filters for the equalization and shaping of a sound and using filters to create timbres in subtractive synthesis. Along the way, we'll look at some of the theory behind filters and how they work.&lt;br /&gt;
&lt;br /&gt;
===So what is a filter, anyway?===&lt;br /&gt;
&lt;br /&gt;
Filters are just algorithms that alter the frequency spectrum of a sound. When working with digital audio in the time domain (i.e. as a stream of samples representing the amplitude of a wave), filters are implemented as equations that use short ''delays'' to shape an incoming waveform.&lt;br /&gt;
&lt;br /&gt;
As an example, let's say we wanted to roll off the treble on an audio signal. If we plot a waveform, we can intuit the visual difference between low frequency and high frequency content:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Two waveforms, one with a low frequency, one with lots of high frequencies''&lt;br /&gt;
&lt;br /&gt;
As we can see, the top waveform (stored in the {{maxword|name=buffer~}} named &amp;lt;code&amp;gt;lowfrequency&amp;lt;/code&amp;gt;, contains a sine wave at 50 Hz. The bottom waveform (in the &amp;lt;code&amp;gt;highfrequency&amp;lt;/code&amp;gt; {{maxword|name=buffer~}}) contains a complex FM tone with lots of high frequencies. If we wanted to roll off the treble on the bottom waveform, we could think of how it looks: high frequencies look like sharper angles when plotted in time. In order to cut high frequencies, we could ''smooth'' this waveform. One way to smooth a signal is to ''average'' it over time.&lt;br /&gt;
&lt;br /&gt;
Let's say that we take a much simpler signal, that of a single sample of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; in a sea of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;'s. This is called an ''impulse'':&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''An impulse in an audio signal''&lt;br /&gt;
&lt;br /&gt;
An impulse has a frequency response equivalent to pure noise... hypothetically, all frequencies are present at equal volume (think of a 'click' in a digital audio signal or any other short burst of sound). So it contains plenty of high frequencies. If we wanted to smooth this signal, we could average each sample with the previous sample in this signal:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01c.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Our impulse, smoothed over one sample''&lt;br /&gt;
&lt;br /&gt;
This has the result of smearing the energy of the impulse across two samples. As a result, its frequency response will contain much less high-frequency energy; in fact, it's almost as if we've lowered the sampling rate: a click that lasts one sample at 44,100 Hz contains energy all the way up to 22,050 Hz; by derivation, a click that lasts ''two'' samples at that sampling rate is the same as a one-sample click at half that rate, i.e. it only has energy up to 11,025 Hz.&lt;br /&gt;
&lt;br /&gt;
===Some filter definitions===&lt;br /&gt;
&lt;br /&gt;
If we were to generalize what we just did to our impusle when we smoothed it, we could say this:&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 0.5x&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 0.5x&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where '''x''' represents ''incoming'' samples, '''y''' represents outgoing samples, and '''n''' represents the current ''time'' on the sample clock (i.e. ''now''). This equation defines the filter: we're averaging (multiplying by 0.5) the current and previous incoming samples to generate the outgoing samples.&lt;br /&gt;
&lt;br /&gt;
To put a name on this filter, we could call it a first-order non-recursive lowpass filter. The ''order'' of a filter refers to how many samples of delay it contains: because we're only looking at one previous input, it's a first-order filter. Because the filter only uses incoming samples in its equation, it's non-recursive. As for what it does, it ''passes'' low frequencies (and cuts high ones): hence the term ''lowpass''.&lt;br /&gt;
&lt;br /&gt;
Now consider this equation:&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 0.5x&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 0.5y&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This filter uses the previous ''outgoing'' sample from the filter as part of the filter itself; by implementing feedback in the filter, we get a much stronger effect:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01d.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Our impulse, averaged with the previous output sample''&lt;br /&gt;
&lt;br /&gt;
This equation defines a ''recursive'' filter; as a result, the effect of the filter is dissipated beyond the order of the filter. While our first equation spread the energy of our one-sample click over two samples, this new equation spreads the energy over many, because of the averaging. Consider how the click interacts with the equation:&lt;br /&gt;
&lt;br /&gt;
(x&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + y&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;) / 2 =	y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(1.0 + 0.0) / 2 = 0.5&lt;br /&gt;
&lt;br /&gt;
(0.0 + 0.5) / 2 = 0.25&lt;br /&gt;
&lt;br /&gt;
(0.0 + 0.25) / 2 = 0.125&lt;br /&gt;
&lt;br /&gt;
(0.0 + 0.125) / 2 = 0.075&lt;br /&gt;
&lt;br /&gt;
and so on...&lt;br /&gt;
&lt;br /&gt;
In the filter described above, the energy of the click, hypothetically, will ''never'' fully dissipate. Another term for this kind of filter is an ''IIR'', or infinite impulse response, filter; our first filter, which only uses incoming samples in its terms, has a finite impulse response (an ''FIR'' filter).&lt;br /&gt;
&lt;br /&gt;
In a later tutorial, we'll revisit some more filter theory. For now, it's simply important to understand that filters are made by manipulating very short (often single sample) delays (either with or without feedback) and mixing them with the current sample.&lt;br /&gt;
&lt;br /&gt;
===Our first filter: {{maxword|name=lores~}}===&lt;br /&gt;
&lt;br /&gt;
Take a look at the tutorial patcher. Patcher area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; contains a simple sampler, playing the ''sacre.aiff'' sound (loaded into a {{maxword|name=buffer~}} named &amp;lt;code&amp;gt;chords&amp;lt;/code&amp;gt;) using the {{maxword|name=groove~}} object. The circuit shown in this patch allows us to &amp;quot;play&amp;quot; the sample at any pitch with the {{maxword|name=kslider}}.&lt;br /&gt;
&lt;br /&gt;
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. Adjust the {{maxword|name=number}} box labeled 'Dry volume' and play some of the notes on the {{maxword|name=kslider}}. You should hear the sample play at different notes.&lt;br /&gt;
&lt;br /&gt;
* Turn down the 'Dry volume' and turn up the next {{maxword|name=number}} box, labeled 'Lowpass volume'. Notice the change in sound. Turn the {{maxword|name=dial}} object at the top of patcher region &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. As you move the {{maxword|name=dial}} to a higher value, more of the high frequencies from the sample are audible.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=lores~}} object implements a ''lowpass'' filter on an incoming audio signal (in our case, the output of the {{maxword|name=groove~}} object. A lowpass filter, as we saw in the tutorial introduction, passes the low frequencies and attenuates the high frequencies of the incoming signal. The two parameters that the filter takes are the ''cutoff frequency'' (specified in the middle inlet or as the first argument to the object) and the ''resonance'' (specified in the right inlet or as the second argument).&lt;br /&gt;
&lt;br /&gt;
The cutoff frequency of a lowpass filter determines the frequency at which the audio is attenuated 6 dB. The resonance amount, when greater than &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt;, controls a peak of resonation (boosted frequencies) immediately below the cutoff. If we plot the response of the filter on a graph with the ''X'' axis representing frequency and the ''Y'' axis representing gain, it would look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01e.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A lowpass filter with and without resonance: '''A''' and '''B''' are the cutoff frequencies; '''C''' shows the resonance peak''&lt;br /&gt;
&lt;br /&gt;
* With the sound going, adjust the {{maxword|name=number}} box labeled 'Resonance' in patcher area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. Notice how as the resonation approaches &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; the ringing at the resonance frequency becomes very loud. Adjust the cutoff frequency with the resonance set to a high number. Notice how you can now audibly &amp;quot;sweep&amp;quot; the filter based on hearing the resonation.&lt;br /&gt;
&lt;br /&gt;
===Bandpass filters: the {{maxword|name=reson~}} object===&lt;br /&gt;
&lt;br /&gt;
* Turn down the volume of the lowpass filter, and look at section &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; in the tutorial. Turn up the {{maxword|name=number}} box labeled 'Bandpass volume'. Sweep the {{maxword|name=dial}} labeled 'Center frequency' and listen to the result.&lt;br /&gt;
&lt;br /&gt;
Just as a lowpass filter passes low frequency, a ''bandpass'' filter passes a '''band''' of frequencies, attenuating anything lower or higher than a center frequency. The MSP {{maxword|name=reson~}} object implements a bandpass filter with three parameters (controllable as inlets or arguments): the filter's gain, the center frequency, and something called the ''Q''.&lt;br /&gt;
&lt;br /&gt;
* With the {{maxword|name=dial}} controlling the center frequency at 12 o'clock, click in the {{maxword|name=number}} box labeled 'Q' in patcher area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;. Type the number &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; and hit return. Listen to the results. Try other positive numbers, such as &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;10&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;. Notice that the higher the number is, the less frequencies make it through the filter. If necessary, adjust the 'Gain' with the {{maxword|name=number}} box to the left.&lt;br /&gt;
&lt;br /&gt;
Q is a measure of the ''width'' of a bandpass filter, and is expressed as the ratio of the center frequency divided by the ''bandwidth'' of the filter, i.e. the distance (in Hz) between the lower and higher -6 dB points around the center frequency. Higher Q values mean narrower filters (less bandwidth relative to the center frequency):&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01f.png|border]]&lt;br /&gt;
&lt;br /&gt;
A bandpass filter with Q values of &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;30.0&amp;lt;/code&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
===The state-variable filter: {{maxword|name=svf~}}===&lt;br /&gt;
&lt;br /&gt;
* Turn down the 'Bandpass volume' and look at patcher area &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;. Turn up the {{maxword|name=number}} box labeled 'Lowpass', adjust the 'Cutoff/Center Freq.' {{maxword|name=dial}}, and set the 'Resonance' {{maxword|name=number}} box to something that sounds good to you. Now, turn down the 'Lowpass' control and raise the 'Highpass'. Notice the difference. Do the same with the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects labeled 'Bandpass' and 'Notch'. Play with different combinations of volumes and settings.&lt;br /&gt;
&lt;br /&gt;
The MSP {{maxword|name=svf~}} object simulates an analogue ''state-variable'' filter. Because of the way in which filters are wired using electronic components, the difference between one type of filter and another is often simply a matter of how you wire (or where you 'tap') the circuit. A state-variable filter is a filter that allows you to 'tap' energy from several places in the filter, getting four simultaneous filters for the price of one. The {{maxword|name=svf~}} object gives you four filtered sounds: a lowpass output (which cuts frequencies above the cutoff frequency), a ''highpass'' output (which cuts frequencies ''below'' the cutoff), a bandpass output (cutting frequencies ''around'' the center frequency), and a ''notch'' output. The notch output cuts the area directly around the center frequency and should mirror the response of the equivalent bandpass filter. Notch filters are often called ''bandstop'' or ''bandreject'' filters. A plot of these possibilities shows their frequency responses:&lt;br /&gt;
&lt;br /&gt;
[[Image:Filterchapter01g.png|border]]&lt;br /&gt;
&lt;br /&gt;
The outputs of a state-variable filter: lowpass, highpass, bandpass, notch.&lt;br /&gt;
&lt;br /&gt;
* Play with different combinations of the filters in the tutorial, mixing them in different ways with different settings. In the next tutorial, we'll look at building more complex filter arrangements.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
In digital signal processing, ''filters'' refer to equations which modify the frequency response of a signal. Filters are constructed by mixing small amounts of delayed signal with the original, smoothing or sharpening the waveform to accentuate or attenuate different frequencies. Common filter types include lowpass, highpass, bandpass, and notch. Lowpass filters can be created with the {{maxword|name=lores~}} object, bandpass filters with the {{maxword|name=reson~}} object, and all four with the {{maxword|name=svf~}} object. Filters commonly have controls for their center or cutoff frequency and their Q or resonance.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=lores~}} - Resonant lowpass filter&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=reson~}} - Resonant bandpass filter&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=svf~}} - State-variable filter with simultaneous outputs&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion</id>
		<title>MSP Dynamics Tutorial 3: Distortion</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion"/>
				<updated>2012-06-25T21:13:22Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[03nDistortion.maxpat]]		&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we'll look at the use of ''waveshaping'' to modulate an input signal, simulating the distortion present in overdriven amplifiers. In the realm of analogue audio, all amplifiers introduce some form of distortion into the signal. The ability to creatively harness this by deliberately overdriving distortion circuits is difficult to simulate in a digital audio environment, as the natural artifacts and nonlinearities that render tube and transistor amplifier distortion so interesting are absent in the digital signal path. One way to overcome this is to simulate the distortion caused by amplifiers by using lookup tables to modulate the dynamic response of an input signal. Unlike the previous tutorials, which look at dynamics from a macro- (or envelope) perspective, this tutorial looks at sound amplitudes on a sample-by-sample basis.&lt;br /&gt;
&lt;br /&gt;
A review of the tutorial that covers &amp;lt;link type=&amp;quot;tutorial&amp;quot; module=&amp;quot;msp&amp;quot; name=&amp;quot;samplingchapter05&amp;quot;&amp;gt;waveshaping synthesis&amp;lt;/link&amp;gt; may be useful to understand how the {{maxword|name=lookup~}} object works in MSP.&lt;br /&gt;
&lt;br /&gt;
===Splitting bands===&lt;br /&gt;
&lt;br /&gt;
One of the attributes of cool-sounding distortion circuits is that they are ''frequency-dependent'' as well as ''amplitude-dependent'' in their behavior; that is to say, the way in which they shape an input signal depends not only on how loud the sound comes in, but also the frequency components in that sound. Some distortion circuits process high frequencies far more harshly than bass frequencies; some distort a narrow range of frequencies in the mid-range and leave high sounds relatively pure. In order to simulate this, we create an MSP signal chain that splits our input signal into three bands for low, medium, and high frequencies.&lt;br /&gt;
&lt;br /&gt;
* Take a look at the tutorial patcher. Start the audio by clicking the {{maxword|name=ezdac~}} and turn on the {{maxword|name=metro}} object labeled '1)' by clicking the {{maxword|name=toggle}} object. There are three {{maxword|name=gain~}} sliders at the bottom of the patch. Raise these each in turn, and you should hear a random sequence of vibraphone notes, with the first {{maxword|name=gain~}} slider controlling the bass, the second controlling the mid-range, and the third controlling the high frequencies.&lt;br /&gt;
&lt;br /&gt;
The state-variable ({{maxword|name=svf~}} --- colored red) object in our patcher takes the output of our sample playback logic and applies four filters to the signal simultaneously: a lowpass filter (output from the left outlet), a highpass filter (output from the second outlet), a bandpass filter (output from the third outlet), and a bandreject or notch filter (output form the last outlet). We're only interested in the first three, which roughly correspond to the bass, middle, and treble of our input signal.&lt;br /&gt;
&lt;br /&gt;
===Applying distortion===&lt;br /&gt;
&lt;br /&gt;
* Turn down all but the {{maxword|name=gain~}} slider controlling the low frequencies. On the right of the tutorial patcher, draw in the {{maxword|name=waveform~}} object labeled 'Low'. Start by manually retracing the shape that's already in there (a diagonal line running from bottom to top). Notice that even the slightest derivation changes the sound and adds noise. Try drawing a zig-zag shape across the waveform:		&lt;br /&gt;
&lt;br /&gt;
[[Image:Dynamicschapter03a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A freehand waveshape''&lt;br /&gt;
&lt;br /&gt;
A transfer function with multiple zero-crossing points will have the result of adding additional harmonics to any relatively periodic waveform. In amplifier distortion, this is an important component of the 'warm' effect of tube amplification.&lt;br /&gt;
&lt;br /&gt;
* Click the {{maxword|name=button}} object labeled 'Reset' under the 'Low' {{maxword|name=waveform~}}. The sound (and the shape) should return to normal. Turn up the {{maxword|name=gain~}} slider representing the mid-range frequencies. In the {{maxword|name=waveform~}} object labeled 'Mid', draw a diagonal slash across the middle of the waveform:		&lt;br /&gt;
&lt;br /&gt;
[[Image:Dynamicschapter03b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Distortion around zero-crossings''&lt;br /&gt;
&lt;br /&gt;
Notice how the mid-range now has a harsh overdriven sound to it. What we've done in drawing that shape is introduce a set of additional zero-crossings around the normal zero point in the waveform. The result of this will be nonlinearities in the mid-range signal whenever its sample amplitude comes close to zero. This simulates the properties of many solid state transistor distortion circuits (such as guitar pedals), which 'kink' the signal at specific intervals to generate high harmonics from the signal.&lt;br /&gt;
&lt;br /&gt;
* 'Reset' the 'Mid' waveshape by clicking the {{maxword|name=button}}, and turn up the {{maxword|name=gain~}} slider representing the high frequencies. Draw a series of sharp peaks along the waveform opposite from the normal curve:		 [[Image:Dynamicschapter03c.png|border]] ''Introducing random non-linearities''&lt;br /&gt;
&lt;br /&gt;
This type of waveshape creates a harsh distortion similar to the way digital distortion effects work. By introducing noise (random activity) into the waveshape, we create the potential for completely arbitrary distortion effects that resemble less an amplifier circuit than a 'digital' effects process.&lt;br /&gt;
&lt;br /&gt;
===Resetting and smoothing===&lt;br /&gt;
&lt;br /&gt;
* Double-click any one of the {{maxword|name=patcher}} objects that are triggered by the 'Reset' {{maxword|name=button}} objects (&amp;lt;code&amp;gt;resetlow, resetmid, resethi&amp;lt;/code&amp;gt;). Look at the contents of the subpatch.&lt;br /&gt;
&lt;br /&gt;
The MSP {{maxword|name=peek~}} object, you may recall, allows us to programmatically fill {{maxword|name=buffer~}} objects with samples according to patcher logic in Max. The {{maxword|name=uzi}} object, when it receives a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt;, sets up a chain of &amp;lt;code&amp;gt;8192&amp;lt;/code&amp;gt; events that fill the appropriate {{maxword|name=buffer~}} object with an ascending ramp of values from &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. When the {{maxword|name=lookup~}} object uses this curve, the incoming signal gets passed unchanged.&lt;br /&gt;
&lt;br /&gt;
* Close this patcher and open any of the {{maxword|name=patcher}} objects that are triggered by the 'Smooth' {{maxword|name=button}} objects (&amp;lt;code&amp;gt;smoothlow, smoothmid, smoothhi&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The smoothing subpatches, which are triggered whenever you release the mouse from drawing in the {{maxword|name=waveform~}} object, triggers an {{maxword|name=uzi}} object that takes each sample currently in the {{maxword|name=buffer~}} and averages it with its previous sample, creating a smoother curve than would be possible by freehand drawing.&lt;br /&gt;
&lt;br /&gt;
* Close the subpatch, and unlock the main tutorial patcher. Disconnect the {{maxword|name=waveform~}} objects from the {{maxword|name=zl}} objects below them. Lock the patcher and draw some curves. You'll find that the distortion effects you create are much much more pronounced. If you want to, click the {{maxword|name=button}} objects that smooth the shapes manually. The more you click them, the more averaged out our waveshapes become.&lt;br /&gt;
&lt;br /&gt;
* In the middle of the tutorial patcher, click the {{maxword|name=message}} box that reads &amp;lt;code&amp;gt;replace bass.aiff&amp;lt;/code&amp;gt;. Now the sound generated by our sampler will be that of an electric bass guitar. Play with the different waveshaping techniques we looked at earlier. If you like, modify the &amp;lt;code&amp;gt;Cutoff frequency&amp;lt;/code&amp;gt; of the {{maxword|name=svf~}} object with the {{maxword|name=number}} box in the middle of the patcher. This will let you choose where the midrange distortion effect is most prominent.		&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Waveshaping is an exciting synthesis technique that allows you to create complex timbres by running an oscillator through a lookup table; when used as a signal-processing technique with complex audio input, it can be used to simulate all manner of distortion effects. Because real-life amplifier distortion changes depending on the frequency content of the input signal, one way to simulate this distortion is to split an audio signal into several frequency bands and waveshape each one independently. While it's possible to scientifically measure and model the responses of different distortion circuits, freehand drawing in the {{maxword|name=waveform~}} object allows us to experiment with different curves and hear them directly.&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_2:_Envelope_Following</id>
		<title>MSP Dynamics Tutorial 2: Envelope Following</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_2:_Envelope_Following"/>
				<updated>2012-06-25T21:12:23Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[02nDynamicsProcessing.maxpat]]		&lt;br /&gt;
&lt;br /&gt;
This tutorial looks at using envelope following techniques to create ''dynamics processors'' in MSP. Once we've derived the amplitude envelope of a waveform as a control signal, we can add patcher logic to make decisions on the overall gain of a signal. This allows us to make compressors, limiters, and gates based on the time-varying amplitude of our audio.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, look at the area labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. This is a simple playback patcher that takes a {{maxword|name=buffer~}} and loops it using a {{maxword|name=groove~}} object. Turn on the audio by clicking the {{maxword|name=ezdac~}} and turn up the {{maxword|name=gain~}} slider to hear the sound. Note that the audio from the {{maxword|name=groove~}} object goes into a {{maxword|name=send~}} object named &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;. We'll pick up this audio in the subpatchers within the tutorial patcher. Turn down the {{maxword|name=gain~}} slider and doubleclick the {{maxword|name=patcher}} object labeled 'Compressor/Limiter'.&lt;br /&gt;
&lt;br /&gt;
===Audio compression and limiting===&lt;br /&gt;
&lt;br /&gt;
If we have an audio signal containing a wide range of amplitudes (such as a drum loop or expressive vocals) it's often necessary to reduce, or ''compress'', this range. A ''compressor'' algorithm reduces the dynamic range of an audio signal by tracking its envelope and checking that value against a ''threshold'' number. When the audio signal exceeds the threshold, its gain is reduced by a scaling factor called a compression ''ratio''. We can change the behavior of a compressor by adjusting its ''threshold'' and ''ratio'', as well as by making intelligent decisions regarding the way in which the envelope signal is derived.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial {{maxword|name=patcher}} labeled 'Compressor/Limiter', turn up the {{maxword|name=gain~}} slider. Note the difference between the sound and the sound of the uncompressed drum loop in the main patcher. Click in the {{maxword|name=number}} box labeled 'Threshold' and lower its value to &amp;lt;code&amp;gt;0.2&amp;lt;/code&amp;gt;. Raise the {{maxword|name=number}} box labeled 'Ratio' to &amp;lt;code&amp;gt;30.&amp;lt;/code&amp;gt;. Listen to the results. Change the 'Decay' value to &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt;. Bring the ratio back down to &amp;lt;code&amp;gt;4.&amp;lt;/code&amp;gt;, and the threshold to &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;. Try raising the 'Attack' value. Listen to the results as you play with the controls, and look at the {{maxword|name=multislider}} objects at the bottom of the patcher.&lt;br /&gt;
&lt;br /&gt;
Our compression patcher contains the standard controls that we would find on a hardware compressor box or a dynamics plug-in for a DAW program. The 'Attack' and 'Decay' controls set parameters for the envelope following of the audio signal. These values (converted from milliseconds to samples by the {{maxword|name=*}} objects) set how fast the {{maxword|name=rampsmooth~}} object allows the envelope to rise and fall based on the incoming signal. A long attack and decay will make the compressor circuit less responsive, but will also limit some of the artifacts associated with a highly responsive compressor, such as audible 'pumping' of the gain. The 'Threshold' and 'Ratio' controls alter how the compressor deals with scaling the gain. Our circuit implements the following equation to set the gain, where &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is the gain, &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; is the envelope signal, and &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; are the threshold and ratio, respectively:&lt;br /&gt;
&lt;br /&gt;
g = ( (e-t)*(1/r) + t ) / e; 0&amp;amp;lt;=g&amp;amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
This gain value &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is clipped in the range of &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; and then multiplied by our original audio to control its volume. The envelope value &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; and output gain &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are shown in the patcher in the {{maxword|name=multislider}} objects labeled 'Enveloped' and 'Reduction'. The colors in the 'Reduction' {{maxword|name=multislider}} are flipped so that the colored area is greater as the gain is lower, visually cueing us into the fact that the audio volume is being ''attenuated'' by our compressor.&lt;br /&gt;
&lt;br /&gt;
* Set the 'Attack', 'Decay', and 'Threshold' to &amp;lt;code&amp;gt;10.&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;, respectively. Click on the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box containing the value &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; and labeled 'Limiter?'. Listen to the results.&lt;br /&gt;
&lt;br /&gt;
A ''limiter'' is a compression circuit with an infinite compression ration, i.e. sound above the threshold is attenuated to never exceed that threshold. For a limiter, the &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; term is infinite, zeroing out part of the equation:&lt;br /&gt;
&lt;br /&gt;
g = t / e; 0&amp;amp;lt;=g&amp;amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
* Experiment more with different compression settings to see how the circuit responds. Note that the circuit always attenuates the signal, so at very low thresholds it may be necessary to raise the {{maxword|name=gain~}} slider to hear the results. When you've finished, turn down the {{maxword|name=gain~}} slider, return to the main tutorial patcher, and open the {{maxword|name=patcher}} named 'Gate'.&lt;br /&gt;
&lt;br /&gt;
===Audio gating===&lt;br /&gt;
&lt;br /&gt;
* Look at the contents of the subpatcher named 'Gate': the settings are similar to the compression example, but the results are quite different. Turn up the {{maxword|name=gain~}} slider and listen to the results of the circuit. Look at the {{maxword|name=multislider}} objects and see how they respond to the drum loop.&lt;br /&gt;
&lt;br /&gt;
The MSP circuit in this patcher starts on the same premise of a compressor: that of an envelope follower and a threshold. Rather than reducing the gain of audio energy that exceeds the threshold, however, this circuit attenuates signals that fall ''below'' it. This type of dynamics compression is called a ''gate'' (it is also sometimes referred to as a ''noise gate''). Unlike a compressor, however, the gate has a ''knee'' setting instead of a compression ratio. This setting is a proportion of the threshold within which the audio is attenuated rather than cut altogether. So with the default settings in the tutorial patch, we can expect the following results:&lt;br /&gt;
&lt;br /&gt;
Sound above &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; are left alone (&amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
Sound below &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and above &amp;lt;code&amp;gt;0.375&amp;lt;/code&amp;gt; (the threshold * the knee) are scaled between 0 and 1.&lt;br /&gt;
&lt;br /&gt;
Sound below &amp;lt;code&amp;gt;0.375&amp;lt;/code&amp;gt; are gated out (&amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; = 0)&lt;br /&gt;
&lt;br /&gt;
In equation form, our gate looks something like this, where &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is the gain, &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; is the envelope signal, and &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; are the threshold and knee:&lt;br /&gt;
&lt;br /&gt;
g = (e-(t*k)) / (t-(t*k); 0&amp;amp;lt;=g&amp;amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
As with our compressor, &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is clipped between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Familiarize yourself with the gate settings. Set the knee as high as it will go, and notice at the gate effect now simply cuts in and out. Set the knee to a low value, and the gate will fade in and out smoothly. See how the 'Attack' and 'Decay' controls on the envelope follower effect the ability of our gate to track the beat of the drum loop and gate out the silences.		&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Dynamics processors in MSP can be constructed using signal processing algorithms that take an envelope follower output as their control signal. Compressors and limiters attenuate audio signals that exceed a certain amplitude threshold according to their envelopes; gates attenuate audio that falls below a threshold. The parameters of the envelope follower itself control the responsiveness of the dynamics circuit, while parameters such as the threshold and ratio / kne. control the 'sound' of the processing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_2:_Envelope_Following</id>
		<title>MSP Dynamics Tutorial 2: Envelope Following</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_2:_Envelope_Following"/>
				<updated>2012-06-25T21:11:51Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[02nDynamicsProcessing.maxpat]]		&lt;br /&gt;
&lt;br /&gt;
This tutorial looks at using envelope following techniques to create ''dynamics processors'' in MSP. Once we've derived the amplitude envelope of a waveform as a control signal, we can add patcher logic to make decisions on the overall gain of a signal. This allows us to make compressors, limiters, and gates based on the time-varying amplitude of our audio.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, look at the area labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. This is a simple playback patcher that takes a {{maxword|name=buffer~}} and loops it using a {{maxword|name=groove~}} object. Turn on the audio by clicking the {{maxword|name=ezdac~}} and turn up the {{maxword|name=gain~}} slider to hear the sound. Note that the audio from the {{maxword|name=groove~}} object goes into a {{maxword|name=send~}} object named &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt;. We'll pick up this audio in the subpatchers within the tutorial patcher. Turn down the {{maxword|name=gain~}} slider and doubleclick the {{maxword|name=patcher}} object labeled 'Compressor/Limiter'.&lt;br /&gt;
&lt;br /&gt;
===Audio compression and limiting===&lt;br /&gt;
&lt;br /&gt;
If we have an audio signal containing a wide range of amplitudes (such as a drum loop or expressive vocals) it's often necessary to reduce, or ''compress'', this range. A ''compressor'' algorithm reduces the dynamic range of an audio signal by tracking its envelope and checking that value against a ''threshold'' number. When the audio signal exceeds the threshold, its gain is reduced by a scaling factor called a compression ''ratio''. We can change the behavior of a compressor by adjusting its ''threshold'' and ''ratio'', as well as by making intelligent decisions regarding the way in which the envelope signal is derived.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial {{maxword|name=patcher}} labeled 'Compressor/Limiter', turn up the {{maxword|name=gain~}} slider. Note the difference between the sound and the sound of the uncompressed drum loop in the main patcher. Click in the {{maxword|name=number}} box labeled 'Threshold' and lower its value to &amp;lt;code&amp;gt;0.2&amp;lt;/code&amp;gt;. Raise the {{maxword|name=number}} box labeled 'Ratio' to &amp;lt;code&amp;gt;30.&amp;lt;/code&amp;gt;. Listen to the results. Change the 'Decay' value to &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt;. Bring the ratio back down to &amp;lt;code&amp;gt;4.&amp;lt;/code&amp;gt;, and the threshold to &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;. Try raising the 'Attack' value. Listen to the results as you play with the controls, and look at the {{maxword|name=multislider}} objects at the bottom of the patcher.&lt;br /&gt;
&lt;br /&gt;
Our compression patcher contains the standard controls that we would find on a hardware compressor box or a dynamics plug-in for a DAW program. The 'Attack' and 'Decay' controls set parameters for the envelope following of the audio signal. These values (converted from milliseconds to samples by the {{maxword|name=*}} objects) set how fast the {{maxword|name=rampsmooth~}} object allows the envelope to rise and fall based on the incoming signal. A long attack and decay will make the compressor circuit less responsive, but will also limit some of the artifacts associated with a highly responsive compressor, such as audible 'pumping' of the gain. The 'Threshold' and 'Ratio' controls alter how the compressor deals with scaling the gain. Our circuit implements the following equation to set the gain, where &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is the gain, &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; is the envelope signal, and &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; are the threshold and ratio, respectively:&lt;br /&gt;
&lt;br /&gt;
g = ( (e-t)*(1/r) + t ) / e; 0&amp;amp;lt;=g&amp;amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
This gain value &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is clipped in the range of &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; and then multiplied by our original audio to control its volume. The envelope value &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; and output gain &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; are shown in the patcher in the {{maxword|name=multislider}} objects labeled 'Enveloped' and 'Reduction'. The colors in the 'Reduction' {{maxword|name=multislider}} are flipped so that the colored area is greater as the gain is lower, visually cueing us into the fact that the audio volume is being ''attenuated'' by our compressor.&lt;br /&gt;
&lt;br /&gt;
* Set the 'Attack', 'Decay', and 'Threshold' to &amp;lt;code&amp;gt;10.&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;, respectively. Click on the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box containing the value &amp;lt;code&amp;gt;0.&amp;lt;/code&amp;gt; and labeled 'Limiter?'. Listen to the results.&lt;br /&gt;
&lt;br /&gt;
A ''limiter'' is a compression circuit with an infinite compression ration, i.e. sound above the threshold is attenuated to never exceed that threshold. For a limiter, the &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; term is infinite, zeroing out part of the equation:&lt;br /&gt;
&lt;br /&gt;
g = t / e; 0&amp;amp;lt;=g&amp;amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
* Experiment more with different compression settings to see how the circuit responds. Note that the circuit always attenuates the signal, so at very low thresholds it may be necessary to raise the {{maxword|name=gain~}} slider to hear the results. When you've finished, turn down the {{maxword|name=gain~}} slider, return to the main tutorial patcher, and open the {{maxword|name=patcher}} named 'Gate'.&lt;br /&gt;
&lt;br /&gt;
===Audio gating===&lt;br /&gt;
&lt;br /&gt;
* Look at the contents of the subpatcher named 'Gate': the settings are similar to the compression example, but the results are quite different. Turn up the {{maxword|name=gain~}} slider and listen to the results of the circuit. Look at the {{maxword|name=multislider}} objects and see how they respond to the drum loop.&lt;br /&gt;
&lt;br /&gt;
The MSP circuit in this patcher starts on the same premise of a compressor: that of an envelope follower and a threshold. Rather than reducing the gain of audio energy that exceeds the threshold, however, this circuit attenuates signals that fall ''below'' it. This type of dynamics compression is called a ''gate'' (it is also sometimes referred to as a ''noise gate''). Unlike a compressor, however, the gate has a ''knee'' setting instead of a compression ratio. This setting is a proportion of the threshold within which the audio is attenuated rather than cut altogether. So with the default settings in the tutorial patch, we can expect the following results:&lt;br /&gt;
&lt;br /&gt;
Sound above &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; are left alone (&amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; = 1).&lt;br /&gt;
&lt;br /&gt;
Sound below &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; and above &amp;lt;code&amp;gt;0.375&amp;lt;/code&amp;gt; (the threshold * the knee) are scaled between 0 and 1.&lt;br /&gt;
&lt;br /&gt;
Sound below &amp;lt;code&amp;gt;0.375&amp;lt;/code&amp;gt; are gated out (&amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; = 0)&lt;br /&gt;
&lt;br /&gt;
In equation form, our gate looks something like this, where &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is the gain, &amp;lt;code&amp;gt;e&amp;lt;/code&amp;gt; is the envelope signal, and &amp;lt;code&amp;gt;t&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; are the threshold and knee:&lt;br /&gt;
&lt;br /&gt;
g = (e-(t*k)) / (t-(t*k); 0&amp;amp;lt;=g&amp;amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
As with our compressor, &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is clipped between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Familiarize yourself with the gate settings. Set the knee as high as it will go, and notice at the gate effect now simply cuts in and out. Set the knee to a low value, and the gate will fade in and out smoothly. See how the 'Attack' and 'Decay' controls on the envelope follower effect the ability of our gate to track the beat of the drum loop and gate out the silences.		&lt;br /&gt;
&lt;br /&gt;
 ===Summary===&lt;br /&gt;
&lt;br /&gt;
Dynamics processors in MSP can be constructed using signal processing algorithms that take an envelope follower output as their control signal. Compressors and limiters attenuate audio signals that exceed a certain amplitude threshold according to their envelopes; gates attenuate audio that falls below a threshold. The parameters of the envelope follower itself control the responsiveness of the dynamics circuit, while parameters such as the threshold and ratio / kne. control the 'sound' of the processing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_1:_Envelope_Following</id>
		<title>MSP Dynamics Tutorial 1: Envelope Following</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_1:_Envelope_Following"/>
				<updated>2012-06-25T21:10:54Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[01nEnvelopeFollowing.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
In this group of tutorials, we'll look at different ways to work with ''dynamics'' in audio signals. The ability to use and control the ''amplitude'' of an audio waveform is important for many applications, from the macro level (audio compression) to the micro level (distortion). In this first tutorial, we'll learn to derive control values from amplitude parameters of an audio signal which we can use to control parameters elsewhere in the signal chain. This technique is called ''envelope following''.&lt;br /&gt;
&lt;br /&gt;
===The envelope, please...===&lt;br /&gt;
&lt;br /&gt;
We've learned from working with MSP that digital audio is represented as a stream of discrete samples, each of which represent the ''amplitude'' of a signal at a given time. However, when we actually think about (and use) the term amplitude, we aren't necessarily thinking of it on a sample-by-sample basis. Instead, we discuss the amplitude of a sound based on how ''loud'' it seems to us as listeners. Alternately, we create objective measurement systems to attempt to quantify this (subjective) loudness, such as level meters in audio mixing software. Both of these systems look at the amplitude of an audio signal not on a sample-by-sample level, but ''averaged'' over time. This technique of deriving the macro-amplitude of a sound's loudness or volume (as opposed to the micro-amplitude of the sample values) is called ''envelope following''.&lt;br /&gt;
&lt;br /&gt;
We use the term envelope in synthesizer design to refer to the overall dynamic shape of the sound. For example, a sound that fades in smoothly and then fades out over the same amount of time could be said to have a triangular envelope. A sound with a short attack, a long sustain, and a short fade might look like a trapezoid. Similarly, we can take any sound source and, with a little bit of work, abstract its envelope:&lt;br /&gt;
&lt;br /&gt;
[[Image:Dynamicschapter01a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;Is that you?&amp;quot;: waveform (top) and envelope (bottom)''&lt;br /&gt;
&lt;br /&gt;
To create the envelope above, we looked at the samples within the waveform and tracked their ''average'' amplitude over time. There are several strategies to do this in MSP, involving a trio of objects that allow us to smooth audio signals based on different parameters.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, familiarize yourself with the area labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. This is a basic sample playback patcher that loads an audio file into a {{maxword|name=buffer~}} object and plays it in an endless loop using the {{maxword|name=groove~}} object. Start the audio, turn up the {{maxword|name=gain~}} slider, and make sure you can hear the drum loop as it plays.&lt;br /&gt;
&lt;br /&gt;
===Envelope following in MSP===&lt;br /&gt;
&lt;br /&gt;
* Look at the two objects in yellow attached to the output of the {{maxword|name=groove~}} object.&lt;br /&gt;
&lt;br /&gt;
The first thing that needs to be accomplished when deriving the smoothed amplitude of a sound is to convert the signal into a ''rectified'' wave; that is, to ignore the difference between negative and positive sample values and only concentrate on their distance from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;. We can do this by taking the absolute value of a signal, which can be accomplished using the {{maxword|name=abs~}} object in MSP.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=snapshot~}} object allows us to convert one sample of an MSP signal into a floating-point number output from the object as a Max event. Every time the object receives a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt;, it takes the current audio sample and outputs it into Max as a number which can be viewed, scaled, or used to trigger Max events. In the case of our patcher, the absolute value of our {{maxword|name=groove~}} object's output is being used to drive the height of a {{maxword|name=multislider}} object, with the {{maxword|name=snapshot~}} providing the intermediary translation from an MSP signal t. a Max message. As we can see, the bouncing up and down of the {{maxword|name=multislider}} gives us a vague impression of the amplitude of the drum loop. However, a more accurate impression of how we ''hear'' the sound can be accomplished by smoothing those values.&lt;br /&gt;
&lt;br /&gt;
* Look at the patcher logic labeled &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; in our tutorial. In the {{maxword|name=number}} box labeled 'Up' type the value &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; and hit return. In the {{maxword|name=number}} box labeled 'Down' type the value &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; and hit return. Observe the results as plotted in the {{maxword|name=multislider}} objects below. Now do the reverse (type &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; as the 'Down' value and &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; as the 'Up' value). Notice the difference?&lt;br /&gt;
&lt;br /&gt;
The output of the {{maxword|name=send~}} object (which consists of our drum loop) is converted to an absolute value, run through an object called {{maxword|name=rampsmooth~}}, and plotted in a {{maxword|name=number}} box and two {{maxword|name=multislider}} objects. The right-hand {{maxword|name=multislider}} is in one of its scrolling modes, which allows us to see values as they unfold over time. The {{maxword|name=rampsmooth~}} object performs a linear smoothing operation on an input signal. Its two arguments (or numbers given at its middle and right inlets) control the way in which the smoothing behaves. The middle inlet controls over how many samples the object will smooth a changing value when it is ''rising''; the right inlet controls how many samples it takes for a signal to ''fall''. These two values allow us to independently smooth increasing and decreasing sample values, so that sharp onsets can be kept in the envelope but abrupt silences generate a tail.&lt;br /&gt;
&lt;br /&gt;
* Look at the area of the tutorial labeled &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;. As before, enter &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; in the {{maxword|name=number}} box labeled 'Up' and &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; in the {{maxword|name=number}} box labeled 'Down'. Observe the envelope drawn in the {{maxword|name=multislider}}. Now do the reverse (type &amp;lt;code&amp;gt;1.&amp;lt;/code&amp;gt; as the 'Down' value and &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; as the 'Up' value). Type &amp;lt;code&amp;gt;100.&amp;lt;/code&amp;gt; for both values.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=slide~}} object smooths audio signals through logarithmically smoothing the input signal. The two values provide it work as denominators for new rising or falling energy entering the (smoothed) signal. For example, an 'Up' value of &amp;lt;code&amp;gt;1000&amp;lt;/code&amp;gt; means it will take 1000 samples for a single-sample transition from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to occur. The larger the 'Up' and 'Down' values, the smoother the curve.&lt;br /&gt;
&lt;br /&gt;
* Look at patcher area &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;. In the {{maxword|name=number}} box labeled 'Delta', type &amp;lt;code&amp;gt;0.01&amp;lt;/code&amp;gt; and hit return. Observe the results. Type an even smaller number, such as &amp;lt;code&amp;gt;0.0001&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=deltaclip~}} object works in a different manner from {{maxword|name=rampsmooth~}} and {{maxword|name=slide~}}. It sets a threshold for the amount an audio signal can change, and clips the outgoing signal to that amount. Setting the &amp;lt;code&amp;gt;min&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;max&amp;lt;/code&amp;gt; values for the delta to &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; will allow samples to pass normally provided they don't change by more than that amount. Smaller values will smooth the audio signal in a ''relative'' way so that the resulting envelope traces a much narrower set of values than the incoming signal.&lt;br /&gt;
&lt;br /&gt;
If we put a burst of noise through the different envelope following techniques shown in our tutorial patcher, we can see the difference between the curves they generate:&lt;br /&gt;
&lt;br /&gt;
[[Image:Dynamicschapter01b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Different envelope followers on a noise burst.''&lt;br /&gt;
&lt;br /&gt;
Each of these envelope-following techniques have different musical and sonic applications and have different signatures. A logarithmic envelope follower controlling the volume of a synthesizer, for example, would have a very different ''sound'' than a linear one.&lt;br /&gt;
&lt;br /&gt;
===Using envelopes as control signals===&lt;br /&gt;
&lt;br /&gt;
* Look at the patcher logic labeled &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; in the tutorial. Turn up the {{maxword|name=gain~}} slider to hear the output of the {{maxword|name=cycle~}} object. Using the {{maxword|name=umenu}}, select the different envelope followers as a control input. If you like, change their parameters as well to see what types of different effects you can achieve.&lt;br /&gt;
&lt;br /&gt;
The three envelope following patcher areas send their output signals through {{maxword|name=send~}} objects to any {{maxword|name=receive~}} set to the appropriate name. In the case of patcher logic &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt;, this signal (ranging from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; controls the frequency of a {{maxword|name=cycle~}} object, mapping the control signal to between &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1100&amp;lt;/code&amp;gt; Hz. The difference between the three envelope type should be apparent if they are set to fairly strong smoothing values.&lt;br /&gt;
&lt;br /&gt;
* Turn down the {{maxword|name=gain~}} slider in patcher area &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; and look at the patcher logic labeled &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;. Turn up the {{maxword|name=gain~}} slider and select different sources for a control signal from the {{maxword|name=umenu}}.&lt;br /&gt;
&lt;br /&gt;
In this example, we use our envelope control signal to modulate the cutoff frequency of a {{maxword|name=lores~}} filter, creating a dynamic wah-wah effect on a mixed and detuned waveform.&lt;br /&gt;
&lt;br /&gt;
* Turn down patcher area &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; and look at the patcher logic labeled &amp;lt;code&amp;gt;7&amp;lt;/code&amp;gt;. Turn up the {{maxword|name=gain~}} slider and select different envelopes from the {{maxword|name=umenu}}.&lt;br /&gt;
&lt;br /&gt;
In this example, we are using our envelope to create an 'auto-wah' on the drum loop itself. This is a very common use of envelope following in music production, where a control signal derived from an audio signal is used to control a parameter of an effect applied to that same audio clip further down the chain. Using this logic, we could use our envelope follower to apply control signals to any signal-processing procedure we want in MSP.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
When talking about the ''amplitude'' of an audio signal, we distinguish between the sample-by-sample amplitude and the overall loudness of a sound. This second shape is called the ''envelope'' of a sound, and the signal processing involved in deriving it is called ''envelope following''. Envelopes of audio signals can be created by looking at the absolute (rectified) waveform (created with the {{maxword|name=abs~}}) object and smoothing it using MSP objects such as {{maxword|name=rampsmooth~}}, {{maxword|name=slide~}}, or {{maxword|name=deltaclip~}}. These smoothed control signals can then be scaled and use to control parameters on an synthesis or signal processing operation you like. The MSP {{maxword|name=snapshot~}} object is useful for converting MSP audio signals into floating-point Max numbers which can be viewed using objects such as {{maxword|name=multislider}}.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=abs~}} - Absolute value of a signal&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=snapshot~}} - Convert signal values to numbers&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=rampsmooth~}} - Smooth an incoming signal&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=slide~}} - Filter a signal logarithmically&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=deltaclip~}} - Limit changes in signal amplitude&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_4:_Routing_Signals</id>
		<title>MSP Basics Tutorial 4: Routing Signals</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_4:_Routing_Signals"/>
				<updated>2012-06-25T21:09:40Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[04mRoutingSignals.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
In this tutorial we'll look at different ways to route MSP audio connections, as well as review sending messages remotely within Max with a focus on how this can be useful in signal network design. Along the way we'll learn about how gain can be expressed in decibels and how the {{maxword|name=phasor~}} object works.&lt;br /&gt;
&lt;br /&gt;
===Remote signal connections: send~ and receive~===&lt;br /&gt;
&lt;br /&gt;
The patch cords that connect MSP objects look different from normal patch cords because they actually do something different. They describe the order of calculations in a signal network. These connected objects will be used to calculate a whole block of samples for the next portion of sound output by your computer.&lt;br /&gt;
&lt;br /&gt;
Max objects can communicate remotely without patch cords by using the {{maxword|name=send}} and {{maxword|name=receive}} objects (and some similar objects such as {{maxword|name=value}} and {{maxword|name=pv}}). You can also use semicolons in {{maxword|name=message}} boxes to transmit values to {{maxword|name=receive}} objects by their name. You can transmit MSP signals remotely as well. Rather than using normal {{maxword|name=send}} and {{maxword|name=receive}} objects, however, two MSP objects exist specifically for remote transmission of signals: {{maxword|name=send~}} and {{maxword|name=receive~}}.&lt;br /&gt;
&lt;br /&gt;
The two objects {{maxword|name=send~}} and {{maxword|name=receive~}} work very similarly to {{maxword|name=send}} and {{maxword|name=receive}}, but are only for use with MSP objects. Max will allow you to connect normal patch cords to {{maxword|name=send~}} and {{maxword|name=receive~}}, but only signals will get passed through {{maxword|name=send~}} to the corresponding {{maxword|name=receive~}}. The MSP {{maxword|name=send~}} and {{maxword|name=receive~}} objects don't transmit any Max messages besides signals.&lt;br /&gt;
&lt;br /&gt;
There are a few other important differences between the Max objects {{maxword|name=send}} and {{maxword|name=receive}} and the MSP objects {{maxword|name=send~}} and {{maxword|name=receive~}}.&lt;br /&gt;
&lt;br /&gt;
* The names of {{maxword|name=send}} and {{maxword|name=receive}} can be shortened to &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;send&amp;quot;&amp;gt;s&amp;lt;/link&amp;gt; and &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;receive&amp;quot;&amp;gt;r&amp;lt;/link&amp;gt;; the names of {{maxword|name=send~}} and {{maxword|name=receive~}} cannot be shortened in the same way.&lt;br /&gt;
&lt;br /&gt;
* A Max message can be sent to a {{maxword|name=receive}} object from several other objects besides {{maxword|name=send}}, such as {{maxword|name=float}}, {{maxword|name=forward}}, {{maxword|name=grab}}, {{maxword|name=if}}, {{maxword|name=int}}, and {{maxword|name=message}}; {{maxword|name=receive~}} can receive a signal only from a {{maxword|name=send~}} object that shares the same name.&lt;br /&gt;
&lt;br /&gt;
* If {{maxword|name=receive}} has no typed-in argument, it has an inlet for receiving &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; messages to set or change its name; {{maxword|name=receive~}} also has an inlet for that purpose, but is nevertheless required to have a typed-in argument to give it an initial destination name.&lt;br /&gt;
&lt;br /&gt;
* The Max {{maxword|name=send}} object, once created, cannot change destinations (the Max {{maxword|name=forward}} object does this). The MSP {{maxword|name=send~}} can change destinations with a &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
Examples of each of these usages can be seen in the tutorial patch.&lt;br /&gt;
&lt;br /&gt;
===Routing a signal: gate~===&lt;br /&gt;
&lt;br /&gt;
The MSP object {{maxword|name=gate~}} works very similarly to the Max {{maxword|name=gate}} object. Just as {{maxword|name=gate}} is used to direct messages to one of several destinations, or to shut the flow of messages off entirely, {{maxword|name=gate~}} directs a signal to different places, or shuts it off from the rest of the signal network.&lt;br /&gt;
&lt;br /&gt;
In the example patch, the {{maxword|name=gate~}} objects are used to route signals to the left audio output, the right audio output, both, or neither, according to what number is received from the {{maxword|name=umenu}} object.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that changing the chosen outlet of a {{maxword|name=gate~}} while an audio signal is playing through it can cause an audible click because the signal shifts abruptly from one outlet to another. To avoid this, you should generally design your patch in such a way that the {{maxword|name=gate~}} object's outlet will only be changed when the audio signal going through it is at zero or when audio is off. (No such precaution was taken in this tutorial patch.)&lt;br /&gt;
&lt;br /&gt;
===Wave interference===&lt;br /&gt;
&lt;br /&gt;
It's a fundamental physical fact that when we add together two sinusoidal waves with different frequencies we create ''interference'' between the two waves. Since they have different frequencies, they will usually not be exactly in phase with each other; at some times they will be sufficiently in phase that they add together constructively, but at other times they add together destructively, canceling each other out to some extent. They only arrive precisely in phase with each other at a rate equal to the difference in their frequencies. For example, a sinusoid at 1000 Hz and another at 1002 Hz come into phase exactly 2 times per second. In this case, they are sufficiently close in frequency that we don't hear them as two separate tones. Instead, we hear their recurring pattern of constructive and destructive interference as ''beats'' occurring at a sub-audio rate of 2 Hz, a rate known as the ''difference frequency'' or ''beat frequency''. (Interestingly, we hear the two waves as a single tone with a sub-audio beat frequency of 2 Hz and an audio frequency of 1001 Hz.)&lt;br /&gt;
&lt;br /&gt;
When the example patch is opened, a {{maxword|name=loadbang}} object sends initial frequency values to the two {{maxword|name=cycle~}} objects in the patch, setting them to 1000 Hz and 1002 Hz; so we expect that these two tones sounded together will cause a beat frequency of 2 Hz. It also sends initial values to the {{maxword|name=umenu}} objects which in turn set the {{maxword|name=gate~}} objects, directing one tone to the left audio output and one to the right audio output. A fourth value called &amp;lt;code&amp;gt;Depth&amp;lt;/code&amp;gt; is also set. All of this is accomplished by using a &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box to remotely set values picked up by Max {{maxword|name=receive}} objects in the patcher.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, click on {{maxword|name=ezdac~}} to turn audio on, then use the {{maxword|name=slider}} marked &amp;lt;code&amp;gt;Volume&amp;lt;/code&amp;gt; to adjust the loudness of the sound to a comfortable level. Note that the beats occur exactly twice per second. Try changing the frequency of Oscillator B to various other numbers close to 1000 (using the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;frequency&amp;lt;/code&amp;gt;), and note the effect. As the difference frequency approaches an audio rate (say, in the range of 20-30 Hz) you can no longer distinguish individual beats, and the effect becomes more of a timbral change. Increase the difference still further, and you begin to hear two distinct frequencies.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
''Philosophical tangent: ''It can be shown mathematically and empirically that when two sinusoidal tones are added, their interference pattern recurs at a rate equal to the difference in their frequencies. This apparently explains why we hear beats; the amplitude demonstrably varies at the difference rate. However, if you listen to this patch through headphones so that the two tones never have an opportunity to interfere mathematically, electrically, or in the air, you still hear the beats! This phenomenon, known as ''binaural beating'' is caused by ‘interference’ occurring in the nervous system. Although such interference is of a very different physical nature than the interference of sound waves in the air, we experience it as similar. An experiment like this demonstrates that our auditory system actively shapes the world we hear.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Amplitude and relative amplitude===&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=slider}} marked ‘Volume’ has been set to have a range of 101 values, from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt;, which makes it easy to convert its output to a float ranging from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; just by dividing by 100. (The decimal point in argument typed into the {{maxword|name=/}} object ensures a float division.)&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=*~}} objects use the specified amplitude value to scale the audio signal before it goes to the {{maxword|name=ezdac~}}. If both oscillators get sent to the same inlet of {{maxword|name=ezdac~}}, their combined amplitude will be 2. Therefore, it is prudent to keep the amplitude scaling factor at or below 0.5. For that reason, the amplitude value which the user thinks of as being between 0 and 1 is actually kept between 0 and 0.5 by the {{maxword|name=*}} &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; object below the {{maxword|name=slider}}.&lt;br /&gt;
&lt;br /&gt;
Because of the wide range of possible audible amplitudes, it may be more meaningful in some cases to display volume numerically in terms of the logarithmic scale of decibels (''dB''), rather than in terms of absolute amplitude. The decibel scale refers to ''relative'' amplitude, i.e. the amplitude of a signal relative to some reference amplitude. The formula for calculating amplitude in decibels is:&lt;br /&gt;
&lt;br /&gt;
''dB = 20(log10(A/Aref))''&lt;br /&gt;
&lt;br /&gt;
where ''A'' is the amplitude being measured and ''Aref'' is a fixed reference amplitude.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=AtodB}} object uses a reference amplitude of 1 in the formula shown above, and converts the amplitude to dB. If you turn off the audio (for safety) and raise the {{maxword|name=slider}} to its maximum value (ensuring an output of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;), you will see the decibel output of the {{maxword|name=AtodB}} object read &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; (i.e. unity gain). Each halving of the amplitude in the {{maxword|name=slider}} is approximately equal to a 6 dB reduction in decibels.&lt;br /&gt;
&lt;br /&gt;
===Constant signal value: sig~===&lt;br /&gt;
&lt;br /&gt;
Most signal networks require some changing values (such as an amplitude envelope to vary the amplitude over time) and some constant values (such as a frequency value to keep an oscillator at a steady pitch). In general, one provides a constant value to an MSP object in the form of a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; message, as we have done in these examples when sending a frequency in the left inlet of a {{maxword|name=cycle~}} object.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases when one wants to combine both constant and changing values in the same inlet of an MSP object. Inlets that accept either a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; or a &amp;lt;code&amp;gt;signal&amp;lt;/code&amp;gt; (such as the left inlet of {{maxword|name=cycle~}}) do not successfully combine the two. In general, MSP objects will ''ignore'' a floating-point value in deference to a signal input. As a result, it's necessary to have an object that outputs a constant value as a signal if you need to combine a fixed and changing value in an MSP signal chain.&lt;br /&gt;
&lt;br /&gt;
One way to combine a numerical Max message (an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; or a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;) with a signal is to convert the number into a steady signal with the {{maxword|name=sig~}} object. The output of {{maxword|name=sig~}} is a signal with a constant value, determined by the number received in its inlet.&lt;br /&gt;
&lt;br /&gt;
In the example patch, &amp;lt;code&amp;gt;Oscillator B&amp;lt;/code&amp;gt; combines a constant frequency (supplied as a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; to {{maxword|name=sig~}}) with a varying frequency offset (two additional signal values, coming in from two {{maxword|name=receive~}} objects called &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt;). The sum of these three signals will be the frequency of the oscillator at any given instant.&lt;br /&gt;
&lt;br /&gt;
===Changing the phase of a waveform: phasor~===&lt;br /&gt;
&lt;br /&gt;
For the most part, the phase offset of an isolated audio wave doesn't have a substantial effect perceptually. For example, a sine wave in the audio range sounds exactly like a cosine wave, even though there is a theoretical phase difference of a quarter cycle. For that reason, we have not been concerned with the rightmost phase inlet of the {{maxword|name=cycle~}} object until now.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter04a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A sine wave offset by a quarter cycle is a cosine wave''&lt;br /&gt;
&lt;br /&gt;
However, there are some very useful reasons to control the phase offset of a wave. For example, by leaving the frequency of {{maxword|name=cycle~}} at &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, and continuously increasing its phase offset, you can change its instantaneous value (just as if it had a positive frequency). The phase offset of a sinusoid is usually referred to in degrees (a full cycle is 360°) or ''radians'' (a full cycle is 2*&amp;amp;#x3C0; radians in length). In the {{maxword|name=cycle~}} object, phase is referred to in wave cycles; so an offset of &amp;amp;#x3C0; radians is 1/2 of a cycle, or &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;. In other words, as the phase varies from 0 to 2&amp;amp;#x3C0; radians, it varies from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; wave cycles. This way of describing the phase is handy since it allows us to use the common signal range from 0 to 1.&lt;br /&gt;
&lt;br /&gt;
So, if we vary the phase offset of a stationary (0 Hz) {{maxword|name=cycle~}} object continuously from 0 to 1 over the course of one second, the resulting output is a cosine wave with a frequency of 1 Hz.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=phasor~}} object is a very useful MSP signal generator that simply outputs a ramp from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; at a given frequency. As with the {{maxword|name=cycle~}} object, it's frequency can be set by an argument to the object, a floating-point value in its left inlet, or a signal. Later in our tutorial, we'll hear what it sounds like (it's a sawtooth wave, and not an especially pleasant one), but for now let's use it for changing the ''phase'' (hence {{maxword|name=phasor~}} of the {{maxword|name=cycle~}} object in the lower-left of the tutorial patcher.&lt;br /&gt;
&lt;br /&gt;
* Turn on the {{maxword|name=gate~}} object in the lower-left of the tutorial patcher by clicking on the {{maxword|name=toggle}} box. You should hear one of the sine waves begin to slowly drop and rise in pitch, causing the beating between the two sines connected to the audio output to change over time. Turn off the {{maxword|name=gate~}}, and everything goes back to the way it was. Turn on the {{maxword|name=gate~}} again, and set the destination of the {{maxword|name=send~}} object to &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt; by clicking the message box labeled &amp;lt;code&amp;gt;set wooble&amp;lt;/code&amp;gt;. The change in beating will become much more severe and will result in audible interference patterns at certain points in the cycle caused by the {{maxword|name=phasor~}} object. Set the {{maxword|name=send~}} back to &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; with the other &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box, and the beating curve becomes much tamer again.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} in the bottom-left of the patcher is ''modulating'' the {{maxword|name=cycle~}} object in the upper-right by adding a value to its current (constant) frequency, set by the {{maxword|name=sig~}} object. When the {{maxword|name=gate~}} is enabled, the {{maxword|name=cycle~}} object's output (from &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt;) is sent to one of two destinations (&amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt;). The difference between the two is that the &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; destination multiplies the output of the cosine by a factor set by &amp;lt;code&amp;gt;Depth&amp;lt;/code&amp;gt;. This is set to &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box that initializes the patcher.&lt;br /&gt;
&lt;br /&gt;
When we send the modulating {{maxword|name=cycle~}} to &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt;, a raw cosine as added to the frequency set by the {{maxword|name=sig~}} object; this causes the frequency of Oscillator B to fluctuate very slowly between 1001 Hz and 1003 Hz. If we switch the {{maxword|name=cycle~}} to send to &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt;, the amplification caused by the &amp;lt;code&amp;gt;Depth&amp;lt;/code&amp;gt; value causes Oscillator B to fluctuate between 922 and 1082 Hz. This creates a form of ''frequency modulation'', which we'll explore in depth in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
===Receiving a different signal===&lt;br /&gt;
&lt;br /&gt;
The remaining portion of the tutorial patch exists simply to demonstrate the use of the &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message to the {{maxword|name=receive~}} object. This is another way to alter the signal flow in a network. As with the {{maxword|name=send~}} object, you can change the name of the {{maxword|name=receive~}} object with a &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message, instructing it to get its input from a different {{maxword|name=send~}} object (or objects).&lt;br /&gt;
&lt;br /&gt;
* Click on the {{maxword|name=message}} box containing &amp;lt;code&amp;gt;set sawtooth&amp;lt;/code&amp;gt;. Both of the connected {{maxword|name=receive~}} objects now get their signal from the {{maxword|name=phasor~}} object in the lower-right corner of the window. Click on the {{maxword|name=message}} boxes containing &amp;lt;code&amp;gt;set outL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;set outR&amp;lt;/code&amp;gt; messages to receive the sinusoidal tones once again. With the &amp;lt;code&amp;gt;sawtooth&amp;lt;/code&amp;gt; destination selected, change the frequency of the {{maxword|name=phasor~}} in the lower-right of the patcher. Notice that when set to an audible frequency, the ramp of the {{maxword|name=phasor~}} object causes it to sound like an oscillator rich in harmonics. This is a ''sawtooth'' wave, a common waveform used in synthesizer design. Because the {{maxword|name=phasor~}} object only ramps from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (and not &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, using a {{maxword|name=phasor~}} as an audio source isn't the best way to get this sound: the MSP {{maxword|name=saw~}} wave will do the trick instead.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
It is possible to make signal connections without patch cords by using the MSP objects {{maxword|name=send~}} and {{maxword|name=receive~}}, which are similar to the Max objects {{maxword|name=send}} and {{maxword|name=receive}}. The &amp;lt;code&amp;gt;set &amp;lt;/code&amp;gt;message can be used to change the name of a {{maxword|name=send~}} or {{maxword|name=receive~}} object, thus switching how signals are routed. Signal flow can be routed to different destinations within a patcher, or shut off entirely, using the {{maxword|name=gate~}} object, which is the MSP equivalent of the Max object {{maxword|name=gate}}.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} object can be used not only for periodic audio waves, but also for sub-audio control functions: you can read through the waveform of a {{maxword|name=cycle~}} object at any rate you wish by keeping its frequency at 0 Hz and changing its phase continuously from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. The {{maxword|name=phasor~}} object is appropriate for changing the phase of a {{maxword|name=cycle~}} waveform in this way; you could also use a {{maxword|name=line~}} object to create a ramp that goes through the object's wavetable.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=sig~}} object converts a number to a constant signal; it receives a number in its inlet and sends out a signal of that value. This is useful for combining constant values with varying signals. Mixing together tones with slightly different frequencies creates interference between waves, which can create beats and other timbral effects.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=gate~}} - Route a signal to one of several outlets&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=receive~}} - Receive signals without patch cords &lt;br /&gt;
&lt;br /&gt;
{{maxword|name=send~}} - Transmit signals without patch cords&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=sig~}} - Constant signal of a number&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=phasor~}} - Sawtooth wave generator 	 [[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_4:_Routing_Signals</id>
		<title>MSP Basics Tutorial 4: Routing Signals</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_4:_Routing_Signals"/>
				<updated>2012-06-25T21:07:51Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[04mRoutingSignals.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
In this tutorial we'll look at different ways to route MSP audio connections, as well as review sending messages remotely within Max with a focus on how this can be useful in signal network design. Along the way we'll learn about how gain can be expressed in decibels and how the {{maxword|name=phasor~}} object works.&lt;br /&gt;
&lt;br /&gt;
===Remote signal connections: send~ and receive~===&lt;br /&gt;
&lt;br /&gt;
The patch cords that connect MSP objects look different from normal patch cords because they actually do something different. They describe the order of calculations in a signal network. These connected objects will be used to calculate a whole block of samples for the next portion of sound output by your computer.&lt;br /&gt;
&lt;br /&gt;
Max objects can communicate remotely without patch cords by using the {{maxword|name=send}} and {{maxword|name=receive}} objects (and some similar objects such as {{maxword|name=value}} and {{maxword|name=pv}}). You can also use semicolons in {{maxword|name=message}} boxes to transmit values to {{maxword|name=receive}} objects by their name. You can transmit MSP signals remotely as well. Rather than using normal {{maxword|name=send}} and {{maxword|name=receive}} objects, however, two MSP objects exist specifically for remote transmission of signals: {{maxword|name=send~}} and {{maxword|name=receive~}}.&lt;br /&gt;
&lt;br /&gt;
The two objects {{maxword|name=send~}} and {{maxword|name=receive~}} work very similarly to {{maxword|name=send}} and {{maxword|name=receive}}, but are only for use with MSP objects. Max will allow you to connect normal patch cords to {{maxword|name=send~}} and {{maxword|name=receive~}}, but only signals will get passed through {{maxword|name=send~}} to the corresponding {{maxword|name=receive~}}. The MSP {{maxword|name=send~}} and {{maxword|name=receive~}} objects don't transmit any Max messages besides signals.&lt;br /&gt;
&lt;br /&gt;
There are a few other important differences between the Max objects {{maxword|name=send}} and {{maxword|name=receive}} and the MSP objects {{maxword|name=send~}} and {{maxword|name=receive~}}.&lt;br /&gt;
&lt;br /&gt;
# The names of {{maxword|name=send}} and {{maxword|name=receive}} can be shortened to &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;send&amp;quot;&amp;gt;s&amp;lt;/link&amp;gt; and &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;receive&amp;quot;&amp;gt;r&amp;lt;/link&amp;gt;; the names of {{maxword|name=send~}} and {{maxword|name=receive~}} cannot be shortened in the same way.&lt;br /&gt;
&lt;br /&gt;
# A Max message can be sent to a {{maxword|name=receive}} object from several other objects besides {{maxword|name=send}}, such as {{maxword|name=float}}, {{maxword|name=forward}}, {{maxword|name=grab}}, {{maxword|name=if}}, {{maxword|name=int}}, and {{maxword|name=message}}; {{maxword|name=receive~}} can receive a signal only from a {{maxword|name=send~}} object that shares the same name.&lt;br /&gt;
&lt;br /&gt;
# If {{maxword|name=receive}} has no typed-in argument, it has an inlet for receiving &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; messages to set or change its name; {{maxword|name=receive~}} also has an inlet for that purpose, but is nevertheless required to have a typed-in argument to give it an initial destination name.&lt;br /&gt;
&lt;br /&gt;
# The Max {{maxword|name=send}} object, once created, cannot change destinations (the Max {{maxword|name=forward}} object does this). The MSP {{maxword|name=send~}} can change destinations with a &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
Examples of each of these usages can be seen in the tutorial patch.&lt;br /&gt;
&lt;br /&gt;
===Routing a signal: gate~===&lt;br /&gt;
&lt;br /&gt;
The MSP object {{maxword|name=gate~}} works very similarly to the Max {{maxword|name=gate}} object. Just as {{maxword|name=gate}} is used to direct messages to one of several destinations, or to shut the flow of messages off entirely, {{maxword|name=gate~}} directs a signal to different places, or shuts it off from the rest of the signal network.&lt;br /&gt;
&lt;br /&gt;
In the example patch, the {{maxword|name=gate~}} objects are used to route signals to the left audio output, the right audio output, both, or neither, according to what number is received from the {{maxword|name=umenu}} object.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that changing the chosen outlet of a {{maxword|name=gate~}} while an audio signal is playing through it can cause an audible click because the signal shifts abruptly from one outlet to another. To avoid this, you should generally design your patch in such a way that the {{maxword|name=gate~}} object's outlet will only be changed when the audio signal going through it is at zero or when audio is off. (No such precaution was taken in this tutorial patch.)&lt;br /&gt;
&lt;br /&gt;
===Wave interference===&lt;br /&gt;
&lt;br /&gt;
It's a fundamental physical fact that when we add together two sinusoidal waves with different frequencies we create ''interference'' between the two waves. Since they have different frequencies, they will usually not be exactly in phase with each other; at some times they will be sufficiently in phase that they add together constructively, but at other times they add together destructively, canceling each other out to some extent. They only arrive precisely in phase with each other at a rate equal to the difference in their frequencies. For example, a sinusoid at 1000 Hz and another at 1002 Hz come into phase exactly 2 times per second. In this case, they are sufficiently close in frequency that we don't hear them as two separate tones. Instead, we hear their recurring pattern of constructive and destructive interference as ''beats'' occurring at a sub-audio rate of 2 Hz, a rate known as the ''difference frequency'' or ''beat frequency''. (Interestingly, we hear the two waves as a single tone with a sub-audio beat frequency of 2 Hz and an audio frequency of 1001 Hz.)&lt;br /&gt;
&lt;br /&gt;
When the example patch is opened, a {{maxword|name=loadbang}} object sends initial frequency values to the two {{maxword|name=cycle~}} objects in the patch, setting them to 1000 Hz and 1002 Hz; so we expect that these two tones sounded together will cause a beat frequency of 2 Hz. It also sends initial values to the {{maxword|name=umenu}} objects which in turn set the {{maxword|name=gate~}} objects, directing one tone to the left audio output and one to the right audio output. A fourth value called &amp;lt;code&amp;gt;Depth&amp;lt;/code&amp;gt; is also set. All of this is accomplished by using a &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box to remotely set values picked up by Max {{maxword|name=receive}} objects in the patcher.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, click on {{maxword|name=ezdac~}} to turn audio on, then use the {{maxword|name=slider}} marked &amp;lt;code&amp;gt;Volume&amp;lt;/code&amp;gt; to adjust the loudness of the sound to a comfortable level. Note that the beats occur exactly twice per second. Try changing the frequency of Oscillator B to various other numbers close to 1000 (using the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;frequency&amp;lt;/code&amp;gt;), and note the effect. As the difference frequency approaches an audio rate (say, in the range of 20-30 Hz) you can no longer distinguish individual beats, and the effect becomes more of a timbral change. Increase the difference still further, and you begin to hear two distinct frequencies.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
''Philosophical tangent: ''It can be shown mathematically and empirically that when two sinusoidal tones are added, their interference pattern recurs at a rate equal to the difference in their frequencies. This apparently explains why we hear beats; the amplitude demonstrably varies at the difference rate. However, if you listen to this patch through headphones so that the two tones never have an opportunity to interfere mathematically, electrically, or in the air, you still hear the beats! This phenomenon, known as ''binaural beating'' is caused by ‘interference’ occurring in the nervous system. Although such interference is of a very different physical nature than the interference of sound waves in the air, we experience it as similar. An experiment like this demonstrates that our auditory system actively shapes the world we hear.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Amplitude and relative amplitude===&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=slider}} marked ‘Volume’ has been set to have a range of 101 values, from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt;, which makes it easy to convert its output to a float ranging from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; just by dividing by 100. (The decimal point in argument typed into the {{maxword|name=/}} object ensures a float division.)&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=*~}} objects use the specified amplitude value to scale the audio signal before it goes to the {{maxword|name=ezdac~}}. If both oscillators get sent to the same inlet of {{maxword|name=ezdac~}}, their combined amplitude will be 2. Therefore, it is prudent to keep the amplitude scaling factor at or below 0.5. For that reason, the amplitude value which the user thinks of as being between 0 and 1 is actually kept between 0 and 0.5 by the {{maxword|name=*}} &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; object below the {{maxword|name=slider}}.&lt;br /&gt;
&lt;br /&gt;
Because of the wide range of possible audible amplitudes, it may be more meaningful in some cases to display volume numerically in terms of the logarithmic scale of decibels (''dB''), rather than in terms of absolute amplitude. The decibel scale refers to ''relative'' amplitude, i.e. the amplitude of a signal relative to some reference amplitude. The formula for calculating amplitude in decibels is:&lt;br /&gt;
&lt;br /&gt;
''dB = 20(log10(A/Aref))''&lt;br /&gt;
&lt;br /&gt;
where ''A'' is the amplitude being measured and ''Aref'' is a fixed reference amplitude.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=AtodB}} object uses a reference amplitude of 1 in the formula shown above, and converts the amplitude to dB. If you turn off the audio (for safety) and raise the {{maxword|name=slider}} to its maximum value (ensuring an output of &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;), you will see the decibel output of the {{maxword|name=AtodB}} object read &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; (i.e. unity gain). Each halving of the amplitude in the {{maxword|name=slider}} is approximately equal to a 6 dB reduction in decibels.&lt;br /&gt;
&lt;br /&gt;
===Constant signal value: sig~===&lt;br /&gt;
&lt;br /&gt;
Most signal networks require some changing values (such as an amplitude envelope to vary the amplitude over time) and some constant values (such as a frequency value to keep an oscillator at a steady pitch). In general, one provides a constant value to an MSP object in the form of a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; message, as we have done in these examples when sending a frequency in the left inlet of a {{maxword|name=cycle~}} object.&lt;br /&gt;
&lt;br /&gt;
However, there are some cases when one wants to combine both constant and changing values in the same inlet of an MSP object. Inlets that accept either a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; or a &amp;lt;code&amp;gt;signal&amp;lt;/code&amp;gt; (such as the left inlet of {{maxword|name=cycle~}}) do not successfully combine the two. In general, MSP objects will ''ignore'' a floating-point value in deference to a signal input. As a result, it's necessary to have an object that outputs a constant value as a signal if you need to combine a fixed and changing value in an MSP signal chain.&lt;br /&gt;
&lt;br /&gt;
One way to combine a numerical Max message (an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; or a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;) with a signal is to convert the number into a steady signal with the {{maxword|name=sig~}} object. The output of {{maxword|name=sig~}} is a signal with a constant value, determined by the number received in its inlet.&lt;br /&gt;
&lt;br /&gt;
In the example patch, &amp;lt;code&amp;gt;Oscillator B&amp;lt;/code&amp;gt; combines a constant frequency (supplied as a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; to {{maxword|name=sig~}}) with a varying frequency offset (two additional signal values, coming in from two {{maxword|name=receive~}} objects called &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt;). The sum of these three signals will be the frequency of the oscillator at any given instant.&lt;br /&gt;
&lt;br /&gt;
===Changing the phase of a waveform: phasor~===&lt;br /&gt;
&lt;br /&gt;
For the most part, the phase offset of an isolated audio wave doesn't have a substantial effect perceptually. For example, a sine wave in the audio range sounds exactly like a cosine wave, even though there is a theoretical phase difference of a quarter cycle. For that reason, we have not been concerned with the rightmost phase inlet of the {{maxword|name=cycle~}} object until now.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter04a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A sine wave offset by a quarter cycle is a cosine wave''&lt;br /&gt;
&lt;br /&gt;
However, there are some very useful reasons to control the phase offset of a wave. For example, by leaving the frequency of {{maxword|name=cycle~}} at &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, and continuously increasing its phase offset, you can change its instantaneous value (just as if it had a positive frequency). The phase offset of a sinusoid is usually referred to in degrees (a full cycle is 360°) or ''radians'' (a full cycle is 2*&amp;amp;#x3C0; radians in length). In the {{maxword|name=cycle~}} object, phase is referred to in wave cycles; so an offset of &amp;amp;#x3C0; radians is 1/2 of a cycle, or &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt;. In other words, as the phase varies from 0 to 2&amp;amp;#x3C0; radians, it varies from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; wave cycles. This way of describing the phase is handy since it allows us to use the common signal range from 0 to 1.&lt;br /&gt;
&lt;br /&gt;
So, if we vary the phase offset of a stationary (0 Hz) {{maxword|name=cycle~}} object continuously from 0 to 1 over the course of one second, the resulting output is a cosine wave with a frequency of 1 Hz.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=phasor~}} object is a very useful MSP signal generator that simply outputs a ramp from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; at a given frequency. As with the {{maxword|name=cycle~}} object, it's frequency can be set by an argument to the object, a floating-point value in its left inlet, or a signal. Later in our tutorial, we'll hear what it sounds like (it's a sawtooth wave, and not an especially pleasant one), but for now let's use it for changing the ''phase'' (hence {{maxword|name=phasor~}} of the {{maxword|name=cycle~}} object in the lower-left of the tutorial patcher.&lt;br /&gt;
&lt;br /&gt;
* Turn on the {{maxword|name=gate~}} object in the lower-left of the tutorial patcher by clicking on the {{maxword|name=toggle}} box. You should hear one of the sine waves begin to slowly drop and rise in pitch, causing the beating between the two sines connected to the audio output to change over time. Turn off the {{maxword|name=gate~}}, and everything goes back to the way it was. Turn on the {{maxword|name=gate~}} again, and set the destination of the {{maxword|name=send~}} object to &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt; by clicking the message box labeled &amp;lt;code&amp;gt;set wooble&amp;lt;/code&amp;gt;. The change in beating will become much more severe and will result in audible interference patterns at certain points in the cycle caused by the {{maxword|name=phasor~}} object. Set the {{maxword|name=send~}} back to &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; with the other &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box, and the beating curve becomes much tamer again.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} in the bottom-left of the patcher is ''modulating'' the {{maxword|name=cycle~}} object in the upper-right by adding a value to its current (constant) frequency, set by the {{maxword|name=sig~}} object. When the {{maxword|name=gate~}} is enabled, the {{maxword|name=cycle~}} object's output (from &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt;) is sent to one of two destinations (&amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt;). The difference between the two is that the &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt; destination multiplies the output of the cosine by a factor set by &amp;lt;code&amp;gt;Depth&amp;lt;/code&amp;gt;. This is set to &amp;lt;code&amp;gt;80&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box that initializes the patcher.&lt;br /&gt;
&lt;br /&gt;
When we send the modulating {{maxword|name=cycle~}} to &amp;lt;code&amp;gt;warble&amp;lt;/code&amp;gt;, a raw cosine as added to the frequency set by the {{maxword|name=sig~}} object; this causes the frequency of Oscillator B to fluctuate very slowly between 1001 Hz and 1003 Hz. If we switch the {{maxword|name=cycle~}} to send to &amp;lt;code&amp;gt;wooble&amp;lt;/code&amp;gt;, the amplification caused by the &amp;lt;code&amp;gt;Depth&amp;lt;/code&amp;gt; value causes Oscillator B to fluctuate between 922 and 1082 Hz. This creates a form of ''frequency modulation'', which we'll explore in depth in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
===Receiving a different signal===&lt;br /&gt;
&lt;br /&gt;
The remaining portion of the tutorial patch exists simply to demonstrate the use of the &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message to the {{maxword|name=receive~}} object. This is another way to alter the signal flow in a network. As with the {{maxword|name=send~}} object, you can change the name of the {{maxword|name=receive~}} object with a &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message, instructing it to get its input from a different {{maxword|name=send~}} object (or objects).&lt;br /&gt;
&lt;br /&gt;
* Click on the {{maxword|name=message}} box containing &amp;lt;code&amp;gt;set sawtooth&amp;lt;/code&amp;gt;. Both of the connected {{maxword|name=receive~}} objects now get their signal from the {{maxword|name=phasor~}} object in the lower-right corner of the window. Click on the {{maxword|name=message}} boxes containing &amp;lt;code&amp;gt;set outL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;set outR&amp;lt;/code&amp;gt; messages to receive the sinusoidal tones once again. With the &amp;lt;code&amp;gt;sawtooth&amp;lt;/code&amp;gt; destination selected, change the frequency of the {{maxword|name=phasor~}} in the lower-right of the patcher. Notice that when set to an audible frequency, the ramp of the {{maxword|name=phasor~}} object causes it to sound like an oscillator rich in harmonics. This is a ''sawtooth'' wave, a common waveform used in synthesizer design. Because the {{maxword|name=phasor~}} object only ramps from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (and not &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, using a {{maxword|name=phasor~}} as an audio source isn't the best way to get this sound: the MSP {{maxword|name=saw~}} wave will do the trick instead.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
It is possible to make signal connections without patch cords by using the MSP objects {{maxword|name=send~}} and {{maxword|name=receive~}}, which are similar to the Max objects {{maxword|name=send}} and {{maxword|name=receive}}. The &amp;lt;code&amp;gt;set &amp;lt;/code&amp;gt;message can be used to change the name of a {{maxword|name=send~}} or {{maxword|name=receive~}} object, thus switching how signals are routed. Signal flow can be routed to different destinations within a patcher, or shut off entirely, using the {{maxword|name=gate~}} object, which is the MSP equivalent of the Max object {{maxword|name=gate}}.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} object can be used not only for periodic audio waves, but also for sub-audio control functions: you can read through the waveform of a {{maxword|name=cycle~}} object at any rate you wish by keeping its frequency at 0 Hz and changing its phase continuously from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. The {{maxword|name=phasor~}} object is appropriate for changing the phase of a {{maxword|name=cycle~}} waveform in this way; you could also use a {{maxword|name=line~}} object to create a ramp that goes through the object's wavetable.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=sig~}} object converts a number to a constant signal; it receives a number in its inlet and sends out a signal of that value. This is useful for combining constant values with varying signals. Mixing together tones with slightly different frequencies creates interference between waves, which can create beats and other timbral effects.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=gate~}} - Route a signal to one of several outlets&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=receive~}} - Receive signals without patch cords &lt;br /&gt;
&lt;br /&gt;
{{maxword|name=send~}} - Transmit signals without patch cords&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=sig~}} - Constant signal of a number&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=phasor~}} - Sawtooth wave generator 	 [[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_3:_Wavetable_Oscillator</id>
		<title>MSP Basics Tutorial 3: Wavetable Oscillator</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_3:_Wavetable_Oscillator"/>
				<updated>2012-06-25T21:07:00Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;chapter name=&amp;quot;MSP Basics Tutorial 3: Wavetable Oscillator&amp;quot;&amp;gt; Click here to open the tutorial patch: [[03mWavetableOscillator.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
In this tutorial patch, we'll look at how to use a wavetable other than a sine wave to generate sound using the {{maxword|name=cycle~}} object. Along the way, we'll look at how to generate more complex curves using the {{maxword|name=line~}} object, and get a peek at how MSP stores audio data in computer memory using the {{maxword|name=buffer~}} object.&lt;br /&gt;
&lt;br /&gt;
===A stored sound: buffer~===&lt;br /&gt;
&lt;br /&gt;
In the previous examples, the {{maxword|name=cycle~}} object was used to read repeatedly through a set of values describing a cycle of a cosine wave. As it happens, a {{maxword|name=cycle~}} object can read through ''any'' set of values, treating them as a single cycle of a waveform. These numbers must  be stored in our computer's memory, and can be loaded from a soundfile, generated programmatically by an algorithm, or even drawn by hand. The MSP object that maintains these pieces of memory is called {{maxword|name=buffer~}}.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=buffer~}} object can be used easily; it requires a single argument: a name to uniquely identify it. Any audio data stored in that {{maxword|name=buffer~}} becomes associated with that name. The name of the {{maxword|name=buffer~}} is arbitrary and doesn't have to match the name of the audio file loaded into it; the only requirement is that it not conflict with other ''named'' items in open Max patches (such as {{maxword|name=table}} objects or {{maxword|name=send}}/{{maxword|name=receive}} pairs). As you can see, we've named the {{maxword|name=buffer~}} in our tutorial patcher &amp;lt;code&amp;gt;chris&amp;lt;/code&amp;gt;, after our good friend Chris Dobrian, who made the original version of this (and many other) tutorials.&lt;br /&gt;
&lt;br /&gt;
Messages sent to the object allow you to load in audio files, resize, or clear the memory of the {{maxword|name=buffer~}}. The trick is this: the {{maxword|name=buffer~}} object itself doesn't ''play back'' any audio; it simply holds onto the sample data and associates a name with it that {{maxword|name=other}} MSP objects can use to get at the data. A {{maxword|name=cycle~}} object can then be made to read from that {{maxword|name=buffer~}} by typing the same name in as its argument. The initial frequency value for the {{maxword|name=cycle~}} object, just before the buffer name, is optional.&lt;br /&gt;
&lt;br /&gt;
To get the sound into the {{maxword|name=buffer~}}, send it a &amp;lt;code&amp;gt;replace&amp;lt;/code&amp;gt; message, followed by the name of an audio file in the search path of the Max program. If you leave out the name of a file, Max will open an Open Document dialog box, allowing you to select an audio file to load. The &amp;lt;code&amp;gt;replace&amp;lt;/code&amp;gt; message reads in an audio file and automatically ''sizes'' the {{maxword|name=buffer~}} object's memory to match the length of the audio file.&lt;br /&gt;
&lt;br /&gt;
Regardless of the length of the sound in the {{maxword|name=buffer~}}, the {{maxword|name=cycle~}} object will only use a set number of samples from it for its waveform. (If you like, you can specify a starting point in the {{maxword|name=buffer~}} for {{maxword|name=cycle~}} to begin its waveform, either with an additional argument to {{maxword|name=cycle~}} or with a &amp;lt;code&amp;gt;set&amp;lt;/code&amp;gt; message to {{maxword|name=cycle~}}.) In the example patch, we use an audio file that contains exactly 512 samples called &amp;lt;code&amp;gt;gtr512.aiff&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Technical detail: In fact, {{maxword|name=cycle~}}''' uses 513 samples. The 513th sample is used only for interpolation from the 512th sample. When {{maxword|name=cycle~}} is being used to create a periodic waveform, as in this example patch, the 513th sample should be the same as the 1st sample. If the {{maxword|name=buffer~}} contains only 512 samples, as in this example, {{maxword|name=cycle~}} supplies a 513th sample that is the same as the 1st sample.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, click on the {{maxword|name=message}} box that says &amp;lt;code&amp;gt;replace gtr512.aiff&amp;lt;/code&amp;gt;. This loads in the audio file into our {{maxword|name=buffer~}} (named &amp;lt;code&amp;gt;chris&amp;lt;/code&amp;gt;). Then click on the {{maxword|name=ezdac~}} object to turn the audio on. You won't hear anything. Turn up the volume by setting the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;Volume&amp;lt;/code&amp;gt; to something like &amp;lt;code&amp;gt;0.2&amp;lt;/code&amp;gt;. You still won't hear anything. Next, click on the {{maxword|name=message}} box labeled &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;. You should hear a short burst of what sounds like noise. Click on the {{maxword|name=message}} labeled &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;. You should hear a rich oscillating tone fade in and out over a second. Click the other &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; boxes in turn, listening the the result. Notice the different values in the lists being sent to the {{maxword|name=line~}} objects, as well as the different frequencies that the {{maxword|name=cycle~}} objects in the tutorial are set to.&lt;br /&gt;
&lt;br /&gt;
There are several other objects that can use the data in a {{maxword|name=buffer~}}, as you will see in later chapters.&lt;br /&gt;
&lt;br /&gt;
===Creating complex envelopes with line~===&lt;br /&gt;
&lt;br /&gt;
In the previous example patch, we used {{maxword|name=line~}} to make a linearly changing signal by sending it a list of two numbers. The first number in the list was a target value and the second was the amount of time, in milliseconds, for {{maxword|name=line~}} to arrive at the target value.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter03b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''line~ is given a target value (1.) and an amount of time to get there (100 ms)''&lt;br /&gt;
&lt;br /&gt;
If we want to, we can send {{maxword|name=line~}} a longer list containing many value-time pairs of numbers (up to 64 pairs of numbers). In this way, we can make a {{maxword|name=line~}} object perform a more elaborate function composed of many adjoining line segments. After completing the first line segment, {{maxword|name=line~}} proceeds immediately toward the next target value in the list, taking the specified amount of time to get there. In this way, we can great function curves for synthesizers that are commonly referred to as ''envelopes''.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter03c.png|border]]&lt;br /&gt;
&lt;br /&gt;
''A function made up of line segments - a classic 'envelope'''&lt;br /&gt;
&lt;br /&gt;
Synthesizer users are familiar with using this type of function to generate envelopes such as the ‘ADSR’ curves that control the attack, decay, sustain, and release of a sound's amplitude independently. That is what we're doing in this example patch, although we can choose how many line segments we wish to use for the envelope.&lt;br /&gt;
&lt;br /&gt;
* Click on the {{maxword|name=message}} boxes again in sequence and decipher how the lists for each {{maxword|name=line~}} object affect the sound. Note that each &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box begins with a &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; followed by a comma, this sends an individual message of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to the {{maxword|name=line~}} object immediately followed by the subsequent list. Sending a number by itelf to a {{maxword|name=line~}} object causes it to change ''immediately'' to a value. An equivalent notation would be to start our envelope lists with &amp;lt;code&amp;gt;0 0&amp;lt;/code&amp;gt; (go to 0 in 0 milliseconds, i.e. right now).&lt;br /&gt;
&lt;br /&gt;
===Add signals to produce a composite sound===&lt;br /&gt;
&lt;br /&gt;
Any time two or more signals are connected to the same signal inlet, those signals are added together and their sum is used by the receiving object.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter03d.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Multiple signals are added (mixed) in a signal inlet''&lt;br /&gt;
&lt;br /&gt;
Addition of digital signals is equivalent to unity gain mixing in analog audio. It is important to note that even if all your signals have amplitude less than or equal to 1, the sum of such signals can easily exceed 1. In MSP it's fine to have a signal with an amplitude that exceeds 1 anywhere within the signal chain, but before sending the signal to {{maxword|name=dac~}} you must scale it (usually with a {{maxword|name=*~}} object) to keep its amplitude less than or equal to 1. A signal with amplitude greater than 1 will be distorted by {{maxword|name=dac~}}.&lt;br /&gt;
&lt;br /&gt;
In the example patch we're using three different {{maxword|name=cycle~}} objects that are oscillating the waveform stored in the {{maxword|name=buffer~}} named &amp;lt;code&amp;gt;chris&amp;lt;/code&amp;gt;. While up to now we're been playing them all one at a time, they could all be mixed together to produce a composite instrument sound.&lt;br /&gt;
&lt;br /&gt;
* Set the volume of our tutorial patch to a maximum level of &amp;lt;code&amp;gt;0.3&amp;lt;/code&amp;gt; to prevent clipping (remember we're using three different sounds, each with a hypothetical maximum output of 1). Click on the {{maxword|name=button}} at the top of the patcher to play all three signals simultaneously.&lt;br /&gt;
&lt;br /&gt;
Each of the three tones has a different amplitude envelope, causing the timbre of the note to evolve over the course of its 1-second duration. At the same time, even though all three tones are playing from the same sample, they are set to different frequencies, creating a much richer spectrum than exists in the original audio file being used for the wavetable. As we'll see in the next tutorial, mixing wavetables of different frequencies is a key technique in something called ''additive synthesis''.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=ezdac~}} object is a button for switching the audio on and off. The {{maxword|name=buffer~}} object stores a sound in the computer's memory. You can load an audio file into {{maxword|name=buffer~}} with a &amp;lt;code&amp;gt;replace&amp;lt;/code&amp;gt; message. If a {{maxword|name=cycle~}} object has a typed-in argument which gives it the same name as a {{maxword|name=buffer~}} object, the {{maxword|name=cycle~}} will use the samples from that {{maxword|name=buffer~}} as its waveform instead of the default cosine wave.&lt;br /&gt;
&lt;br /&gt;
Whenever you connect more than one signal to a given signal inlet, the receiving object adds those signals together and uses the sum as its input in that inlet. Exercise care when mixing (adding) audio signals, to avoid distortion caused by sending a signal with amplitude greater than 1 to the {{maxword|name=dac~}}.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=line~}} object can receive a list in its left inlet that consists of up to 64 pairs of numbers representing target values and transition times. It will produce a signal that changes linearly from one target value to another in the specified amounts of time. This can be used to make a function of line segments describing any shape desired, which is particularly useful as a control signal for amplitude envelopes. You can achieve crossfades between signals by using different amplitude envelopes from different {{maxword|name=line~}} objects.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=buffer~}} - Store audio samples&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=ezdac~}} - Audio output and on/off button 	 [[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_2:_Adjustable_Oscillator</id>
		<title>MSP Basics Tutorial 2: Adjustable Oscillator</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_2:_Adjustable_Oscillator"/>
				<updated>2012-06-25T21:05:59Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[02mAdjustableOscillator.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
&lt;br /&gt;
In this tutorial we'll look at how to control the amplitude of signals we work with in MSP. In addition, we'll look at an object that helps us generate signal ramps from Max messages that we can use to smoothly control the parameters of MSP objects.&lt;br /&gt;
&lt;br /&gt;
===Amplifier: *~===&lt;br /&gt;
&lt;br /&gt;
As we saw in our last tutorial, the {{maxword|name=dac~}} object represents the final ''output'' of our audio signal network; anything you want to come out of your speakers (or into your headphones) needs to eventually find its way to a {{maxword|name=ezdac~}} object. Now, any signal you want to listen to - a signal you send to {{maxword|name=ezdac~}} - must be in the amplitude range from -1.0 to +1.0. Any values exceeding those bounds will be clipped by the {{maxword|name=ezdac~}} (i.e. sharply limited to 1 or -1). This will cause (in most cases pretty objectionable) distortion of the sound. Most MSP objects that '''generate''' sound do so in the range of -1.0 to 1.0:&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter02a.png|border]]&lt;br /&gt;
&lt;br /&gt;
''The default output of cycle~ has amplitude of 1''&lt;br /&gt;
&lt;br /&gt;
As a result, learning to adjust their amplitude is important so that we have control over the volume that we're sending to the output.&lt;br /&gt;
&lt;br /&gt;
To control the level of a signal you simply multiply each sample by a scaling factor. For example, to halve the amplitude of a signal you simply multiply it by 0.5. (Although it would be mathematically equivalent to divide the amplitude of the signal by 2, multiplication is a more efficient computation procedure than division.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter02b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Amplitude adjusted by multiplication''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=*~}} object in MSP multiplies the signal in its left inlet by whatever comes into the right. This can be a constant number or a signal. If we wish to change the amplitude of a signal continuously over time, we can supply a changing signal in the right inlet of {{maxword|name=*~}}. By continuously changing the value in the right inlet of {{maxword|name=*~}}, we can fade the sound in or out, create a crescendo or diminuendo effect, etc.&lt;br /&gt;
&lt;br /&gt;
* In the tutorial patcher, start the audio by clicking the {{maxword|name=message}} box labeled &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;. You won't hear anything yet, because the {{maxword|name=*~}} objects in the patch are multiplying their input by &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, resulting in silence. In the patcher area labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, type the number &amp;lt;code&amp;gt;300&amp;lt;/code&amp;gt; into the floating-point {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;Frequency&amp;lt;/code&amp;gt;. In the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;Amplitude&amp;lt;/code&amp;gt;, type &amp;lt;code&amp;gt;0.2&amp;lt;/code&amp;gt;. You should hear a 300 Hz sine wave playing softly out of your audio device.&lt;br /&gt;
&lt;br /&gt;
Click in the &amp;lt;code&amp;gt;Amplitude&amp;lt;/code&amp;gt; {{maxword|name=number}} box to the '''right''' of the decimal point and drag the value up and down. You should hear the sine wave fade in and out in volume, just as it did in the last tutorial when we manipulated the {{maxword|name=gain~}} slider. However, you may hear something less pleasant as you change the volume, namely a series of clicks in the sound. This is called ''zipper noise'', and results from sudden drastic changes in amplitude which cause discontinuities in the signal:&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter02c.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Instantaneous change of amplitude causes a noisy distortion of the signal''&lt;br /&gt;
&lt;br /&gt;
Before we address that problem, set the volume in the {{maxword|name=number}} box to a comfortable amplitude, and drag in the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;Frequency&amp;lt;/code&amp;gt;. As you hear the oscillator's pitch rise and fall, you may also hear a form of zipper noise do to the sudden changes in frequency. If we're going to be continuously controlling either of these parameters (the frequency of the {{maxword|name=cycle~}} object or the amplitude output by the {{maxword|name=*~}} object), we may want to modify those parameters using a signal instead of sending Max messages.&lt;br /&gt;
&lt;br /&gt;
===Line segment generator: line~===&lt;br /&gt;
&lt;br /&gt;
Take a look at the right-hand piece of patcher logic in the tutorial (labeled &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;). If, instead of an instantaneous change of amplitude (which can cause an objectionable distortion of the signal), we supply a ''signal'' in the right inlet of the {{maxword|name=*~}} object that changes over the course of 500 milliseconds, we interpolate between the starting amplitude and the target amplitude with each sample, creating a smooth amplitude change.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=line~}} object functions similarly to the Max object {{maxword|name=line}}. In its left inlet it receives a target value and a time (in ms) to reach that target. The {{maxword|name=line~}} object calculates the proper intermediate value for each sample in order to change in a straight line from its current value to the target value.&lt;br /&gt;
&lt;br /&gt;
* Turn down the volume on the left-hand audio circuit in the tutorial patcher by typing &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; into the &amp;lt;code&amp;gt;Amplitude&amp;lt;/code&amp;gt; {{maxword|name=number}} box. In the right-hand part of the tutorial patcher, set the &amp;lt;code&amp;gt;Frequency&amp;lt;/code&amp;gt; of the {{maxword|name=cycle~}} object to &amp;lt;code&amp;gt;300&amp;lt;/code&amp;gt;. Then, clicking in the {{maxword|name=number}} box labeled &amp;lt;code&amp;gt;Amplitude&amp;lt;/code&amp;gt;, set the volume to &amp;lt;code&amp;gt;0.3&amp;lt;/code&amp;gt;. Rather than the sound immediately coming on as before, you should hear the sine wave fade in over half a second. If you drag within the {{maxword|name=number}} box, you should feel that the volume is ''chasing'' your actions, smoothly interpolating between values as if you were slowly manipulating a volume knob on an amplifier.&lt;br /&gt;
&lt;br /&gt;
The second value of the value/time pair we send to the {{maxword|name=line~}} object determines the smoothness of the transition. If we feel that the volume control isn't quite responsive enough, it's easily changed by playing with the transition value.&lt;br /&gt;
&lt;br /&gt;
* Unlock the patcher and change the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box connected to the {{maxword|name=line~}} object controlling the &amp;lt;code&amp;gt;Amplitude&amp;lt;/code&amp;gt;. If you'd like a quicker fade, try changing it to read &amp;lt;code&amp;gt;$1 50&amp;lt;/code&amp;gt;. When you lock the patch and manipulate the {{maxword|name=number}} box again, you should feel that the volume is changing much more responsively to your commands.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Technical detail: '''Any change in the over-all amplitude of a signal introduces some amount of distortion during the time when the amplitude is changing. (The shape of the waveform is actually changed during that time, compared with the original signal.) Whether this distortion is objectionable depends on how sudden the change is, how great the change in amplitude is, and how complex the original signal is. A small amount of such distortion introduced into an already complex signal may go largely unnoticed by the listener. Conversely, even a slight distortion of a very pure original signal will add partials to the tone, thus changing its timbre.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Adjustable oscillator===&lt;br /&gt;
&lt;br /&gt;
The patcher logic on the right uses a combination of {{maxword|name=*~}} and {{maxword|name=line~}} to make an adjustable amplifier for scaling the amplitude of the oscillator. However, the {{maxword|name=line~}} object can output signals that can be used to control a lot of things... not just volume.&lt;br /&gt;
&lt;br /&gt;
* With the volume on the right-hand patcher logic raised, adjust the {{maxword|name=number box}} labeled &amp;lt;code&amp;gt;Frequency&amp;lt;/code&amp;gt;. Try typing in a value distant from the current one, e.g. make the frequency jump from 300 to 1000 Hz. Notice that, unlike in the left-hand example, the frequency smoothly transitions over 500 milliseconds.&lt;br /&gt;
&lt;br /&gt;
As with the amplitude control, the {{maxword|name=line~}} object is sending a signal that smoothly transitions based on value/time commands sent to it by Max messages. By controlling the frequency of the oscillator in this way, we've created a gliding effect referred to in synthesizer design (and instrument performance) as ''portamento''. If you think the transition is too slow for your tastes, unlock the patcher and change the &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; box so that you have a shorter transition time. See how short you can make it so that the portamento disappears but you still avoid hearing any clicks in during a frequency change.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Multiplying each sample of an audio signal by some number other than 1 changes its amplitude; therefore the {{maxword|name=*~}} object is effectively an amplifier. A sudden drastic change of amplitude can cause a click, so a more gradual fade of amplitude - by controlling the amplitude with another signal - is usually advisable. The segment signal generator {{maxword|name=line~}} is comparable to the Max object {{maxword|name=line}} and is appropriate for providing a linearly changing value to the signal network. The combination of {{maxword|name=line~}} and {{maxword|name=*~}} can be used to make an ''envelope'' for controlling the over-all amplitude of a signal. In addition, a {{maxword|name=line~}} object can be used to smoothly control the parameters of nearly any MSP object, such as the frequency of a {{maxword|name=cycle~}} oscillator.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=cycle~}} - Table lookup oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=ezdac~}} - Audio output and on/off&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=line~}} - Linear ramp generator&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_1:_Test_Tone</id>
		<title>MSP Basics Tutorial 1: Test Tone</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Basics_Tutorial_1:_Test_Tone"/>
				<updated>2012-06-25T21:04:58Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[01mTestTone.maxpat]]&lt;br /&gt;
&lt;br /&gt;
===MSP objects are pretty much like Max objects===&lt;br /&gt;
&lt;br /&gt;
MSP objects are for processing digital audio (i.e., sound) to be played by your computer. MSP objects look just like Max objects, have inlets and outlets just like Max objects, and are connected together with patch cords just like Max objects. They are created the same way as Max objects - just by placing an object box in the Patcher window and typing in the desired name - and they co-exist quite happily with Max objects in the same Patcher window.&lt;br /&gt;
&lt;br /&gt;
===...but they're a little different.===&lt;br /&gt;
&lt;br /&gt;
A patcher containing interconnected MSP objects works a little differently from a patcher containing standard Max objects.&lt;br /&gt;
&lt;br /&gt;
One way to think of the difference is just to think of MSP objects as working much faster than ordinary Max objects. Since MSP objects need to produce enough numbers to generate a high fidelity audio signal (commonly 44,100 numbers per second), they must work faster than the scheduler used by standard Max objects, which typically runs around a thousand times per second.&lt;br /&gt;
&lt;br /&gt;
Here's another helpful way to think of the difference. Think of a patch of MSP objects not as a program in which events occur at specific instants (as in a standard Max patch), but rather as a description of an instrument design - a synthesizer, sampler, or effect processor. It's like a mathematical formula, with each object constantly providing numerical values to the object(s) connected to its outlet. At any given instant in time, this formula has a result, which is the instantaneous amplitude of the audio signal. This is why we frequently refer to an ensemble of inter-connected MSP objects as a ''signal network''.&lt;br /&gt;
&lt;br /&gt;
So, whereas a patch made up of standard Max objects sits idle and does nothing until something occurs (a mouse click, an incoming MIDI message, the clock firing on a {{maxword|name=metro}} object, etc.) causing one object to send a message to another object, a signal network of MSP objects, by contrast, is always active (from the time it's turned on to the time it's turned off), with all its objects constantly communicating to calculate the appropriate amplitude for the sound at that instant.&lt;br /&gt;
&lt;br /&gt;
===...so they look a little different===&lt;br /&gt;
&lt;br /&gt;
The names of all MSP objects end with the tilde character (''~''). This character, which looks like a cycle of a sine wave, just serves as an indicator to help you distinguish MSP objects from other Max objects.&lt;br /&gt;
&lt;br /&gt;
The patch cords between MSP objects have stripes. This helps you distinguish the MSP signal network from the rest of the Max patch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter01a.png|border]]&lt;br /&gt;
&lt;br /&gt;
MSP objects are connected by striped patch cords''&lt;br /&gt;
&lt;br /&gt;
Take a look at the tutorial patcher. You'll see that we have six items of our patcher's canvas. Three of them should be familiar to you: we've got a Max {{maxword|name=comment}} box (&amp;quot;warning:loud&amp;quot;) and two {{maxword|name=message}} boxes labelled &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt;. The bulk of the patcher logic consists of three objects we've never seen before: a {{maxword|name=cycle~}} object, an {{maxword|name=ezdac~}} object, and something that looks suspiciously like a {{maxword|name=slider}} object but is actually a {{maxword|name=gain~}} object. Let's look at these objects in turn, starting with the {{maxword|name=dac~}} at the bottom of the patcher and returning from there to the top of the chain.&lt;br /&gt;
&lt;br /&gt;
===Digital-to-analog converter: ezdac~===&lt;br /&gt;
&lt;br /&gt;
''The digital-to-analog converter'' (DAC) is the part of your computer that translates the stream of discrete numbers in a digital audio signal into a continuous fluctuating voltage which will drive your loudspeaker.&lt;br /&gt;
&lt;br /&gt;
Once you have calculated a digital signal to make a computer-generated sound, you must send the numbers to the DAC. So, MSP has an object called {{maxword|name=ezdac~}}. This object is generally the terminal object in any signal network, and is required for any signals generated by MSP to make it out of your computer as sound. The {{maxword|name=ezdac~}} object receives the signals you wish to hear in its inlets, and has a stereo configuration  talking to the first two channels of your audio hardware - this is why there  are two inlets on the {{maxword|name=ezdac~}} in our patcher. If you were using more elaborate audio output hardware that required more than two channels, you would use the {{maxword|name=ezdac~}} object's  cousin the {{maxword|name=dac~}} object, which lets you specify other audio  channels as outlets using typed-in arguments.&lt;br /&gt;
&lt;br /&gt;
'''Important!''' {{maxword|name=ezdac~}} must be receiving a signal of non-zero amplitude in order for you to hear anything. {{maxword|name=ezdac~}} expects to receive signal values in the range -1.0 to 1.0. Numbers that exceed that range will cause distortion when the sound is played.&lt;br /&gt;
&lt;br /&gt;
===A simple wavetable oscillator: {{maxword|name=cycle~}}===&lt;br /&gt;
&lt;br /&gt;
The best way to produce a periodic waveform is with {{maxword|name=cycle~}}. This object uses the technique known as ‘wavetable synthesis’. It reads through a list of 512 values at a specified rate, looping back to the beginning of the list when it reaches the end. This simulates a periodically repeating waveform.&lt;br /&gt;
&lt;br /&gt;
You can direct {{maxword|name=cycle~}} to read from a list of values that you supply (in the form of an audio file), or if you don't supply one, it will read through its own table which represents a cycle of a cosine wave with an amplitude of 1. We'll show you how to supply your own waveform in a later tutorial; for now we'll use the cosine waveform.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter01b.png|border]]&lt;br /&gt;
&lt;br /&gt;
''Graph of 512 numbers describing one cycle of a cosine wave with amplitude 1''&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} object receives a frequency value (in Hz) in its left inlet, and it determines on its own how fast it should read through the list in order to send out a signal with the desired frequency.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Technical detail: '''To figure out how far to step through the list for each consecutive sample, {{maxword|name=cycle~}} uses the basic formula&lt;br /&gt;
&lt;br /&gt;
I=ƒL/R&lt;br /&gt;
&lt;br /&gt;
where ''I'' is the amount to increment through the list, ''ƒ'' is the signal's frequency, ''L'' is the length of the list (512 in this case), and ''R'' is the audio sampling rate. {{maxword|name=cycle~}} is an ‘interpolating oscillator’, which means that if ''I'' does not land exactly on an integer index in the list for a given sample, the {{maxword|name=cycle~}} object interpolates between the two closest numbers  in the list to find the proper output value. Performing interpolation in a wavetable  oscillator makes a substantial improvement in audio quality. The {{maxword|name=cycle~}}  object uses linear interpolation, while other MSP objects use very high-quality (and  more computationally expensive) polynomial interpolation.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=cycle~}} object has a default frequency of 0 Hz. So in order to hear the signal, we need to supply an audible frequency value. This can be done with a number argument as in the example patch, or by sending a number in the left inlet, or by connecting another MSP object to the left inlet. If we listen to the output of this signal with its frequency set in an audioble range, we should hear a sine wave, the purest (in terms of spectrum) sound that we can make.&lt;br /&gt;
&lt;br /&gt;
===A volume control: {{maxword|name=gain~}}===&lt;br /&gt;
&lt;br /&gt;
If we were to directly connect our {{maxword|name=cycle~}} object to a {{maxword|name=dac~}} object and start the audio, we could easily damage our speakers or, more importantly, our ears. MSP objects that generate audio (such as {{maxword|name=cycle~}}) generally do so at a normalized dynamic range of -1 to 1, which the {{maxword|name=dac~}} object will interpret as being the loudest signal possible. To avoid these dangers, it's important to have an object in-between to control the amplitude of the signal going to our speakers. The {{maxword|name=gain~}} slider performs just such a function:&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter01c.png|border]]&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=gain~}} slider in the Explorer&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=gain~}} slider ''multiplies'' its incoming signal by a factor based on the position of the slider which, for all but the uppermost reaches of the object, is a number less than 1. As a result, the {{maxword|name=gain~}} object almost always ''attenuates'' (or turns down) the volume of what comes in, much like a fader on an analog mixing desk. The {{maxword|name=gain~}} object is in several ways a graphical version of a {{maxword|name=*~}} object, which we'll look at in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
===Starting and stopping signal processing===&lt;br /&gt;
&lt;br /&gt;
In this set of tutorials, we're using the {{maxword|name=ezdac~}} object to turn audio off and on our patches. While it's great to be able to click on the icon and to see whether or not audio is on in the Patcher window, the The {{maxword|name=ezdac~}} object is hard-wired to output channels 1 and 2 on your audio device, which might not make it appropriate for working with multi-channel sound. For our tutorials, however, it should be fine.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=ezdac~}} object is one of five MSP objects (along with {{maxword|name=adc~}},  {{maxword|name=ezadc~}} and {{maxword|name=ezdac~}}, and {{maxword|name=adstatus}}) that can turn on and off the MSP audio network from ''within'' your patcher. There are two common ways of turning audio on and off used in these tutorials - by  clicking on the {{maxword|name=ezdac~}} object in a patch, or sending a &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to the left inlet of a {{maxword|name=ezdac~}} object (or an {{maxword|name=ezadc~}} object).&lt;br /&gt;
&lt;br /&gt;
'''Important!''' Since you generally don't want to  enable or disable processing for '''all''' open signal networks in '''all''' currently open Max patchers (which might mean you'd hear things you don't expect) the {{maxword|name=ezdac~}} object has an attribute called ''local'' which can be set using the Inspector. When the ''local'' attribute is enabled, turning audio on or off will only affect the local Max patch (and its subpatches).&lt;br /&gt;
&lt;br /&gt;
[[Image:images/localattribute.png|border]]&lt;br /&gt;
&lt;br /&gt;
Although {{maxword|name=ezdac~}} is part of a signal network, it also understands certain Max messages, such as &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Many MSP objects function in this manner, accepting certain Max messages as well as audio signals.&lt;br /&gt;
&lt;br /&gt;
===Listening to the Test Tone===&lt;br /&gt;
&lt;br /&gt;
The first time you start up Max, it will try to use your computer's default sound card and driver (CoreAudio on Macintosh or MME on Windows) for audio input and output. If you have the audio output of your computer connected to headphones or an amplifier, you should hear the output of MSP through it. If you don't have an audio cable connected to your computer, you'll hear the sound through the computer's internal speaker.&lt;br /&gt;
&lt;br /&gt;
In order to get MSP up and running properly, we recommend that you start the tutorials using your computer's built-in sound hardware. If you want to use an external audio interface or sound card, please refer to the Audio Input and Output chapter for details on configuring MSP to work with audio hardware.&lt;br /&gt;
&lt;br /&gt;
* Set your audio amplifier (or amplified speakers) to their minimum setting, then click on the {{maxword|name=ezdac~}} object in the tutorial patcher. Click and drag on the {{maxword|name=gain~}} slider until it's set to somewhere in the middle of its length. Adjust your audio amplifier to a comfortable setting. Once you're satisfied that the patcher is working, click on the {{maxword|name=ezdac~}} object to turn off that annoying test tone.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
&lt;br /&gt;
If you don't hear any sound coming from your computer when you click on the {{maxword|name=ezdac~}} in this example and turn up the {{maxword|name=gain~}} slider, check the level setting on your amplifier or mixer, and check all your audio connections. Check that the sound output isn't currently muted. On Macintosh, the sound output level is set using the Sound preferences in the System Preferences application. On Windows, the sound output level is set using the Sounds and Audio Devices setup (Start - Control Panels - Sounds and Audio Devices).&lt;br /&gt;
&lt;br /&gt;
If you are still are not hearing anything, choose '''Audio Status''' from the Options Menu and verify that the Core Audio Built in Controller for Macintosh or MME driver for Windows is selected in the Driver pop-up menu. If it isn't, choose it.&lt;br /&gt;
&lt;br /&gt;
[[Image:Basicchapter01d.png|border]]&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
A ''signal network'' of connected MSP objects describes an audio instrument. The digital-to-analog converter of the instrument is represented by the {{maxword|name=ezdac~}} object; {{maxword|name=ezdac~}} must be receiving a signal of non-zero amplitude (in the range -1.0 to 1.0) in order for you to hear anything. The {{maxword|name=cycle~}} object is a wavetable oscillator which reads cyclically through a list of amplitude values, at a rate determined by the supplied frequency value. Signal processing is turned on and off by clicking on the object or by sending a &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; message to it.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=cycle~}} - Table lookup oscillator&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=gain~}} - Exponential scaling volume slider&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=ezdac~}} - Audio output and on/off&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_5:_Parallel_Filters</id>
		<title>MSP Filter Tutorial 5: Parallel Filters</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_5:_Parallel_Filters"/>
				<updated>2012-06-25T21:03:52Z</updated>
		
		<summary type="html">&lt;p&gt;Admin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Click here to open the tutorial patch: [[05fParallelFilters.maxpat]]		&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we'll look at creating ''networks'' of filters to make complex, time-varying timbres using an oscillator input.&lt;br /&gt;
&lt;br /&gt;
===The impulse===&lt;br /&gt;
&lt;br /&gt;
Look at the tutorial patch. It contains a few sound-producing objects connected to a network of filter objects: three {{maxword|name=reson~}} objects in parallel and a {{maxword|name=lores~}} object in series with their outputs. The audio input for the filter network comes from a {{maxword|name=receive~}} object named &amp;lt;code&amp;gt;filterin&amp;lt;/code&amp;gt;, allowing us to generate signals for our filters remotely.&lt;br /&gt;
&lt;br /&gt;
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. At the bottom of the patcher, adjust the {{maxword|name=number}} box labeled 'Dry Volume'. In the area of the patcher labeled &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, click the {{maxword|name=button}} attached to the {{maxword|name=click~}} object. As per its name, you should hear a click!&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=click~}} object generates a constant signal of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;. When you sent it a &amp;lt;code&amp;gt;bang&amp;lt;/code&amp;gt; message, it outputs a ''single sample'' of value &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, then returns to sending &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;'s. This is called an ''impulse'', and in an idea world generates an eve. spread of energy across all frequencies; we could think of it as the shortest possible burst of white noise we can create in our digital system. Sending a click through a filter returns a sound that has the exact frequency characteristics of that filter. We call this taking the ''impulse response'' of a signal chain.&lt;br /&gt;
&lt;br /&gt;
* Click on a note in the {{maxword|name=kslider}} object at the top of the tutorial patcher in the area labeled &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. You should hear a sawtooth wave fade in and out with a smooth envelope.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=saw~}} object in our patcher is in a signal chain where it has an envelope (controlled by a {{maxword|name=function}}, a {{maxword|name=line~}}, and a {{maxword|name=*~}} object). If we adjust the {{maxword|name=function}} object, we can change the shape of the note that gets fired each time we click on a key in the {{maxword|name=kslider}} object.&lt;br /&gt;
&lt;br /&gt;
===A network of filters===&lt;br /&gt;
&lt;br /&gt;
* Turn down the 'Dry Volume' and turn up the {{maxword|name=number}} box labeled 'Filtered Volume' at the bottom of the patcher. In the patcher area labeled &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;, click in the {{maxword|name=number}} box labeled 'Vowel'. Enter &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in the {{maxword|name=number}} box and hit return. The &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects connected to the {{maxword|name=line~}} objects below should read &amp;lt;code&amp;gt;270., 2290., and 3010.&amp;lt;/code&amp;gt;. Click on the {{maxword|name=kslider}} to play some notes. Click in the 'Vowel' {{maxword|name=number}} box and enter different values between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt; and listen to the results. Double-click the {{maxword|name=coll}} object named &amp;lt;code&amp;gt;formants&amp;lt;/code&amp;gt; and look at the contents.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=coll}} object in our patcher contains ten lists of frequency values which correspond to the average ''formats'' for vowels in the English language (&amp;quot;ooo&amp;quot;, &amp;quot;eee&amp;quot;, &amp;quot;ah&amp;quot;, etc.). In human speech, our lungs project air through our vocal chords, which modulate the air pressure into a regular waveform. Our mouth shapes this waveform, filtering the signal based on the shape of our mouth. These vocalizations can be modeled as sets of three bandpass filters tuned to different frequencies, creating a simalcrum of the sound our voice makes. The shaping of a sound in this manner is called ''formant'' filtering, and can be created in MSP using the circuit in our tutorial patcher.&lt;br /&gt;
&lt;br /&gt;
* In the lower-right of the tutorial patcher, adjust the {{maxword|name=number}} box labeled 'Q' to &amp;lt;code&amp;gt;30.&amp;lt;/code&amp;gt;. Click the {{maxword|name=toggle}} box attached to the {{maxword|name=metro}} object above labeled &amp;lt;code&amp;gt;Random?&amp;lt;/code&amp;gt;. Play some notes on the {{maxword|name=kslider}}.&lt;br /&gt;
&lt;br /&gt;
Tightening the Q on our format filters makes the sound more obviously 'vocal', as the resonation of the filters cuts out any extraneous energy from our sawtooth waveform.&lt;br /&gt;
&lt;br /&gt;
* In the patcher area labeled &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;, adjust the {{maxword|name=number}} box labeled 'Cutoff frequency' to &amp;lt;code&amp;gt;5000&amp;lt;/code&amp;gt;. Play some notes. Adjust it down to something low, like &amp;lt;code&amp;gt;200&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The output of our formant filters feed into a lowpass filter controlled by a {{maxword|name=lores~}} object. This cuts the treble from out sawtooth after it passes through the bandpass network of the {{maxword|name=reson~}} objects. Changing this value also changes the quality of the vocal model.&lt;br /&gt;
&lt;br /&gt;
* Adjust the values of the patcher to experiment with different ways to create a 'singing voice' out of a sawtooth wave and a filter network. The {{maxword|name=line~}} objects in the patcher attached to the filters control the interpolation between settings. If you unlock the patcher and change the second value in the {{maxword|name=message}} boxes, you can make the transitions smoother or more abrubt. Using the {{maxword|name=click~}} object, see how the different filter settings sound when driven by an impulse.		&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
The filter objects in MSP can be connected into networks of filters that can be used in all manner of interesting ways. Bandpass filters (such as {{maxword|name=reson~}}) can be used in parallel to simulate the 'formants' of instruments or human speech. The {{maxword|name=click~}} object allows you to test the ''impulse response'' of a filter network by sending a single positive sample through it, generating a pure impression of the frequency response of the filter.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=click~}} - Create an impulse&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>