mirror of
https://github.com/thestk/stk
synced 2026-01-18 15:11:53 +00:00
Version 4.1.2
This commit is contained in:
committed by
Stephen Sinclair
parent
6e0d1955a8
commit
586b0add5f
@@ -36,7 +36,6 @@
|
||||
#include "BlowHole.h"
|
||||
#include "SKINI.msg"
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
BlowHole :: BlowHole(MY_FLOAT lowestFrequency)
|
||||
{
|
||||
@@ -83,10 +82,8 @@ BlowHole :: BlowHole(MY_FLOAT lowestFrequency)
|
||||
// Start with register vent closed
|
||||
vent->setGain(0.0);
|
||||
|
||||
// Concatenate the STK RAWWAVE_PATH to the rawwave file
|
||||
char file[128];
|
||||
strcpy(file, RAWWAVE_PATH);
|
||||
vibrato = new WaveLoop( strcat(file,"sinewave.raw"), TRUE );
|
||||
// Concatenate the STK rawwave path to the rawwave file
|
||||
vibrato = new WaveLoop( (Stk::rawwavePath() + "sinewave.raw").c_str(), TRUE );
|
||||
vibrato->setFrequency((MY_FLOAT) 5.735);
|
||||
outputGain = (MY_FLOAT) 1.0;
|
||||
noiseGain = (MY_FLOAT) 0.2;
|
||||
@@ -121,7 +118,7 @@ void BlowHole :: setFrequency(MY_FLOAT frequency)
|
||||
{
|
||||
MY_FLOAT freakency = frequency;
|
||||
if ( frequency <= 0.0 ) {
|
||||
cerr << "BlowHole: setFrequency parameter is less than or equal to zero!" << endl;
|
||||
std::cerr << "BlowHole: setFrequency parameter is less than or equal to zero!" << std::endl;
|
||||
freakency = 220.0;
|
||||
}
|
||||
|
||||
@@ -181,7 +178,7 @@ void BlowHole :: noteOn(MY_FLOAT frequency, MY_FLOAT amplitude)
|
||||
outputGain = amplitude + 0.001;
|
||||
|
||||
#if defined(_STK_DEBUG_)
|
||||
cerr << "BlowHole: NoteOn frequency = " << frequency << ", amplitude = " << amplitude << endl;
|
||||
std::cerr << "BlowHole: NoteOn frequency = " << frequency << ", amplitude = " << amplitude << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -190,7 +187,7 @@ void BlowHole :: noteOff(MY_FLOAT amplitude)
|
||||
this->stopBlowing(amplitude * 0.01);
|
||||
|
||||
#if defined(_STK_DEBUG_)
|
||||
cerr << "BlowHole: NoteOff amplitude = " << amplitude << endl;
|
||||
std::cerr << "BlowHole: NoteOff amplitude = " << amplitude << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -234,11 +231,11 @@ void BlowHole :: controlChange(int number, MY_FLOAT value)
|
||||
MY_FLOAT norm = value * ONE_OVER_128;
|
||||
if ( norm < 0 ) {
|
||||
norm = 0.0;
|
||||
cerr << "BlowHole: Control value less than zero!" << endl;
|
||||
std::cerr << "BlowHole: Control value less than zero!" << std::endl;
|
||||
}
|
||||
else if ( norm > 1.0 ) {
|
||||
norm = 1.0;
|
||||
cerr << "BlowHole: Control value greater than 128.0!" << endl;
|
||||
std::cerr << "BlowHole: Control value greater than 128.0!" << std::endl;
|
||||
}
|
||||
|
||||
if (number == __SK_ReedStiffness_) // 2
|
||||
@@ -252,9 +249,9 @@ void BlowHole :: controlChange(int number, MY_FLOAT value)
|
||||
else if (number == __SK_AfterTouch_Cont_) // 128
|
||||
envelope->setValue( norm );
|
||||
else
|
||||
cerr << "BlowHole: Undefined Control Number (" << number << ")!!" << endl;
|
||||
std::cerr << "BlowHole: Undefined Control Number (" << number << ")!!" << std::endl;
|
||||
|
||||
#if defined(_STK_DEBUG_)
|
||||
cerr << "BlowHole: controlChange number = " << number << ", value = " << value << endl;
|
||||
std::cerr << "BlowHole: controlChange number = " << number << ", value = " << value << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user