Removed the integer source position for now...
This commit is contained in:
parent
617e2375b3
commit
74c49c2c8c
2 changed files with 2 additions and 6 deletions
|
|
@ -55,6 +55,7 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
|
||||||
pitchRatio = region->getBasePitchVariation(number, value);
|
pitchRatio = region->getBasePitchVariation(number, value);
|
||||||
|
|
||||||
baseVolumedB = region->getBaseVolumedB();
|
baseVolumedB = region->getBaseVolumedB();
|
||||||
|
|
||||||
auto volumedB { baseVolumedB };
|
auto volumedB { baseVolumedB };
|
||||||
if (region->volumeCC)
|
if (region->volumeCC)
|
||||||
volumedB += normalizeCC(ccState[region->volumeCC->first]) * region->volumeCC->second;
|
volumedB += normalizeCC(ccState[region->volumeCC->first]) * region->volumeCC->second;
|
||||||
|
|
@ -93,8 +94,7 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
|
||||||
widthEnvelope.reset(width);
|
widthEnvelope.reset(width);
|
||||||
// DBG("Base width: " << baseWidth << " - with modifier: " << width);
|
// DBG("Base width: " << baseWidth << " - with modifier: " << width);
|
||||||
|
|
||||||
sourcePosition = region->getOffset();
|
floatPosition = static_cast<float>(region->getOffset());
|
||||||
floatPosition = static_cast<float>(sourcePosition);
|
|
||||||
// DBG("Offset: " << floatPosition);
|
// DBG("Offset: " << floatPosition);
|
||||||
initialDelay = delay + static_cast<uint32_t>(region->getDelay() / sampleRate);
|
initialDelay = delay + static_cast<uint32_t>(region->getDelay() / sampleRate);
|
||||||
baseFrequency = midiNoteFrequency(number) * pitchRatio;
|
baseFrequency = midiNoteFrequency(number) * pitchRatio;
|
||||||
|
|
@ -418,8 +418,6 @@ void sfz::Voice::fillWithGenerator(AudioSpan<float> buffer) noexcept
|
||||||
|
|
||||||
::sin<float>(tempSpan1.first(buffer.getNumFrames()), buffer.getSpan(0));
|
::sin<float>(tempSpan1.first(buffer.getNumFrames()), buffer.getSpan(0));
|
||||||
::copy<float>(buffer.getSpan(0), buffer.getSpan(1));
|
::copy<float>(buffer.getSpan(0), buffer.getSpan(1));
|
||||||
|
|
||||||
sourcePosition += buffer.getNumFrames();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sfz::Voice::checkOffGroup(int delay, uint32_t group) noexcept
|
bool sfz::Voice::checkOffGroup(int delay, uint32_t group) noexcept
|
||||||
|
|
@ -460,7 +458,6 @@ void sfz::Voice::reset() noexcept
|
||||||
if (region != nullptr) {
|
if (region != nullptr) {
|
||||||
DBG("Reset voice with sample " << region->sample);
|
DBG("Reset voice with sample " << region->sample);
|
||||||
}
|
}
|
||||||
sourcePosition = 0;
|
|
||||||
floatPosition = 0.0f;
|
floatPosition = 0.0f;
|
||||||
region = nullptr;
|
region = nullptr;
|
||||||
noteIsOff = false;
|
noteIsOff = false;
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,6 @@ private:
|
||||||
float baseFrequency { 440.0 };
|
float baseFrequency { 440.0 };
|
||||||
float phase { 0.0f };
|
float phase { 0.0f };
|
||||||
|
|
||||||
uint32_t sourcePosition { 0 };
|
|
||||||
float floatPosition { 0.0f };
|
float floatPosition { 0.0f };
|
||||||
uint32_t initialDelay { 0 };
|
uint32_t initialDelay { 0 };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue