rsc3/doc-schelp/Help-3.12.2/Classes/AllpassN.html

94 lines
7 KiB
HTML
Raw Normal View History

2022-08-24 13:53:18 +00:00
<!doctype html><html lang='en'><head><title>AllpassN | SuperCollider 3.9.3 Help</title>
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
<link rel='stylesheet' href='./../custom.css' type='text/css' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script>
var helpRoot = './..';
var scdoc_title = 'AllpassN';
var scdoc_sc_version = '3.9.3';
</script>
<script src='./../scdoc.js' type='text/javascript'></script>
<script src='./../docmap.js' type='text/javascript'></script>
<script src='./../prettify.js' type='text/javascript'></script>
<script src='./../lang-sc.js' type='text/javascript'></script>
</head>
<body onload='fixTOC();prettyPrint()'>
<div id='toc'>
<div id='toctitle'>AllpassN:</div>
<span class='toc_search'>Filter: <input id='toc_search'></span><ul class='toc'><li class='toc1'><a href='#description'>Description</a></li>
<ul class='toc'></ul><li class='toc1'><a href='#classmethods'>Class methods</a></li>
<ul class='toc'><li class='toc3'><a href='#*ar'>ar</a> <a href='#*kr'>kr</a> </li>
<li class='toc2'><a href='#Inherited%20class%20methods'>Inherited class methods</a></li>
</ul><li class='toc1'><a href='#instancemethods'>Instance methods</a></li>
<ul class='toc'><li class='toc2'><a href='#Inherited%20instance%20methods'>Inherited instance methods</a></li>
</ul><li class='toc1'><a href='#examples'>Examples</a></li>
<ul class='toc'></ul></ul></div><div class='contents'>
<div id='menubar'></div>
<div class='header'>
<div id='label'>
<span id='folder'>Classes</span>
| <span id='categories'><a href='./../Browse.html#UGens'>UGens</a>&#8201;&gt;&#8201;<a href='./../Browse.html#UGens>Delays'>Delays</a></span>
</div><h1>AllpassN<span id='superclasses'> : <a href="../Classes/CombN.html">CombN</a> : <a href="../Classes/PureUGen.html">PureUGen</a> : <a href="../Classes/UGen.html">UGen</a> : <a href="../Classes/AbstractFunction.html">AbstractFunction</a> : <a href="../Classes/Object.html">Object</a></span>
</h1>
<div id='summary'>Schroeder allpass delay line with no interpolation.</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Delays.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Delays.sc'>Delays.sc</a></div><div id='related'>See also: <a href="./../Classes/AllpassC.html">AllpassC</a>, <a href="./../Classes/AllpassL.html">AllpassL</a>, <a href="./../Classes/BufAllpassN.html">BufAllpassN</a></div>
</div>
<h2><a class='anchor' name='description'>Description</a></h2>
<p>A Schroeder allpass filter is given by the difference equations<pre class='code prettyprint lang-sc'>s(t) = x(t) + k * s(t - D)
y(t) = -k * s(t) + s(t - D)</pre>
<p>where <code class='code prettyprint lang-sc'>x(t)</code> is the input signal, <code class='code prettyprint lang-sc'>y(t)</code> is the output signal, <code class='code prettyprint lang-sc'>D</code> is the delay time, and <code class='code prettyprint lang-sc'>k</code> is the allpass coefficient.
<p>In this UGen, <code class='code prettyprint lang-sc'>k</code> is computed as <code class='code prettyprint lang-sc'>k == 0.001 ** (delay / decay.abs) * decay.sign</code> (0.001 is -60 dBFS).
<p>This UGen quantizes the delay time to the nearest sample period, and will produce aliasing artifacts if the delay time is modulated. If these are undesirable properties, the more CPU-expensive alternatives are <a href="./../Classes/AllpassL.html">AllpassL</a> which uses linear interpolation, and <a href="./../Classes/AllpassC.html">AllpassC</a> which uses cubic interpolation.<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3 class='method-code'><span class='method-prefix'>AllpassN.</span><a class='method-name' name='*ar' href='./../Overviews/Methods.html#ar'>ar</a>(<span class='argstr'>in: 0</span>, <span class='argstr'>maxdelaytime: 0.2</span>, <span class='argstr'>delaytime: 0.2</span>, <span class='argstr'>decaytime: 1</span>, <span class='argstr'>mul: 1</span>, <span class='argstr'>add: 0</span>)</h3>
<div class='supmethod'>From superclass: <a href='./../Classes/CombN.html'>CombN</a></div>
<h3 class='method-code'><span class='method-prefix'>AllpassN.</span><a class='method-name' name='*kr' href='./../Overviews/Methods.html#kr'>kr</a>(<span class='argstr'>in: 0</span>, <span class='argstr'>maxdelaytime: 0.2</span>, <span class='argstr'>delaytime: 0.2</span>, <span class='argstr'>decaytime: 1</span>, <span class='argstr'>mul: 1</span>, <span class='argstr'>add: 0</span>)</h3>
<div class='supmethod'>From superclass: <a href='./../Classes/CombN.html'>CombN</a></div>
<div class='method'>
<p><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>in<td class='argumentdesc'>
<p>The input signal.<tr><td class='argumentname'>maxdelaytime<td class='argumentdesc'>
<p>The maximum delay time in seconds. Used to initialize the delay buffer size.<tr><td class='argumentname'>delaytime<td class='argumentdesc'>
<p>Delay time in seconds.<tr><td class='argumentname'>decaytime<td class='argumentdesc'>
<p>Time for the echoes to decay by 60 decibels. If this time is negative, then the feedback coefficient will be negative, thus emphasizing only odd harmonics at an octave lower.<tr><td class='argumentname'>mul<td class='argumentdesc'>
<p>Output will be multiplied by this value.<tr><td class='argumentname'>add<td class='argumentdesc'>
<p>This value will be added to the output.</table></div><h3><a class='anchor' name='Inherited%20class%20methods'>Inherited class methods</a></h3>
<div id='inheritedclassmets'></div><h2><a class='anchor' name='instancemethods'>Instance Methods</a></h2>
<h3><a class='anchor' name='Inherited%20instance%20methods'>Inherited instance methods</a></h3>
<div id='inheritedinstmets'></div><h2><a class='anchor' name='examples'>Examples</a></h2>
<pre class='code prettyprint lang-sc'>// Since the allpass delay has no audible effect as a resonator on
// steady state sound ...
{ AllpassN.ar(WhiteNoise.ar(0.1), 0.01, XLine.kr(0.0001, 0.01, 20), 0.2) }.play;
// ...these examples add the input to the effected sound and compare variants so that you can hear
// the effect of the phase comb:
(
{
z = WhiteNoise.ar(0.2);
z + AllpassN.ar(z, 0.01, XLine.kr(0.0001, 0.01, 20), 0.2)
}.play)
(
{
z = WhiteNoise.ar(0.2);
z + AllpassL.ar(z, 0.01, XLine.kr(0.0001, 0.01, 20), 0.2)
}.play)
(
{
z = WhiteNoise.ar(0.2);
z + AllpassC.ar(z, 0.01, XLine.kr(0.0001, 0.01, 20), 0.2)
}.play)
// used as an echo - doesn't really sound different than Comb,
// but it outputs the input signal immediately (inverted) and the echoes
// are lower in amplitude.
{ AllpassN.ar(Decay.ar(Dust.ar(1,0.5), 0.2, WhiteNoise.ar), 0.2, 0.2, 3) }.play;</pre>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/AllpassN.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/AllpassN.schelp</a><br>link::Classes/AllpassN::<br></div></div></body></html>