Merge pull request #469 from paulfd/oversampling-offset
Oversampling offset
This commit is contained in:
commit
4acd1ca8c5
3 changed files with 2 additions and 13 deletions
|
|
@ -1010,7 +1010,7 @@ void sfz::Synth::checkNotePolyphony(const Region* region, int delay, const Trigg
|
|||
}
|
||||
break;
|
||||
case SfzSelfMask::dontMask:
|
||||
if (!selfMaskCandidate || selfMaskCandidate->getSourcePosition() < voice->getSourcePosition())
|
||||
if (!selfMaskCandidate || selfMaskCandidate->getAge() < voice->getAge())
|
||||
selfMaskCandidate = voice;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ void sfz::Voice::startVoice(Region* region, int delay, const TriggerEvent& event
|
|||
return;
|
||||
}
|
||||
speedRatio = static_cast<float>(currentPromise->sampleRate / this->sampleRate);
|
||||
sourcePosition = region->getOffset(currentPromise->oversamplingFactor);
|
||||
}
|
||||
|
||||
// do Scala retuning and reconvert the frequency into a 12TET key number
|
||||
|
|
@ -123,7 +124,6 @@ void sfz::Voice::startVoice(Region* region, int delay, const TriggerEvent& event
|
|||
equalizers[i].setup(*region, i, triggerEvent.value);
|
||||
}
|
||||
|
||||
sourcePosition = region->getOffset();
|
||||
triggerDelay = delay;
|
||||
initialDelay = delay + static_cast<int>(region->getDelay() * sampleRate);
|
||||
baseFrequency = resources.tuning.getFrequencyOfKey(triggerEvent.number);
|
||||
|
|
@ -856,11 +856,6 @@ bool sfz::Voice::releasedOrFree() const noexcept
|
|||
return state != State::playing || egAmplitude.isReleased();
|
||||
}
|
||||
|
||||
uint32_t sfz::Voice::getSourcePosition() const noexcept
|
||||
{
|
||||
return sourcePosition;
|
||||
}
|
||||
|
||||
void sfz::Voice::setMaxFiltersPerVoice(size_t numFilters)
|
||||
{
|
||||
if (numFilters == filters.size())
|
||||
|
|
|
|||
|
|
@ -248,12 +248,6 @@ public:
|
|||
* @return float
|
||||
*/
|
||||
float getAveragePower() const noexcept;
|
||||
/**
|
||||
* @brief Get the position of the voice in the source, in samples
|
||||
*
|
||||
* @return uint32_t
|
||||
*/
|
||||
uint32_t getSourcePosition() const noexcept;
|
||||
/**
|
||||
* Returns the region that is currently playing. May be null if the voice is not active!
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue