mirror of
https://github.com/thestk/stk
synced 2026-01-14 13:31:53 +00:00
Version 4.4.3
This commit is contained in:
committed by
Stephen Sinclair
parent
baca57040b
commit
0aec39260a
@@ -36,6 +36,11 @@ namespace stk {
|
||||
|
||||
BlitSquare:: BlitSquare( StkFloat frequency )
|
||||
{
|
||||
if ( frequency <= 0.0 ) {
|
||||
oStream_ << "BlitSquare::BlitSquare: argument (" << frequency << ") must be positive!";
|
||||
handleError( StkError::FUNCTION_ARGUMENT );
|
||||
}
|
||||
|
||||
nHarmonics_ = 0;
|
||||
this->setFrequency( frequency );
|
||||
this->reset();
|
||||
@@ -55,10 +60,10 @@ void BlitSquare :: reset()
|
||||
|
||||
void BlitSquare :: setFrequency( StkFloat frequency )
|
||||
{
|
||||
#if defined(_STK_DEBUG_)
|
||||
errorString_ << "BlitSquare::setFrequency: frequency = " << frequency << '.';
|
||||
handleError( StkError::DEBUG_WARNING );
|
||||
#endif
|
||||
if ( frequency <= 0.0 ) {
|
||||
oStream_ << "BlitSquare::setFrequency: argument (" << frequency << ") must be positive!";
|
||||
handleError( StkError::WARNING ); return;
|
||||
}
|
||||
|
||||
// By using an even value of the parameter M, we get a bipolar blit
|
||||
// waveform at half the blit frequency. Thus, we need to scale the
|
||||
@@ -85,11 +90,6 @@ void BlitSquare :: updateHarmonics( void )
|
||||
m_ = 2 * (nHarmonics_ + 1);
|
||||
|
||||
a_ = m_ / p_;
|
||||
|
||||
#if defined(_STK_DEBUG_)
|
||||
errorString_ << "BlitSquare::updateHarmonics: nHarmonics_ = " << nHarmonics_ << ", m_ = " << m_ << '.';
|
||||
handleError( StkError::DEBUG_WARNING );
|
||||
#endif
|
||||
}
|
||||
|
||||
} // stk namespace
|
||||
|
||||
Reference in New Issue
Block a user