212 lines
14 KiB
TypeScript
212 lines
14 KiB
TypeScript
import type { CsoundReference } from './types'
|
|
|
|
// Spectral Processing:STFT
|
|
export const spectralProcessingStft: CsoundReference[] = [
|
|
{
|
|
name: 'pvadd',
|
|
type: 'opcode',
|
|
category: 'Spectral Processing:STFT',
|
|
description: 'Reads from a _pvoc_ file and uses the data to perform additive synthesis.',
|
|
syntax: 'ares = pvadd(ktimpnt, kfmod, ifilcod, ifn, ibins [, ibinoffset] \\\n [, ibinincr] [, iextractmode] [, ifreqlim] [, igatefn])',
|
|
example: 'ktime line 0, p3, p3\nasig pvadd ktime, 1, “oboe.pvoc”, 1, 100, 2',
|
|
rates: ['a-rate', 'i-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifilcod',
|
|
description: 'integer or character-string denoting a control-file derived from [pvanal](../utility/pvanal.md) analysis of an audio signal. An integer denotes the suffix of a file _pvoc.m_; a character-string (in double quotes) gives a filename, optionally a full pathname. If not fullpath, the file is sought first in the current directory, then in the one given by the environment variable [SADIR](../invoke/environment-variables.md) (if defined). _pvoc_ control files contain data organized for fft resynthesis. Memory usage depends on the size of the files involved, which are read and held entirely in memory during computation but are shared by multiple calls (see also [lpread](../opcodes/lpread.md)).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ifn',
|
|
description: 'table number of a stored function containing a sine wave.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ibins',
|
|
description: 'number of bins that will be used in the resynthesis (each bin counts as one oscillator in the re-synthesis)',
|
|
type: 'initialization'
|
|
},
|
|
],
|
|
seeAlso: ['Short-time Fourier Transform (STFT) Resynthesis']
|
|
},
|
|
{
|
|
name: 'pvbufread',
|
|
type: 'opcode',
|
|
category: 'Spectral Processing:STFT',
|
|
description: 'Reads from a phase vocoder analysis file and makes the retrieved data available.',
|
|
syntax: 'pvbufread(ktimpnt, ifile)',
|
|
example: 'ktime1 line 0, p3, 3.5 ; used as index in the "oboe.pvoc" file\nktime2 line 0, p3, 4.5 ; used as index in the "clar.pvoc" file\nkinterp linseg 1, p3*0.15, 1, p3*0.35, 0, p3*0.25, 0, p3*0.15, 1, p3*0.1, 1\n pvbufread ktime1, "oboe.pvoc"\napv pvinterp ktime2,1,"clar.pvoc", 1, 1.065, 1, 0.75, 1-kinterp, 1-kinterp',
|
|
parameters: [
|
|
{
|
|
name: 'ifile',
|
|
description: 'the _pvoc_ number (n in pvoc.n) or the name in quotes of the analysis file made using _pvanal_. (See [pvoc](../opcodes/pvoc.md).)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ktimpnt',
|
|
description: 'the passage of time, in seconds, through this file. _ktimpnt_ must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Short-time Fourier Transform (STFT) Resynthesis']
|
|
},
|
|
{
|
|
name: 'pvcross',
|
|
type: 'opcode',
|
|
category: 'Spectral Processing:STFT',
|
|
description: 'Applies the amplitudes from one phase vocoder analysis file to the data from a second file and then performs the resynthesis.',
|
|
syntax: 'ares = pvcross(ktimpnt, kfmod, ifile, kampscale1, kampscale2 [, ispecwp])',
|
|
example: 'ktime1 line 0, p3, 3.5 ; used as index in the "oboe.pvoc" file\nktime2 line 0, p3, 4.5 ; used as index in the "clar.pvoc" file\nkcross expon 0.001, p3, 1\n pvbufread ktime1, "oboe.pvoc"\napv pvcross ktime2, 1, "clar.pvoc", 1-kcross, kcross',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifile',
|
|
description: 'the _pvoc_ number (n in pvoc.n) or the name in quotes of the analysis file made using _pvanal_. (See [pvoc](../opcodes/pvoc.md).)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ktimpnt',
|
|
description: 'the passage of time, in seconds, through this file. _ktimpnt_ must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfmod',
|
|
description: 'a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and 0.5 down an octave.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kampscale1',
|
|
description: 'used to scale the amplitudes stored in each frame of the phase vocoder analysis file. _kampscale1_ scale the amplitudes of the data from the file read by the previously called _pvbufread_. _kampscale2_ scale the amplitudes of the file named by _ifile_.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kampscale2',
|
|
description: 'used to scale the amplitudes stored in each frame of the phase vocoder analysis file. _kampscale1_ scale the amplitudes of the data from the file read by the previously called _pvbufread_. _kampscale2_ scale the amplitudes of the file named by _ifile_.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Short-time Fourier Transform (STFT) Resynthesis']
|
|
},
|
|
{
|
|
name: 'pvinterp',
|
|
type: 'opcode',
|
|
category: 'Spectral Processing:STFT',
|
|
description: 'Interpolates between the amplitudes and frequencies of two phase vocoder analysis files.',
|
|
syntax: 'ares = pvinterp(ktimpnt, kfmod, ifile, kfreqscale1, kfreqscale2, \\\n kampscale1, kampscale2, kfreqinterp, kampinterp)',
|
|
example: 'ktime1 line 0, p3, 3.5 ; used as index in the "oboe.pvoc" file\nktime2 line 0, p3, 4.5 ; used as index in the "clar.pvoc" file\nkinterp linseg 1, p3*0.15, 1, p3*0.35, 0, p3*0.25, 0, p3*0.15, 1, p3*0.1, 1\n pvbufread ktime1, "oboe.pvoc"\napv pvinterp ktime2,1,"clar.pvoc", 1, 1.065, 1, 0.75, 1-kinterp, 1-kinterp',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifile',
|
|
description: 'the _pvoc_ number (n in pvoc.n) or the name in quotes of the analysis file made using pvanal. (See [pvoc](../opcodes/pvoc.md).)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ktimpnt',
|
|
description: 'the passage of time, in seconds, through this file. _ktimpnt_ must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfmod',
|
|
description: 'a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfreqscale1',
|
|
description: 'used in _pvinterp_ to scale the frequencies and amplitudes stored in each frame of the phase vocoder analysis file. _kfreqscale1_ and _kampscale1_ scale the frequencies and amplitudes of the data from the file read by the previously called [pvbufread](../opcodes/pvbufread.md) (this data is passed internally to the _pvinterp_ unit). _kfreqscale2_ and _kampscale2_ scale the frequencies and amplitudes of the file named by _ifile_ in the _pvinterp_ argument list and read within the _pvinterp_ unit.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfreqscale2',
|
|
description: 'used in _pvinterp_ to scale the frequencies and amplitudes stored in each frame of the phase vocoder analysis file. _kfreqscale1_ and _kampscale1_ scale the frequencies and amplitudes of the data from the file read by the previously called [pvbufread](../opcodes/pvbufread.md) (this data is passed internally to the _pvinterp_ unit). _kfreqscale2_ and _kampscale2_ scale the frequencies and amplitudes of the file named by _ifile_ in the _pvinterp_ argument list and read within the _pvinterp_ unit.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kampscale1',
|
|
description: 'used in _pvinterp_ to scale the frequencies and amplitudes stored in each frame of the phase vocoder analysis file. _kfreqscale1_ and _kampscale1_ scale the frequencies and amplitudes of the data from the file read by the previously called [pvbufread](../opcodes/pvbufread.md) (this data is passed internally to the _pvinterp_ unit). _kfreqscale2_ and _kampscale2_ scale the frequencies and amplitudes of the file named by _ifile_ in the _pvinterp_ argument list and read within the _pvinterp_ unit.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kampscale2',
|
|
description: 'used in _pvinterp_ to scale the frequencies and amplitudes stored in each frame of the phase vocoder analysis file. _kfreqscale1_ and _kampscale1_ scale the frequencies and amplitudes of the data from the file read by the previously called [pvbufread](../opcodes/pvbufread.md) (this data is passed internally to the _pvinterp_ unit). _kfreqscale2_ and _kampscale2_ scale the frequencies and amplitudes of the file named by _ifile_ in the _pvinterp_ argument list and read within the _pvinterp_ unit.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfreqinterp',
|
|
description: 'used in _pvinterp_, determine the interpolation distance between the values of one phase vocoder file and the values of a second file. When the value of _kfreqinterp_ is 1, the frequency values will be entirely those from the first file (read by the _pvbufread_), post scaling by the _kfreqscale1_ argument. When the value of _kfreqinterp_ is 0 the frequency values will be those of the second file (read by the _pvinterp_ unit itself), post scaling by _kfreqscale2_. When _kfreqinterp_ is between 0 and 1 the frequency values will be calculated, on a bin, by bin basis, as the percentage between each pair of frequencies (in other words, _kfreqinterp_=0.5 will cause the frequencies values to be half way between the values in the set of data from the first file and the set of data from the second file).',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kampinterp',
|
|
description: 'used in _pvinterp_, determine the interpolation distance between the values of one phase vocoder file and the values of a second file. When the value of _kfreqinterp_ is 1, the frequency values will be entirely those from the first file (read by the _pvbufread_), post scaling by the _kfreqscale1_ argument. When the value of _kfreqinterp_ is 0 the frequency values will be those of the second file (read by the _pvinterp_ unit itself), post scaling by _kfreqscale2_. When _kfreqinterp_ is between 0 and 1 the frequency values will be calculated, on a bin, by bin basis, as the percentage between each pair of frequencies (in other words, _kfreqinterp_=0.5 will cause the frequencies values to be half way between the values in the set of data from the first file and the set of data from the second file).',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Short-time Fourier Transform (STFT) Resynthesis']
|
|
},
|
|
{
|
|
name: 'pvoc',
|
|
type: 'opcode',
|
|
category: 'Spectral Processing:STFT',
|
|
description: 'Implements signal reconstruction using an fft-based phase vocoder.',
|
|
syntax: 'ares = pvoc(ktimpnt, kfmod, ifilcod [, ispecwp] [, iextractmode] \\\n [, ifreqlim] [, igatefn])',
|
|
example: '--8<-- "examples/pvoc.csd"',
|
|
rates: ['a-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifilcod',
|
|
description: 'integer or character-string denoting a control-file derived from analysis of an audio signal. An integer denotes the suffix of a file _pvoc.m_; a character-string (in double quotes) gives a filename, optionally a full pathname. If not fullpath, the file is sought first in the current directory, then in the one given by the environment variable [SADIR](../invoke/environment-variables.md) (if defined). _pvoc_ control contains breakpoint amplitude and frequency envelope values organized for fft resynthesis. Memory usage depends on the size of the files involved, which are read and held entirely in memory during computation but are shared by multiple calls (see also [lpread](../opcodes/lpread.md)).',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ktimpnt',
|
|
description: 'The passage of time, in seconds, through the analysis file. _ktimpnt_ must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kfmod',
|
|
description: 'a control-rate transposition factor: a value of 1 incurs no transposition, 1.5 transposes up a perfect fifth, and .5 down an octave.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Short-time Fourier Transform (STFT) Resynthesis']
|
|
},
|
|
{
|
|
name: 'pvread',
|
|
type: 'opcode',
|
|
category: 'Spectral Processing:STFT',
|
|
description: 'Reads from a [pvoc](../opcodes/pvoc.md) file and returns the frequency and amplitude from a single analysis channel or bin.',
|
|
syntax: 'kfreq, kamp = pvread(ktimpnt, ifile, ibin)',
|
|
example: '--8<-- "examples/pvread.csd"',
|
|
rates: ['k-rate'],
|
|
parameters: [
|
|
{
|
|
name: 'ifile',
|
|
description: 'the _pvoc_ number (n in pvoc.n) or the name in quotes of the analysis file made using _pvanal_. (See [pvoc](../opcodes/pvoc.md).)',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'ibin',
|
|
description: 'the number of the analysis channel from which to return frequency in Hz and magnitude.',
|
|
type: 'initialization'
|
|
},
|
|
{
|
|
name: 'kfreq',
|
|
description: 'outputs of the _pvread_ unit. These values, retrieved from a phase vocoder analysis file, represent the values of frequency and amplitude from a single analysis channel specified in the _ibin_ argument. Interpolation between analysis frames is performed at k-rate resolution and dependent of course upon the rate and direction of _ktimpnt_.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'kamp',
|
|
description: 'outputs of the _pvread_ unit. These values, retrieved from a phase vocoder analysis file, represent the values of frequency and amplitude from a single analysis channel specified in the _ibin_ argument. Interpolation between analysis frames is performed at k-rate resolution and dependent of course upon the rate and direction of _ktimpnt_.',
|
|
type: 'performance'
|
|
},
|
|
{
|
|
name: 'ktimpnt',
|
|
description: 'the passage of time, in seconds, through this file. _ktimpnt_ must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.',
|
|
type: 'performance'
|
|
},
|
|
],
|
|
seeAlso: ['Short-time Fourier Transform (STFT) Resynthesis']
|
|
},
|
|
]
|