#include <Distiller.h>
Public Types | |
enum | { DefaultFadeTimeMs = 5, DefaultSilentTimeMs = 1 } |
Public Member Functions | |
Distiller (double partialFadeTime=Distiller::DefaultFadeTimeMs/1000.0, double partialSilentTime=Distiller::DefaultSilentTimeMs/1000.0) | |
template<typename Container > | |
Container::iterator | distill (Container &partials) |
template<typename Container > | |
Container::iterator | operator() (Container &partials) |
Function call operator: same as distill( PartialList & partials ). | |
template<> | |
PartialList::iterator | distill (PartialList &partials) |
Static Public Member Functions | |
template<typename Container > | |
static Container::iterator | distill (Container &partials, double partialFadeTime, double partialSilentTime=DefaultSilentTimeMs/1000.0) |
Class Distiller represents an algorithm for "distilling" a group of Partials that logically represent a single component into a single Partial.
The sound morphing algorithm in Loris requires that Partials in a given source be labeled uniquely, that is, no two Partials can have the same label. The Distiller enforces this condition. All Partials identified with a particular frequency channel (see Channelizer), and, therefore, having a common label, are distilled into a single Partial, leaving at most a single Partial per frequency channel and label. Channels that contain no Partials are not represented in the distilled data. Partials that are not labeled, that is, Partials having label 0, are are left unmodified at the end of the Partial sequence.
Distillation modifies the Partial container (a PartialList). All Partials in the distilled range having a common label are replaced by a single Partial in the distillation process. Only labeled Partials are affected by distillation.
anonymous enum |
DefaultFadeTimeMs |
Default time in milliseconds over which Partials joined by distillation fade to and from zero amplitude. Divide by 1000 to use as a member function parameter. This parameter should be the same in Distiller, Sieve, and Collator. |
DefaultSilentTimeMs |
Default minimum duration in milliseconds of the silent (zero-amplitude) gap between two Partials joined by distillation. Divide by 1000 to use as a member function parameter. This parameter should be the same in Distiller, Sieve, and Collator. |
Loris::Distiller::Distiller | ( | double | partialFadeTime = Distiller::DefaultFadeTimeMs/1000.0 , |
|
double | partialSilentTime = Distiller::DefaultSilentTimeMs/1000.0 | |||
) | [explicit] |
Construct a new Distiller using the specified fade time for gaps between Partials. When two non-overlapping Partials are distilled into a single Partial, the distilled Partial fades out at the end of the earlier Partial and back in again at the onset of the later one. The fade time is the time over which these fades occur. By default, use a 1 ms fade time. The gap time is the additional time over which a Partial faded out must remain at zero amplitude before it can fade back in. By default, use a gap time of one tenth of a millisecond, to prevent a pair of arbitrarily close null Breakpoints being inserted.
partialFadeTime | is the time (in seconds) over which Partials joined by distillation fade to and from zero amplitude. (Default is Distiller::DefaultFadeTime). | |
partialSilentTime | is the minimum duration (in seconds) of the silent (zero-amplitude) gap between two Partials joined by distillation. (Default is Distiller::DefaultSilentTime). |
Container::iterator Loris::Distiller::distill | ( | Container & | partials, | |
double | partialFadeTime, | |||
double | partialSilentTime = DefaultSilentTimeMs/1000.0 | |||
) | [inline, static] |
Static member that constructs an instance and applies it to a sequence of Partials.
partials | is the collection of Partials to distill in-place | |
partialFadeTime | is the time (in seconds) over which Partials joined by distillation fade to and from zero amplitude. | |
partialSilentTime | is the minimum duration (in seconds) of the silent (zero-amplitude) gap between two Partials joined by distillation. (Default is Distiller::DefaultSilentTime). |
If compiled with NO_TEMPLATE_MEMBERS defined, then partials must be a PartialList, otherwise it can be any container type storing Partials that supports at least bidirectional iterators.
Container::iterator Loris::Distiller::distill | ( | Container & | partials | ) | [inline] |
Distill labeled Partials in a collection leaving only a single Partial per non-zero label.
Unlabeled (zero-labeled) Partials are left unmodified at the end of the distilled Partials.
Return an iterator refering to the position of the first unlabeled Partial, or the end of the distilled collection if there are no unlabeled Partials. Since distillation is in-place, the Partials collection may be smaller (fewer Partials) after distillation, and any iterators on the collection may be invalidated.
partials | is the collection of Partials to distill in-place |
If compiled with NO_TEMPLATE_MEMBERS defined, then partials must be a PartialList, otherwise it can be any container type storing Partials that supports at least bidirectional iterators.
Distill labeled Partials in a collection leaving only a single Partial per non-zero label.
Unlabeled (zero-labeled) Partials are left unmodified at the end of the distilled Partials.
Return an iterator refering to the position of the first unlabeled Partial, or the end of the distilled collection if there are no unlabeled Partials. Since distillation is in-place, the Partials collection may be smaller (fewer Partials) after distillation, and any iterators on the collection may be invalidated.
partials | is the collection of Partials to distill in-place |
If compiled with NO_TEMPLATE_MEMBERS defined, then partials must be a PartialList, otherwise it can be any container type storing Partials that supports at least bidirectional iterators.
Container::iterator Loris::Distiller::operator() | ( | Container & | partials | ) | [inline] |
Function call operator: same as distill( PartialList & partials ).
Function call operator: same as distill( PartialList & partials ).