Loris::SpectralSurface Class Reference
#include <SpectralSurface.h>
List of all members.
Detailed Description
SpectralSurface represents a smoothed time-frequency surface that can be used to perform cross-synthesis, the filtering of one sound by the time-varying spectrum of another.
Constructor & Destructor Documentation
template<typename Iter >
Loris::SpectralSurface::SpectralSurface |
( |
Iter |
b, |
|
|
Iter |
e | |
|
) |
| | [inline] |
Contsruct a new SpectralSurface from a sequence of distilled Partials.
- Precondition:
- the specified Partials must be channelized and distilled.
- Parameters:
-
| b | the beginning of the sequence of Partials |
| e | the end of the sequence of Partials |
If compiled with NO_TEMPLATE_MEMBERS defined, then b and e must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.
Member Function Documentation
double Loris::SpectralSurface::effect |
( |
void |
|
) |
const |
Return the amount of effect applied by scaleAmplitudes and setAmplitudes (default 1, full effect). Values less than 1 (but greater than 0) reduce the amount of amplitude modified performed by application of the surface. (This is rarely a good way of controlling the amount of the effect.)
double Loris::SpectralSurface::frequencyStretch |
( |
void |
|
) |
const |
Return the amount of strecthing in the frequency dimension (default 1, no stretching). Values greater than 1 stretch the surface in the frequency dimension, values less than 1 (but greater than 0) compress the surface in the frequency dimension.
template<typename Iter >
void Loris::SpectralSurface::scaleAmplitudes |
( |
Iter |
b, |
|
|
Iter |
e | |
|
) |
| | [inline] |
Scale the amplitudes of a sequence of Partials according to the amplitude of the spectral surface at the corresponding times and frequencies, performing cross-synthesis, the filtering of one sound (the sequence of Partials) by the time-varying spectrum of another sound (the Partials used to construct the surface). The surface is stretched in time and frequency according to the values of the two stretch factors (default 1, no stretching) and the amount of the effect is governed by the `effect' parameter (default 1, full effect).
- Parameters:
-
| b | the beginning of the sequence of Partials |
| e | the end of the sequence of Partials |
If compiled with NO_TEMPLATE_MEMBERS defined, then b and e must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.
void Loris::SpectralSurface::scaleAmplitudes |
( |
Partial & |
p |
) |
|
Scale the amplitude of every Breakpoint in a Partial according to the amplitude of the spectral surface at the corresponding time and frequency.
- Parameters:
-
template<typename Iter >
void Loris::SpectralSurface::setAmplitudes |
( |
Iter |
b, |
|
|
Iter |
e | |
|
) |
| | [inline] |
Set the amplitudes of a sequence of Partials equal to the amplitude of the spectral surface at the corresponding times and frequencies. This can be used to perform formant-corrected pitch shifting of a sound: construct the surface from the unmodified Partials, perform the pitch shift on the Partials, then apply the surface to the shifted Partials using setAmplitudes. The surface is stretched in time and frequency according to the values of the two stretch factors (default 1, no stretching) and the amount of the effect is governed by the `effect' parameter (default 1, full effect).
- Parameters:
-
| b | the beginning of the sequence of Partials |
| e | the end of the sequence of Partials |
If compiled with NO_TEMPLATE_MEMBERS defined, then b and e must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.
void Loris::SpectralSurface::setAmplitudes |
( |
Partial & |
p |
) |
|
Set the amplitude of every Breakpoint in a Partial equal to the amplitude of the spectral surface at the corresponding time and frequency.
- Parameters:
-
void Loris::SpectralSurface::setEffect |
( |
double |
effect |
) |
|
Set the amount of effect applied by scaleAmplitudes and setAmplitudes (default 1, full effect). Values less than 1 (but greater than 0) reduce the amount of amplitude modified performed by application of the surface. (This is rarely a good way of controlling the amount of the effect.)
- Precondition:
- effect must be between 0 and 1, inclusive
- Parameters:
-
| effect | the new factor controlling the amount of amplitude modification performed by scaleAmplitudes and setAmplitudes |
void Loris::SpectralSurface::setFrequencyStretch |
( |
double |
stretch |
) |
|
Set the amount of strecthing in the frequency dimension (default 1, no stretching). Values greater than 1 stretch the surface in the frequency dimension, values less than 1 (but greater than 0) compress the surface in the frequency dimension.
- Precondition:
- stretch must be positive
- Parameters:
-
| stretch | the new stretch factor for the frequency dimension |
void Loris::SpectralSurface::setTimeStretch |
( |
double |
stretch |
) |
|
Set the amount of strecthing in the time dimension (default 1, no stretching). Values greater than 1 stretch the surface in the time dimension, values less than 1 (but greater than 0) compress the surface in the time dimension.
- Precondition:
- stretch must be positive
- Parameters:
-
| stretch | the new stretch factor for the time dimension |
double Loris::SpectralSurface::timeStretch |
( |
void |
|
) |
const |
Return the amount of strecthing in the time dimension (default 1, no stretching). Values greater than 1 stretch the surface in the time dimension, values less than 1 (but greater than 0) compress the surface in the time dimension.
The documentation for this class was generated from the following file: