101 lines
No EOL
5.3 KiB
HTML
101 lines
No EOL
5.3 KiB
HTML
<!doctype html><html lang='en'><head><title>LinLin | 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 = 'LinLin';
|
|
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'>LinLin:</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> > <a href='./../Browse.html#UGens>Maths'>Maths</a></span>
|
|
</div><h1>LinLin<span id='superclasses'> : <a href="../Classes/Object.html">Object</a></span>
|
|
</h1>
|
|
<div id='summary'>Map a linear range to another linear range</div>
|
|
</div>
|
|
<div class='subheader'>
|
|
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Line.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Line.sc'>Line.sc</a></div><div id='related'>See also: <a href="./../Classes/LinExp.html">LinExp</a></div>
|
|
</div>
|
|
<h2><a class='anchor' name='description'>Description</a></h2>
|
|
|
|
<p>Maps a linear range of values to another linear range of values.<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
|
|
<h3 class='method-code'><span class='method-prefix'>LinLin.</span><a class='method-name' name='*ar' href='./../Overviews/Methods.html#ar'>ar</a>(<span class='argstr'>in: 0</span>, <span class='argstr'>srclo: 0</span>, <span class='argstr'>srchi: 1</span>, <span class='argstr'>dstlo: 1</span>, <span class='argstr'>dsthi: 2</span>)</h3>
|
|
<h3 class='method-code'><span class='method-prefix'>LinLin.</span><a class='method-name' name='*kr' href='./../Overviews/Methods.html#kr'>kr</a>(<span class='argstr'>in: 0</span>, <span class='argstr'>srclo: 0</span>, <span class='argstr'>srchi: 1</span>, <span class='argstr'>dstlo: 1</span>, <span class='argstr'>dsthi: 2</span>)</h3>
|
|
<div class='method'>
|
|
<p><h4>Arguments:</h4>
|
|
<table class='arguments'>
|
|
<tr><td class='argumentname'>in<td class='argumentdesc'>
|
|
<p>The input signal to convert.<tr><td class='argumentname'>srclo<td class='argumentdesc'>
|
|
<p>Lower limit of input range.<tr><td class='argumentname'>srchi<td class='argumentdesc'>
|
|
<p>Upper limit of input range.<tr><td class='argumentname'>dstlo<td class='argumentdesc'>
|
|
<p>Lower limit of output range.<tr><td class='argumentname'>dsthi<td class='argumentdesc'>
|
|
<p>Upper limit of output range.</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'>// examples:
|
|
|
|
(
|
|
{
|
|
var mod = SinOsc.kr(Line.kr(1, 10, 10));
|
|
SinOsc.ar(LinLin.kr(mod, -1,1, 100, 900)) * 0.1
|
|
}.play;
|
|
)
|
|
|
|
// modulating destination values.
|
|
(
|
|
{
|
|
var mod = LFNoise2.ar(80);
|
|
SinOsc.ar(LinLin.ar(mod, -1,1, MouseX.kr(200, 8000, 1), MouseY.kr(200, 8000, 1))) * 0.1
|
|
}.play;
|
|
)
|
|
|
|
// modulating source and destination values.
|
|
(
|
|
{
|
|
var mod = LFNoise2.ar(80);
|
|
SinOsc.ar(
|
|
LinLin.ar(mod,
|
|
SinOsc.kr(0.2), SinOsc.kr(0.2543),
|
|
MouseX.kr(200, 8000, 1), MouseY.kr(200, 8000, 1)
|
|
)
|
|
) * 0.1
|
|
}.play;
|
|
)</pre>
|
|
|
|
<p>linlin and range can be used to create a LinLin implicitly from a ugen, mapping its output values from linear range to an exponential one. The rate is derived from the ugen.<pre class='code prettyprint lang-sc'>// linlin
|
|
(
|
|
{
|
|
var mod = LFNoise2.ar(80);
|
|
SinOsc.ar(mod.linlin(-1,1, MouseX.kr(200, 8000, 1), MouseY.kr(200, 8000, 1))) * 0.1
|
|
}.play;
|
|
)
|
|
|
|
// range
|
|
(
|
|
{
|
|
var mod = LFNoise2.ar(80).range(MouseX.kr(200, 8000, 1), MouseY.kr(200, 8000, 1));
|
|
SinOsc.ar(mod) * 0.1
|
|
}.play;
|
|
)</pre>
|
|
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/LinLin.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/LinLin.schelp</a><br>link::Classes/LinLin::<br></div></div></body></html> |