#include <SoundFileSourceHopper.h>
Inherits Marsyas::MarSystem.
Public Member Functions | |
| MarSystem * | clone () 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. | |
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.
Additional SoundFileSource settings can be configured through the internal SoundFileSource "src", for example with a control string like "SoundFileSource/src/mrs_string/currentlyPlaying".
Definition at line 76 of file SoundFileSourceHopper.h.
| 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().
| 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] |
Reads changed controls and sets up variables if necessary.
SoundFileSourceHopper::myUpdate() is largely based on Series::myUpdate(). One important difference is that the input flow settings of the SoundFileSourceHopper are ignored, The flow settings should be defined by the internal SoundFileSource MarSystem after all.
Reimplemented from MarSystem.
Definition at line 99 of file SoundFileSourceHopper.cpp.
References realvec::create(), SoundFileSourceHopper::ctrl_hopSize_, MarSystem::ctrl_inObservations_, MarSystem::ctrl_inObsNames_, MarSystem::ctrl_inSamples_, MarSystem::ctrl_israte_, SoundFileSourceHopper::ctrl_mixToMono_, MarSystem::ctrl_onObservations_, MarSystem::ctrl_onObsNames_, MarSystem::ctrl_onSamples_, MarSystem::ctrl_osrate_, MarSystem::ctrl_processedData_, SoundFileSourceHopper::ctrl_windowSize_, realvec::getCols(), realvec::getRows(), MarSystem::marsystems_, MarSystem::setctrl(), MarSystem::update(), and MarSystem::updControl().
1.5.6