37 Blit( StkFloat frequency = 220.0 );
49 void setPhase( StkFloat phase ) { phase_ = PI * phase; };
55 StkFloat
getPhase()
const {
return phase_ / PI; };
76 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
79 StkFloat
tick(
void );
93 void updateHarmonics(
void );
95 unsigned int nHarmonics_;
117 StkFloat tmp, denominator = sin( phase_ );
118 if ( denominator <= std::numeric_limits<StkFloat>::epsilon() )
121 tmp = sin( m_ * phase_ );
122 tmp /= m_ * denominator;
126 if ( phase_ >= PI ) phase_ -= PI;
129 return lastFrame_[0];
134 #if defined(_STK_DEBUG_) 135 if ( channel >= frames.
channels() ) {
136 oStream_ <<
"Blit::tick(): channel and StkFrames arguments are incompatible!";
141 StkFloat *samples = &frames[channel];
142 unsigned int hop = frames.
channels();
143 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
STK band-limited impulse train class.
Definition: Blit.h:33
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:407
StkFloat lastOut(void) const
Return the last computed output value.
Definition: Blit.h:76
StkFloat getPhase() const
Get the current phase of the signal.
Definition: Blit.h:55
The STK namespace.
Definition: ADSR.h:6
void setFrequency(StkFloat frequency)
Set the impulse train rate in terms of a frequency in Hz.
void setHarmonics(unsigned int nHarmonics=0)
Set the number of harmonics generated in the signal.
void reset()
Resets the oscillator state and phase to 0.
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:404
STK abstract unit generator parent class.
Definition: Generator.h:20
An STK class to handle vectorized audio data.
Definition: Stk.h:275
StkFloat tick(void)
Compute and return one output sample.
Definition: Blit.h:103
Blit(StkFloat frequency=220.0)
Default constructor that initializes BLIT frequency to 220 Hz.
void setPhase(StkFloat phase)
Set the phase of the signal.
Definition: Blit.h:49