Version 4.1.2

This commit is contained in:
Gary Scavone
2009-03-24 23:02:13 -04:00
committed by Stephen Sinclair
parent 6e0d1955a8
commit 586b0add5f
125 changed files with 7301 additions and 5337 deletions

View File

@@ -24,7 +24,6 @@
#include "Clarinet.h"
#include "SKINI.msg"
#include <string.h>
Clarinet :: Clarinet(MY_FLOAT lowestFrequency)
{
@@ -37,10 +36,8 @@ Clarinet :: Clarinet(MY_FLOAT lowestFrequency)
envelope = new Envelope;
noise = new Noise;
// Concatenate the STK RAWWAVE_PATH to the rawwave file
char path[128];
strcpy(path, RAWWAVE_PATH);
vibrato = new WaveLoop( strcat(path,"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;
@@ -67,7 +64,7 @@ void Clarinet :: setFrequency(MY_FLOAT frequency)
{
MY_FLOAT freakency = frequency;
if ( frequency <= 0.0 ) {
cerr << "Clarinet: setFrequency parameter is less than or equal to zero!" << endl;
std::cerr << "Clarinet: setFrequency parameter is less than or equal to zero!" << std::endl;
freakency = 220.0;
}
@@ -97,7 +94,7 @@ void Clarinet :: noteOn(MY_FLOAT frequency, MY_FLOAT amplitude)
outputGain = amplitude + (MY_FLOAT) 0.001;
#if defined(_STK_DEBUG_)
cerr << "Clarinet: NoteOn frequency = " << frequency << ", amplitude = " << amplitude << endl;
std::cerr << "Clarinet: NoteOn frequency = " << frequency << ", amplitude = " << amplitude << std::endl;
#endif
}
@@ -106,7 +103,7 @@ void Clarinet :: noteOff(MY_FLOAT amplitude)
this->stopBlowing(amplitude * (MY_FLOAT) 0.01);
#if defined(_STK_DEBUG_)
cerr << "Clarinet: NoteOff amplitude = " << amplitude << endl;
std::cerr << "Clarinet: NoteOff amplitude = " << amplitude << std::endl;
#endif
}
@@ -140,11 +137,11 @@ void Clarinet :: controlChange(int number, MY_FLOAT value)
MY_FLOAT norm = value * ONE_OVER_128;
if ( norm < 0 ) {
norm = 0.0;
cerr << "Clarinet: Control value less than zero!" << endl;
std::cerr << "Clarinet: Control value less than zero!" << std::endl;
}
else if ( norm > 1.0 ) {
norm = 1.0;
cerr << "Clarinet: Control value greater than 128.0!" << endl;
std::cerr << "Clarinet: Control value greater than 128.0!" << std::endl;
}
if (number == __SK_ReedStiffness_) // 2
@@ -158,9 +155,9 @@ void Clarinet :: controlChange(int number, MY_FLOAT value)
else if (number == __SK_AfterTouch_Cont_) // 128
envelope->setValue(norm);
else
cerr << "Clarinet: Undefined Control Number (" << number << ")!!" << endl;
std::cerr << "Clarinet: Undefined Control Number (" << number << ")!!" << std::endl;
#if defined(_STK_DEBUG_)
cerr << "Clarinet: controlChange number = " << number << ", value = " << value << endl;
std::cerr << "Clarinet: controlChange number = " << number << ", value = " << value << std::endl;
#endif
}