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

69 lines
4.4 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<html><head><title>PV_Diffuser</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 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>
<script type='text/javascript'>var helpRoot='./..';</script>
</head>
<ul id='menubar'></ul>
<body onload='fixTOC();prettyPrint()'>
<div class='contents'>
<div class='header'>
<div id='label'>SuperCollider CLASSES</div>
<div id='categories'><a href='./../Browse.html#UGens>FFT'>UGens>FFT</a></div>
<h1>PV_Diffuser</h1>
<div id='summary'>Random phase shifting.</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/FFT.sc'>/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/FFT.sc</a></div><div id='superclasses'>Inherits from: <a href="../Classes/PV_ChainUGen.html">PV_ChainUGen</a> : <a href="../Classes/WidthFirstUGen.html">WidthFirstUGen</a> : <a href="../Classes/UGen.html">UGen</a> : <a href="../Classes/AbstractFunction.html">AbstractFunction</a> : <a href="../Classes/Object.html">Object</a></div>
<div id='related'>See also: <a href="./../Classes/FFT.html">FFT</a>, <a href="./../Classes/IFFT.html">IFFT</a>, <a href="./../Classes/PV_PhaseShift.html">PV_PhaseShift</a>, <a href="./../Classes/PV_PhaseShift90.html">PV_PhaseShift90</a>, <a href="./../Classes/PV_PhaseShift270.html">PV_PhaseShift270</a></div>
</div>
<div id='toc'>
<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='#*new'>new</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><h2><a class='anchor' name='description'>Description</a></h2>
<p>Adds a different constant random phase shift to each bin. When triggered, it selects a new set of random phases.<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3 class='cmethodname'><span class='methprefix'>*</span><a name='*new' href='./../Overviews/Methods.html#new'>new</a> (<span class='argstr'>buffer</span>, <span class='argstr'>trig: 0</span>)</h3>
<div class='method'>
<p><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>buffer<td class='argumentdesc'>
<p>FFT buffer.<tr><td class='argumentname'>trig<td class='argumentdesc'>
<p>A trigger, that selects a new set of random values.</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'>(
// trig with MouseY crossing center of screen
{
var in, chain;
in = Mix.ar(SinOsc.ar(200 * (1..10), 0, Array.fill(10, { rrand(0.1, 0.2) }) ));
chain = FFT(LocalBuf(2048), in);
chain = PV_Diffuser(chain, MouseY.kr &gt; 0.5 );
0.5 * IFFT(chain).dup;
}.play
);
(
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
// trig with MouseY crossing center of screen
{
var in, chain;
in = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
chain = FFT(LocalBuf(2048), in);
chain = PV_Diffuser(chain, MouseY.kr &gt; 0.5 );
0.5 * IFFT(chain).dup;
}.play
);</pre>
<div class='doclink'>helpfile source: <a href='file:///Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/PV_Diffuser.schelp'>/Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/PV_Diffuser.schelp</a><br>link::Classes/PV_Diffuser::<br>sc version: 3.8.0</div></div></body></html>