Homogeneize the treatment of percentage defaults and values
This commit is contained in:
parent
ca2ee8dc58
commit
9e824df346
2 changed files with 7 additions and 6 deletions
|
|
@ -295,7 +295,8 @@ bool sfz::Region::parseOpcode(const Opcode& opcode)
|
||||||
setCCPairFromOpcode(opcode, volumeCC, Default::volumeCCRange);
|
setCCPairFromOpcode(opcode, volumeCC, Default::volumeCCRange);
|
||||||
break;
|
break;
|
||||||
case hash("amplitude"):
|
case hash("amplitude"):
|
||||||
setValueFromOpcode(opcode, amplitude, Default::amplitudeRange);
|
if (auto value = readOpcode(opcode.value, Default::amplitudeRange))
|
||||||
|
amplitude = normalizePercents(*value);
|
||||||
break;
|
break;
|
||||||
case hash("amplitude_cc&"): // fallthrough
|
case hash("amplitude_cc&"): // fallthrough
|
||||||
case hash("amplitude_oncc&"):
|
case hash("amplitude_oncc&"):
|
||||||
|
|
@ -985,7 +986,7 @@ float sfz::Region::getBaseVolumedB(int noteNumber) const noexcept
|
||||||
|
|
||||||
float sfz::Region::getBaseGain() const noexcept
|
float sfz::Region::getBaseGain() const noexcept
|
||||||
{
|
{
|
||||||
return normalizePercents(amplitude);
|
return amplitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
float sfz::Region::getPhase() const noexcept
|
float sfz::Region::getPhase() const noexcept
|
||||||
|
|
|
||||||
|
|
@ -272,10 +272,10 @@ struct Region {
|
||||||
|
|
||||||
// Performance parameters: amplifier
|
// Performance parameters: amplifier
|
||||||
float volume { Default::volume }; // volume
|
float volume { Default::volume }; // volume
|
||||||
float amplitude { Default::amplitude }; // amplitude
|
float amplitude { normalizePercents(Default::amplitude) }; // amplitude
|
||||||
float pan { Default::pan }; // pan
|
float pan { normalizePercents(Default::pan) }; // pan
|
||||||
float width { Default::width }; // width
|
float width { normalizePercents(Default::width) }; // width
|
||||||
float position { Default::position }; // position
|
float position { normalizePercents(Default::position) }; // position
|
||||||
absl::optional<CCValuePair<float>> volumeCC; // volume_oncc
|
absl::optional<CCValuePair<float>> volumeCC; // volume_oncc
|
||||||
CCMap<float> amplitudeCC { Default::zeroModifier }; // amplitude_oncc
|
CCMap<float> amplitudeCC { Default::zeroModifier }; // amplitude_oncc
|
||||||
CCMap<float> panCC { Default::zeroModifier }; // pan_oncc
|
CCMap<float> panCC { Default::zeroModifier }; // pan_oncc
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue