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

128 lines
7.7 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<!doctype html><html lang='en'><head><title>VOsc | SuperCollider 3.12.2 Help</title>
<link rel='stylesheet' href='./../scdoc.css' type='text/css' />
<link rel='stylesheet' href='./../codemirror.css' type='text/css' />
<link rel='stylesheet' href='./../editor.css' type='text/css' />
<link rel='stylesheet' href='./../frontend.css' type='text/css' />
<link rel='stylesheet' href='./../custom.css' type='text/css' />
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script src='./../lib/jquery.min.js'></script>
<script src='./../lib/codemirror-5.39.2.min.js' type='text/javascript'></script>
<script src='./../lib/codemirror-addon-simple-5.39.2.min.js' type='text/javascript'></script>
<script>
var helpRoot = './..';
var scdoc_title = 'VOsc';
var scdoc_sc_version = '3.12.2';
</script>
<script src='./../scdoc.js' type='text/javascript'></script>
<script src='./../docmap.js' type='text/javascript'></script>
<script src='qrc:///qtwebchannel/qwebchannel.js' type='text/javascript'></script>
</head>
<body onload='fixTOC()'>
<div id='toc'>
<div id='toctitle'>VOsc:</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 id='menubar'></div>
<div class='contents'>
<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>Deterministic'>Deterministic</a></span>
</div><h1>VOsc<span id='superclasses'> : <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'>Variable wavetable oscillator.</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Osc.sc' title='/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/Osc.sc'>Osc.sc</a></div><div id='related'>See also: <a href="./../Classes/COsc.html">COsc</a>, <a href="./../Classes/Osc.html">Osc</a>, <a href="./../Classes/OscN.html">OscN</a>, <a href="./../Classes/VOsc3.html">VOsc3</a></div>
</div>
<h2><a class='anchor' name='description'>Description</a></h2>
<p>A wavetable lookup oscillator which can be swept smoothly across wavetables. All the wavetables must be allocated to the same size. Fractional values of table will interpolate between two adjacent tables.
<p>This oscillator requires at least two buffers to be filled with a wavetable format signal. This preprocesses the Signal into a form which can be used efficiently by the Oscillator. The buffer size must be a power of 2.
<p>This can be achieved by creating a <a href="./../Classes/Buffer.html">Buffer</a> object and sending it one of the "b_gen" messages ( sine1, sine2, sine3 ) with the wavetable flag set to true.
<p>This can also be achieved by creating a <a href="./../Classes/Signal.html">Signal</a> object and sending it the <a href="./../Overviews/Methods.html#asWavetable">asWavetable</a> message, saving it to disk, and having the server load it from there.
<p>If you use Buffer objects to manage buffer numbers, you can use the [*allocConsecutive] method to allocate a continuous block of buffers. See the <a href="./../Classes/Buffer.html">Buffer</a> helpfile for details.<div class='note'><span class='notelabel'>NOTE:</span> VOsc requires the b_gen sine1 wavetable flag to be ON.</div><h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3 class='method-code'><span class='method-prefix'>VOsc.</span><a class='method-name' name='*ar' href='./../Overviews/Methods.html#ar'>ar</a>(<span class='argstr'>bufpos</span>, <span class='argstr'>freq: 440.0</span>, <span class='argstr'>phase: 0.0</span>, <span class='argstr'>mul: 1.0</span>, <span class='argstr'>add: 0.0</span>)</h3>
<h3 class='method-code'><span class='method-prefix'>VOsc.</span><a class='method-name' name='*kr' href='./../Overviews/Methods.html#kr'>kr</a>(<span class='argstr'>bufpos</span>, <span class='argstr'>freq: 440.0</span>, <span class='argstr'>phase: 0.0</span>, <span class='argstr'>mul: 1.0</span>, <span class='argstr'>add: 0.0</span>)</h3>
<div class='method'>
<p><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>bufpos<td class='argumentdesc'>
<p>Buffer index. Can be swept continuously among adjacent wavetable buffers of the same size.<tr><td class='argumentname'>freq<td class='argumentdesc'>
<p>Frequency in Hertz.<tr><td class='argumentname'>phase<td class='argumentdesc'>
<p>Phase offset or modulator in radians.<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>
<textarea class='editor'>(
s = Server.local;
// allocate and fill tables 0 to 7
8.do({ arg i;
var n, a;
// allocate table
s.sendMsg(\b_alloc, i, 1024);
// generate array of harmonic amplitudes
n = (i+1)**2;
a = Array.fill(n, { arg j; ((n-j)/n).squared.round(0.001) });
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
// the argument '7' here is a flag for the \sine1 wave fill method -
// see the "Wave Fill Commands" section in the Server Command Reference
});
)
(
SynthDef("help-VOsc",{ arg out=0, bufoffset=0;
var x;
// mouse x controls the wavetable position
x = MouseX.kr(0,7);
Out.ar(out,
VOsc.ar(bufoffset+x, [120,121], 0, 0.3)
)
}).play(s,[\out, 0, \bufoffset, 0]);
)
(
8.do({ arg i;
var a;
s.sendMsg(\b_alloc, i, 1024); // allocate table
// generate array of harmonic amplitudes
a = Array.fill(i, 0) ++ [0.5, 1, 0.5];
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)
(
8.do({ arg i;
var a;
s.sendMsg(\b_alloc, i, 1024); // allocate table
// generate array of harmonic amplitudes
a = Array.fill(32,0);
12.do({ arg i; a.put(32.rand, 1) });
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)
(
8.do({ arg i;
var a;
s.sendMsg(\b_alloc, i, 1024); // allocate table
// generate array of harmonic amplitudes
n = (i+1)**2;
a = Array.fill(n, { arg j; 1.0.rand2 });
// fill table
s.performList(\sendMsg, \b_gen, i, \sine1, 7, a);
});
)</textarea>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/VOsc.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/VOsc.schelp</a><br>link::Classes/VOsc::<br></div></div><script src='./../editor.js' type='text/javascript'></script>
</body></html>