Use the CC switch on the initial width and position with proper scaling
This commit is contained in:
parent
58a5e87df5
commit
3c14e15a16
1 changed files with 3 additions and 3 deletions
|
|
@ -63,19 +63,19 @@ void sfz::Voice::startVoice(Region* region, int delay, int number, uint8_t value
|
||||||
basePan = normalizeNegativePercents(region->pan);
|
basePan = normalizeNegativePercents(region->pan);
|
||||||
auto pan { basePan };
|
auto pan { basePan };
|
||||||
if (region->panCC)
|
if (region->panCC)
|
||||||
pan += normalizeCC(midiState.getCCValue(region->panCC->first)) * normalizeNegativePercents(region->panCC->second);
|
pan += normalizeCC(midiState.getCCValue(region->panCC->first)) * region->panCC->second / 100.0f;
|
||||||
panEnvelope.reset(Default::symmetricNormalizedRange.clamp(pan));
|
panEnvelope.reset(Default::symmetricNormalizedRange.clamp(pan));
|
||||||
|
|
||||||
basePosition = normalizeNegativePercents(region->position);
|
basePosition = normalizeNegativePercents(region->position);
|
||||||
auto position { basePosition };
|
auto position { basePosition };
|
||||||
if (region->positionCC)
|
if (region->positionCC)
|
||||||
position += normalizeCC(midiState.getCCValue(region->positionCC->first)) * normalizeNegativePercents(region->positionCC->second);
|
position += normalizeCC(midiState.getCCValue(region->positionCC->first)) * region->positionCC->second / 100.0f;
|
||||||
positionEnvelope.reset(Default::symmetricNormalizedRange.clamp(position));
|
positionEnvelope.reset(Default::symmetricNormalizedRange.clamp(position));
|
||||||
|
|
||||||
baseWidth = normalizeNegativePercents(region->width);
|
baseWidth = normalizeNegativePercents(region->width);
|
||||||
auto width { baseWidth };
|
auto width { baseWidth };
|
||||||
if (region->widthCC)
|
if (region->widthCC)
|
||||||
width += normalizeCC(midiState.getCCValue(region->widthCC->first)) * normalizeNegativePercents(region->widthCC->second);
|
width += normalizeCC(midiState.getCCValue(region->widthCC->first)) * region->widthCC->second / 100.0f;
|
||||||
widthEnvelope.reset(Default::symmetricNormalizedRange.clamp(width));
|
widthEnvelope.reset(Default::symmetricNormalizedRange.clamp(width));
|
||||||
|
|
||||||
pitchBendEnvelope.setFunction([region](float pitchValue){
|
pitchBendEnvelope.setFunction([region](float pitchValue){
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue