corrected a bug on the offset calculation
This commit is contained in:
parent
05cef4286d
commit
ee9ce94ea8
1 changed files with 4 additions and 4 deletions
|
|
@ -73,21 +73,21 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
|
||||||
// DBG("Base gain: " << baseGain << " - with modifier: " << gain);
|
// DBG("Base gain: " << baseGain << " - with modifier: " << gain);
|
||||||
|
|
||||||
basePan = normalizeNegativePercents(region->pan);
|
basePan = normalizeNegativePercents(region->pan);
|
||||||
auto pan = basePan;
|
auto pan { basePan };
|
||||||
if (region->panCC)
|
if (region->panCC)
|
||||||
pan += normalizeCC(ccState[region->panCC->first]) * normalizeNegativePercents(region->panCC->second);
|
pan += normalizeCC(ccState[region->panCC->first]) * normalizeNegativePercents(region->panCC->second);
|
||||||
panEnvelope.reset(pan);
|
panEnvelope.reset(pan);
|
||||||
// DBG("Base pan: " << basePan << " - with modifier: " << pan);
|
// DBG("Base pan: " << basePan << " - with modifier: " << pan);
|
||||||
|
|
||||||
basePosition = normalizeNegativePercents(region->position);
|
basePosition = normalizeNegativePercents(region->position);
|
||||||
auto position = basePosition;
|
auto position { basePosition };
|
||||||
if (region->positionCC)
|
if (region->positionCC)
|
||||||
position += normalizeCC(ccState[region->positionCC->first]) * normalizeNegativePercents(region->positionCC->second);
|
position += normalizeCC(ccState[region->positionCC->first]) * normalizeNegativePercents(region->positionCC->second);
|
||||||
positionEnvelope.reset(position);
|
positionEnvelope.reset(position);
|
||||||
// DBG("Base position: " << basePosition << " - with modifier: " << position);
|
// DBG("Base position: " << basePosition << " - with modifier: " << position);
|
||||||
|
|
||||||
baseWidth = normalizeNegativePercents(region->width);
|
baseWidth = normalizeNegativePercents(region->width);
|
||||||
auto width = baseWidth;
|
auto width { baseWidth };
|
||||||
if (region->widthCC)
|
if (region->widthCC)
|
||||||
width += normalizeCC(ccState[region->widthCC->first]) * normalizeNegativePercents(region->widthCC->second);
|
width += normalizeCC(ccState[region->widthCC->first]) * normalizeNegativePercents(region->widthCC->second);
|
||||||
widthEnvelope.reset(width);
|
widthEnvelope.reset(width);
|
||||||
|
|
@ -96,7 +96,7 @@ void sfz::Voice::startVoice(Region* region, int delay, int channel, int number,
|
||||||
sourcePosition = region->getOffset();
|
sourcePosition = region->getOffset();
|
||||||
floatPosition = static_cast<float>(sourcePosition);
|
floatPosition = static_cast<float>(sourcePosition);
|
||||||
// DBG("Offset: " << floatPosition);
|
// DBG("Offset: " << floatPosition);
|
||||||
initialDelay = delay + region->getDelay();
|
initialDelay = delay + static_cast<uint32_t>(region->getDelay() / sampleRate);
|
||||||
baseFrequency = midiNoteFrequency(number) * pitchRatio;
|
baseFrequency = midiNoteFrequency(number) * pitchRatio;
|
||||||
prepareEGEnvelope(delay, value);
|
prepareEGEnvelope(delay, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue