Loris::Distiller Class Reference

#include <Distiller.h>

List of all members.

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)

Detailed Description

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.


Member Enumeration Documentation

anonymous enum
Enumerator:
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.


Constructor & Destructor Documentation

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.

Parameters:
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).

Member Function Documentation

template<typename Container >
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.

Postcondition:
All labeled Partials in the collection are uniquely-labeled, and all unlabeled Partials have been moved to the end of the sequence.
Parameters:
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).
Returns:
the position of the end of the range of distilled Partials, which is either the end of the collection, or the position or the first unlabeled Partial.

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.

template<typename Container >
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.

Postcondition:
All labeled Partials in the collection are uniquely-labeled, and all unlabeled Partials have been moved to the end of the sequence.
Parameters:
partials is the collection of Partials to distill in-place
Returns:
the position of the end of the range of distilled Partials, which is either the end of the collection, or the position or the first unlabeled Partial.

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.

See also:
Distiller::distill( Container & partials )

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.

Postcondition:
All labeled Partials in the collection are uniquely-labeled, and all unlabeled Partials have been moved to the end of the sequence.
Parameters:
partials is the collection of Partials to distill in-place
Returns:
the position of the end of the range of distilled Partials, which is either the end of the collection, or the position or the first unlabeled Partial.

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.

template<typename Container >
Container::iterator Loris::Distiller::operator() ( Container &  partials  )  [inline]

Function call operator: same as distill( PartialList & partials ).

Function call operator: same as distill( PartialList & partials ).

See also:
Distiller::distill( Container & partials )

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2