SoundFileSourceHopper Class Reference
[Input/Output]

Generates slices from a sound file source in a sliding window fashion with hopping. More...

#include <SoundFileSourceHopper.h>

Inherits Marsyas::MarSystem.


Public Member Functions

MarSystemclone () const
 Implementation of the MarSystem::clone() method.
void myProcess (realvec &in, realvec &out)
 Implementation of the MarSystem::myProcess method.
 SoundFileSourceHopper (const SoundFileSourceHopper &a)
 SoundFileSourceHopper copy constructor.
 SoundFileSourceHopper (std::string name)
 SoundFileSourceHopper constructor.
 ~SoundFileSourceHopper ()
 SoundFileSourceHopper destructor.

Private Member Functions

void addControls ()
 Add specific controls needed by this MarSystem.
void myUpdate (MarControlPtr sender)
 Reads changed controls and sets up variables if necessary.

Private Attributes

MarControlPtr ctrl_hopSize_
 MarControlPtr for the hop size.
MarControlPtr ctrl_mixToMono_
 MarControlPtr for the gain control.
MarControlPtr ctrl_windowSize_
 MarControlPtr for the window size control.


Detailed Description

Generates slices from a sound file source in a sliding window fashion with hopping.

The SoundFileSourceHopper provides the basic IO functionality in audio processing of producing slices of audio data in a sliding window fashion with a given window size and hop size.

Traditionally, a sliding window with hopping had to be implemented in Marsyas by a normal SoundFileSource Marsystem (without hopping), followed by a ShiftInput Marsystem (to provide the hopping). This was not very intuitive, e.g. there was no explicit "hopSize" control. Moreover, the hop size had to be set through the window size of the top level MarSystem, which was unobvious, lead too easily to bugs with wrongly overwritten hop sizes and made it near to impossible to provide it as a reusable component. The SoundFileSourceHopper is designed to be a reusable sliding/hopping windowing component for without the issues mentioned above.

The implementation of SoundFileSourceHopper is largely based on Series, especially SoundFileSourceHopper::myUpdate() and SoundFileSourceHopper::myProcess(). The main difference is that SoundFileSourceHopper is prefilled with a SoundFileSource, ShiftInput and MixToMono MarSystem and SoundFileSourceHopper::myUpdate() sets the inSamples control of the internal SoundFileSource based on the desired hop size instead of the inSamples control of the container.

See also:
SoundFileSource, ShiftInput, MixToMono
Controls:

Additional SoundFileSource settings can be configured through the internal SoundFileSource "src", for example with a control string like "SoundFileSource/src/mrs_string/currentlyPlaying".

Todo:
: provide reset functionality to reset the Shiftinput memory and also takes reseting the SoundFileSource into account.

Definition at line 76 of file SoundFileSourceHopper.h.


Constructor & Destructor Documentation

SoundFileSourceHopper ( std::string  name  ) 

SoundFileSourceHopper constructor.

Add any specific controls needed by this MarSystem.

Definition at line 27 of file SoundFileSourceHopper.cpp.

References SoundFileSourceHopper::addControls(), and MarSystem::linkControl().

Referenced by SoundFileSourceHopper::clone().


Member Function Documentation

void addControls (  )  [private]

Add specific controls needed by this MarSystem.

Add any specific controls needed by this MarSystem.

Reimplemented from MarSystem.

Definition at line 78 of file SoundFileSourceHopper.cpp.

References SoundFileSourceHopper::ctrl_hopSize_, SoundFileSourceHopper::ctrl_mixToMono_, and SoundFileSourceHopper::ctrl_windowSize_.

Referenced by SoundFileSourceHopper::SoundFileSourceHopper().

void myUpdate ( MarControlPtr  sender  )  [private, virtual]


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

Generated on Wed May 23 00:02:23 2012 for Marsyas by  doxygen 1.5.6