62 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
65 StkFloat
tick(
void );
79 void updateHarmonics(
void );
81 unsigned int nHarmonics_;
110 StkFloat tmp, denominator = sin( phase_ );
111 if ( fabs(denominator) <= std::numeric_limits<StkFloat>::epsilon() )
114 tmp = sin( m_ * phase_ );
115 tmp /= p_ * denominator;
119 state_ = tmp * 0.995;
122 if ( phase_ >= STK_PI ) phase_ -= STK_PI;
125 return lastFrame_[0];
130 #if defined(_STK_DEBUG_)
131 if ( channel >= frames.
channels() ) {
132 oStream_ <<
"BlitSaw::tick(): channel and StkFrames arguments are incompatible!";
138 StkFloat *samples = &frames[channel];
139 unsigned int hop = frames.
channels();
140 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
STK band-limited sawtooth wave class.
Definition: BlitSaw.h:32
StkFloat tick(void)
Compute and return one output sample.
Definition: BlitSaw.h:92
~BlitSaw()
Class destructor.
void reset()
Resets the oscillator state and phase to 0.
BlitSaw(StkFloat frequency=220.0)
Class constructor.
void setHarmonics(unsigned int nHarmonics=0)
Set the number of harmonics generated in the signal.
StkFloat lastOut(void) const
Return the last computed output value.
Definition: BlitSaw.h:62
void setFrequency(StkFloat frequency)
Set the sawtooth oscillator rate in terms of a frequency in Hz.
STK abstract unit generator parent class.
Definition: Generator.h:21
An STK class to handle vectorized audio data.
Definition: Stk.h:287
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:415
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:418
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
The STK namespace.
Definition: ADSR.h:8