Loris::Sieve Class Reference

#include <Sieve.h>

List of all members.

Public Types

enum  { DefaultFadeTimeMs = Distiller::DefaultFadeTimeMs, DefaultSilentTimeMs = Distiller::DefaultSilentTimeMs }

Public Member Functions

 Sieve (double partialFadeTime=Sieve::DefaultFadeTimeMs/1000.0)
template<typename Iter >
void sift (Iter sift_begin, Iter sift_end)
template<typename Container >
void sift (Container &partials)

Static Public Member Functions

template<typename Iter >
static void sift (Iter sift_begin, Iter sift_end, double partialFadeTime)

Detailed Description

A Sieve eliminating temporal overlap among Partials.

Class Sieve represents an algorithm for identifying channelized (see also Channelizer) Partials that overlap in time, and selecting the longer one to represent the channel. The identification of overlap includes the time needed for Partials to fade to and from zero amplitude in synthesis (see also Synthesizer) or distillation. (see also Distiller)

In some cases, the energy redistribution effected by the distiller (see also Distiller) is undesirable. In such cases, the partials can be sifted before distillation. The sifting process in Loris identifies all the partials that would be rejected (and converted to noise energy) by the distiller and assigns them a label of 0. These sifted partials can then be identified and treated sepearately or removed altogether, or they can be passed through the distiller unlabeled, and crossfaded in the morphing process (see also Morpher).

See also:
Channelizer, Distiller, Morpher, Synthesizer

Member Enumeration Documentation

anonymous enum

extra time (in seconds) added to each end of a Partial when determining overlap, to accomodate the fade to and from zero amplitude.

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::Sieve::Sieve ( double  partialFadeTime = Sieve::DefaultFadeTimeMs/1000.0  )  [explicit]

Construct a new Sieve using the specified partial fade time. If unspecified, the default fade time (same as the default fade time for the Distiller) is used.

Parameters:
partialFadeTime is the extra time (in seconds) added to each end of a Partial to accomodate the fade to and from zero amplitude. Fade time must be non-negative. A default value is used if unspecified.
Exceptions:
InvalidArgument if partialFadeTime is negative.

Member Function Documentation

template<typename Iter >
void Loris::Sieve::sift ( Iter  sift_begin,
Iter  sift_end,
double  partialFadeTime 
) [inline, static]

Static member that constructs an instance and applies it to a sequence of Partials. Construct a Sieve using the specified Partial fade time (in seconds), and use it to sift a sequence of Partials.

Parameters:
sift_begin is the beginning of the range of Partials to sift
sift_end is (one-past) the end of the range of Partials to sift
partialFadeTime is the extra time (in seconds) added to each end of a Partial to accomodate the fade to and from zero amplitude. The Partial fade time must be non-negative.
Exceptions:
InvalidArgument if partialFadeTime is negative.

If compiled with NO_TEMPLATE_MEMBERS defined, then begin and end must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.

template<typename Container >
void Loris::Sieve::sift ( Container &  partials  )  [inline]

Sift labeled Partials in the specified container If any two Partials having same label overlap in time, keep only the longer of the two Partials. Set the label of the shorter duration partial to zero. No Partials are removed from the container and the container order is unaltered.

Parameters:
partials is the collection of Partials to sift 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.

template<typename Iter >
void Loris::Sieve::sift ( Iter  sift_begin,
Iter  sift_end 
) [inline]

Sift labeled Partials on the specified half-open (STL-style) range. If any two Partials having same label overlap in time, keep only the longer of the two Partials. Set the label of the shorter duration partial to zero. No Partials are removed from the sequence and the sequence order is unaltered.

Parameters:
sift_begin is the beginning of the range of Partials to sift
sift_end is (one-past) the end of the range of Partials to sift

If compiled with NO_TEMPLATE_MEMBERS defined, then sift_begin and sift_end must be PartialList::iterators, otherwise they can be any type of iterators over a sequence of Partials.


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

Generated by  doxygen 1.6.2