<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://cycling74.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;feed=atom&amp;action=history</id>
		<title>MSP Dynamics Tutorial 3: Distortion - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;action=history"/>
		<updated>2013-05-21T18:47:06Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;diff=823&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 15:30, 28 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;diff=823&amp;oldid=prev"/>
				<updated>2012-06-28T15:30:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:30, 28 June 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patch: [[03nDistortion.maxpat]]		&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patch: [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Media:&lt;/ins&gt;03nDistortion.maxpat]]		&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;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;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;diff=771&amp;oldid=prev</id>
		<title>Admin at 21:13, 25 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;diff=771&amp;oldid=prev"/>
				<updated>2012-06-25T21:13:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://cycling74.com/wiki/index.php?title=MSP_Dynamics_Tutorial_3:_Distortion&amp;amp;diff=771&amp;amp;oldid=719&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Admin</name></author>	</entry>

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

	</feed>