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

151 lines
7 KiB
HTML
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
<!doctype html><html lang='en'><head><title>TPV | 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 = 'TPV';
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'>TPV:</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 (extension)</span>
| <span id='categories'><a href='./../Browse.html#UGens'>UGens</a>&#8201;&gt;&#8201;<a href='./../Browse.html#UGens>Analysis'>Analysis</a> | <a href='./../Browse.html#UGens'>UGens</a>&#8201;&gt;&#8201;<a href='./../Browse.html#UGens>FFT'>FFT</a></span>
</div><h1>TPV<span id='superclasses'> : <a href="../Classes/UGen.html">UGen</a> : <a href="../Classes/AbstractFunction.html">AbstractFunction</a> : <a href="../Classes/Object.html">Object</a></span>
<div class='extension-indicator-ctr' title='This help file originates from a third-party quark or plugin for SuperCollider.'><img class='extension-indicator-icon' alt='Extension' src='./../images/plugin.png'><span class='extension-indicator-text'>Extension</span></div></h1>
<div id='summary'>Tracking Phase Vocoder</div>
</div>
<div class='subheader'>
<div id='filename'>Source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/Extensions/NCAnalysisUGens/classes/TPV.sc' title='/Users/zzk/Library/Application Support/SuperCollider/Extensions/NCAnalysisUGens/classes/TPV.sc'>TPV.sc</a></div></div>
<h2><a class='anchor' name='description'>Description</a></h2>
<p>Implementation of the McAulay and Quatieri 1986 sinusoidal model, as described in:
<p>McAulay, R. and Quatieri, T. (1986) <em>"Speech analysis/Synthesis based on a sinusoidal representation"</em>. IEEE Transactions on Acoustics, Speech, and Signal Processing 34(4): 744--754<h2><a class='anchor' name='classmethods'>Class Methods</a></h2>
<h3 class='method-code'><span class='method-prefix'>TPV.</span><a class='method-name' name='*ar' href='./../Overviews/Methods.html#ar'>ar</a>(<span class='argstr'>chain</span>, <span class='argstr'>windowsize: 1024</span>, <span class='argstr'>hopsize: 512</span>, <span class='argstr'>maxpeaks: 80</span>, <span class='argstr'>currentpeaks</span>, <span class='argstr'>freqmult: 1</span>, <span class='argstr'>tolerance: 4</span>, <span class='argstr'>noisefloor: 0.2</span>, <span class='argstr'>mul: 1</span>, <span class='argstr'>add: 0</span>)</h3>
<div class='method'>
<p><h4>Arguments:</h4>
<table class='arguments'>
<tr><td class='argumentname'>chain<td class='argumentdesc'>
<p>[fft] - Audio input to track, which has been pre-analysed by the <a href="./../Classes/FFT.html">FFT</a> UGen; see examples below for the expected FFT size<tr><td class='argumentname'>windowsize<td class='argumentdesc'>
<p>Window size used for FFT<tr><td class='argumentname'>hopsize<td class='argumentdesc'>
<p>hop size for FFT, typically half window size<tr><td class='argumentname'>maxpeaks<td class='argumentdesc'>
<p>Absolute maximum number of allowed peaks to be detected in the spectrum<tr><td class='argumentname'>currentpeaks<td class='argumentdesc'>
<p>Current number of allowed peaks to be detected in the spectrum<tr><td class='argumentname'>freqmult<td class='argumentdesc'>
<p>Resynthesis parameter to change frequency; currently causes a gross multiplication of frequency of all sinusoidal components, no envelope compensation<tr><td class='argumentname'>tolerance<td class='argumentdesc'>
<p>Search area for matching peaks; within tolerance spectral bins<tr><td class='argumentname'>noisefloor<td class='argumentdesc'>
<p>Minimum magnitude for a candidate peak</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'>b.free
//assumes hop of half fftsize, fine
b = Buffer.alloc(s,1024,1); //for sampling rates 44100 and 48000
//b = Buffer.alloc(s,2048,1); //for sampling rates 88200 and 96000
//d=Buffer.read(s,"sounds/a11wlk01.wav");
d=Buffer.read(s,"sounds/break");
(
{
var in, fft, output;
in= SoundIn.ar(0); //PlayBuf.ar(1,d,BufRateScale.kr(d),1,0,1);
fft = FFT(b, in, wintype:1);
output=TPV.ar(fft, 1024, 512, 70,MouseX.kr(1,70), MouseY.kr(0.25,3),4,0.2);
//Out.ar(0,Pan2.ar(output));
output
}.play
)
(
{
var in, fft, output;
in= PlayBuf.ar(1,d,BufRateScale.kr(d),1,0,1);
fft = FFT(b, in, wintype:1);
output=TPV.ar(fft, 1024, 512, 50,50,1.0,MouseX.kr(0.1,100),MouseY.kr(-20,40).dbamp);
//Out.ar(0,Pan2.ar(output));
output
}.play
)
(
{
var in, fft, output;
in= PlayBuf.ar(1,d,BufRateScale.kr(d),1,0,1);
fft = FFT(b, in);
output=TPV.ar(fft, 1024, 512, 1,1);
output
//Out.ar(0,output);
}.plot(0.05, s, nil, -1.5, 1.5);
)
//residual
b = Buffer.alloc(s,1024,1); //for sampling rates 44100 and 48000
d=Buffer.read(s,"sounds/break");
(
{
var in, fft, output;
var input,inputAmp,threshhold,gate;
in= SoundIn.ar(0); //PlayBuf.ar(1,d,BufRateScale.kr(d),1,0,1);
//inputAmp = Amplitude.kr(input);
//threshhold = 0.001; // noise gating threshold
//gate = Lag.kr(inputAmp &gt; threshhold, 0.01);
//in= (input * gate);
fft = FFT(b, in, wintype:1);
output=TPV.ar(fft, 1024, 512, 50,50,1.0,4,0.2);
//Out.ar(0,Pan2.ar(output));
//delay by 512 samples for output, then phase measurement is from centre of frame, so
output - DelayN.ar(in,0.1, (512+512)/44100)
}.play
)</pre>
<p><div class='doclink'>helpfile source: <a href='file:///Users/zzk/Library/Application Support/SuperCollider/Extensions/NCAnalysisUGens/HelpSource/Classes/TPV.schelp'>/Users/zzk/Library/Application Support/SuperCollider/Extensions/NCAnalysisUGens/HelpSource/Classes/TPV.schelp</a><br>link::Classes/TPV::<br></div></div></body></html>