24 |
#include "../../common/Features.h" |
#include "../../common/Features.h" |
25 |
#include "Synthesizer.h" |
#include "Synthesizer.h" |
26 |
#include "Profiler.h" |
#include "Profiler.h" |
27 |
|
#include "Engine.h" |
28 |
|
#include "EngineChannel.h" |
29 |
|
|
30 |
#include "Voice.h" |
#include "Voice.h" |
31 |
|
|
58 |
if (pLFO3) delete pLFO3; |
if (pLFO3) delete pLFO3; |
59 |
} |
} |
60 |
|
|
61 |
void Voice::SetEngine(Engine* pEngine) { |
void Voice::SetEngine(LinuxSampler::Engine* pEngine) { |
62 |
this->pEngine = pEngine; |
Engine* engine = static_cast<Engine*>(pEngine); |
63 |
this->pDiskThread = pEngine->pDiskThread; |
this->pEngine = engine; |
64 |
|
this->pDiskThread = engine->pDiskThread; |
65 |
dmsg(6,("Voice::SetEngine()\n")); |
dmsg(6,("Voice::SetEngine()\n")); |
66 |
} |
} |
67 |
|
|
203 |
if (pDimRgn->PitchTrack && (MIDIKey - (int) pDimRgn->UnityNote) < 40) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100; |
if (pDimRgn->PitchTrack && (MIDIKey - (int) pDimRgn->UnityNote) < 40) pitchbasecents += (MIDIKey - (int) pDimRgn->UnityNote) * 100; |
204 |
|
|
205 |
this->PitchBase = RTMath::CentsToFreqRatioUnlimited(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->SampleRate)); |
this->PitchBase = RTMath::CentsToFreqRatioUnlimited(pitchbasecents) * (double(pSample->SamplesPerSecond) / double(pEngine->SampleRate)); |
206 |
this->PitchBend = RTMath::CentsToFreqRatio(PitchBend / 8192.0 * 100.0 * pEngineChannel->pInstrument->PitchbendRange); |
this->PitchBendRange = 1.0 / 8192.0 * 100.0 * pEngineChannel->pInstrument->PitchbendRange; |
207 |
|
this->PitchBend = RTMath::CentsToFreqRatio(PitchBend * PitchBendRange); |
208 |
} |
} |
209 |
|
|
210 |
// the length of the decay and release curves are dependent on the velocity |
// the length of the decay and release curves are dependent on the velocity |
750 |
} |
} |
751 |
|
|
752 |
void Voice::processPitchEvent(RTList<Event>::Iterator& itEvent) { |
void Voice::processPitchEvent(RTList<Event>::Iterator& itEvent) { |
753 |
PitchBend = RTMath::CentsToFreqRatio(itEvent->Param.Pitch.Pitch / 8192.0 * 100.0 * pEngineChannel->pInstrument->PitchbendRange); |
PitchBend = RTMath::CentsToFreqRatio(itEvent->Param.Pitch.Pitch * PitchBendRange); |
754 |
} |
} |
755 |
|
|
756 |
void Voice::processCutoffEvent(RTList<Event>::Iterator& itEvent) { |
void Voice::processCutoffEvent(RTList<Event>::Iterator& itEvent) { |