30 FileLoop(
unsigned long chunkThreshold = 1000000,
unsigned long chunkSize = 1024 );
33 FileLoop( std::string fileName,
bool raw =
false,
bool doNormalize =
true,
34 unsigned long chunkThreshold = 1000000,
unsigned long chunkSize = 1024,
35 bool doInt2FloatScaling =
true );
51 virtual void openFile( std::string fileName,
bool raw =
false,
bool doNormalize =
true,
bool doInt2FloatScaling =
true );
60 unsigned int channelsOut(
void )
const {
return data_.channels(); };
78 unsigned long getSize(
void )
const {
return fileSize_; };
86 virtual StkFloat
getFileRate(
void )
const {
return data_.dataRate(); };
144 StkFloat
tick(
unsigned int channel = 0 );
157 virtual void fileRead(
StkFrames& buffer,
unsigned long startFrame,
bool doNormalize );
160 StkFloat phaseOffset_;
FileLoop(std::string fileName, bool raw=false, bool doNormalize=true, unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024, bool doInt2FloatScaling=true)
Class constructor that opens a specified file.
StkFloat tick(unsigned int channel=0)
Compute a sample frame and return the specified channel value.
FileLoop(unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)
Default constructor.
void setRate(StkFloat rate)
Set the data read rate in samples. The rate can be negative.
void addTime(StkFloat time)
Increment the read pointer by time samples, modulo file size.
virtual void closeFile(void)
Close a file if one is open.
Definition FileLoop.h:54
virtual StkFloat getFileRate(void) const
Return the input file sample rate in Hz (not the data read rate).
Definition FileLoop.h:86
unsigned int channelsOut(void) const
Return the number of audio channels in the data or stream.
Definition FileLoop.h:60
virtual StkFrames & tick(StkFrames &frames, unsigned int channel=0)
Fill the StkFrames object with computed sample frames, starting at the specified channel and return t...
virtual void reset(void)
Clear outputs and reset time (file) pointer to zero.
Definition FileLoop.h:57
void normalize(void)
Normalize data to a maximum of +-1.0.
Definition FileLoop.h:67
StkFloat lastOut(unsigned int channel=0)
Return the specified channel value of the last computed frame.
Definition FileLoop.h:132
void addPhase(StkFloat angle)
Increment current read pointer by angle, relative to a looping frequency.
virtual void openFile(std::string fileName, bool raw=false, bool doNormalize=true, bool doInt2FloatScaling=true)
Open the specified file and load its data.
void normalize(StkFloat peak)
Normalize data to a maximum of +-peak.
Definition FileLoop.h:74
virtual void addPhaseOffset(StkFloat angle)
Add a phase offset to the current read pointer.
~FileLoop(void)
Class destructor.
unsigned long getSize(void) const
Return the file size in sample frames.
Definition FileLoop.h:78
void setFrequency(StkFloat frequency)
Set the data interpolation rate based on a looping frequency.
Definition FileLoop.h:101
FileWvIn(unsigned long chunkThreshold=1000000, unsigned long chunkSize=1024)
Default constructor.
virtual void normalize(void)
Normalize data to a maximum of +-1.0.
virtual void reset(void)
Clear outputs and reset time (file) pointer to zero.
StkFloat lastOut(unsigned int channel=0)
Return the specified channel value of the last computed frame.
Definition FileWvIn.h:194
virtual void closeFile(void)
Close a file if one is open.
An STK class to handle vectorized audio data.
Definition Stk.h:287
static StkFloat sampleRate(void)
Static method that returns the current STK sample rate.
Definition Stk.h:156
The STK namespace.
Definition ADSR.h:8