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

86 lines
5.2 KiB
HTML
Raw Normal View History

2022-08-24 13:53:18 +00:00
<!doctype html><html lang='en'><head><title>LinCongC | 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 = 'LinCongC';
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'>LinCongC:</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> </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>Generators'>Generators</a>&#8201;&gt;&#8201;<a href='./../Browse.html#UGens>Generators>Chaotic'>Chaotic</a></span>
</div><h1>LinCongC<span id='superclasses'> : <a href="../Classes/LinCongN.html">LinCongN</a> : <a href="../Classes/ChaosGen.html">ChaosGen</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'>Linear congruential chaotic generator</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Chaos.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Chaos.sc'>Chaos.sc</a></div><div id='related'>See also: <a href="./../Classes/LinCongN.html">LinCongN</a>, <a href="./../Classes/LinCongL.html">LinCongL</a></div>
</div>
<h2><a class='anchor' name='description'>Description</a></h2>
<p>A cubic-interpolating sound generator based on the difference equation:<pre> x(n+1) = (a * x(n) + c) % m</pre>
<p>The output signal is automatically scaled to a range of [-1, 1].
<p>sclang code translation:<pre class='code prettyprint lang-sc'>(
var a = 1.1, c = 0.13, m = 1, xi = 0, size = 64;
plot(size.collect { xi = (a * xi + c) % m });
)</pre>
<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3 class='method-code'><span class='method-prefix'>LinCongC.</span><a class='method-name' name='*ar' href='./../Overviews/Methods.html#ar'>ar</a>(<span class='argstr'>freq: 22050</span>, <span class='argstr'>a: 1.1</span>, <span class='argstr'>c: 0.13</span>, <span class='argstr'>m: 1</span>, <span class='argstr'>xi: 0</span>, <span class='argstr'>mul: 1</span>, <span class='argstr'>add: 0</span>)</h3>
<div class='supmethod'>From superclass: <a href='./../Classes/LinCongN.html'>LinCongN</a></div>
<div class='method'><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>freq<td class='argumentdesc'>
<p>Iteration frequency in Hertz<tr><td class='argumentname'>a<td class='argumentdesc'>
<p>Multiplier amount<tr><td class='argumentname'>c<td class='argumentdesc'>
<p>Increment amount<tr><td class='argumentname'>m<td class='argumentdesc'>
<p>Modulus amount<tr><td class='argumentname'>xi<td class='argumentdesc'>
<p>Initial value of x</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'>// default initial params
{ LinCongC.ar(MouseX.kr(20, SampleRate.ir)) * 0.2 }.play(s);</pre>
<pre class='code prettyprint lang-sc'>// randomly modulate params
(
{ LinCongC.ar(
LFNoise2.kr(1, 1e4, 1e4),
LFNoise2.kr(0.1, 0.5, 1.4),
LFNoise2.kr(0.1, 0.1, 0.1),
LFNoise2.kr(0.1)
) * 0.2 }.play(s);
)</pre>
<pre class='code prettyprint lang-sc'>// as frequency control...
(
{
SinOsc.ar(
LinCongC.ar(
40,
LFNoise2.kr(0.1, 0.1, 1),
LFNoise2.kr(0.1, 0.1, 0.1),
LFNoise2.kr(0.1),
0, 500, 600
)
) * 0.4 }.play(s);
)</pre>
<p><div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/LinCongC.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/LinCongC.schelp</a><br>link::Classes/LinCongC::<br></div></div></body></html>