Parse hint_sustain_cancels_release
This commit is contained in:
parent
8721c34e14
commit
1153c15211
5 changed files with 11 additions and 0 deletions
|
|
@ -187,6 +187,7 @@ FloatSpec lofiBitred { 0.0f, {0.0f, 100.0f}, 0 };
|
|||
FloatSpec lofiDecim { 0.0f, {0.0f, 100.0f}, 0 };
|
||||
FloatSpec rectify { 0.0f, {0.0f, 100.0f}, 0 };
|
||||
UInt32Spec stringsNumber { maxStrings, {0, maxStrings}, 0 };
|
||||
BoolSpec sustainCancelsRelease { false, {0, 1}, kEnforceBounds };
|
||||
|
||||
ESpec<Trigger> trigger { Trigger::attack, {Trigger::attack, Trigger::release_key}, 0};
|
||||
ESpec<CrossfadeCurve> crossfadeCurve { CrossfadeCurve::power, {CrossfadeCurve::gain, CrossfadeCurve::power}, 0};
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ namespace Default
|
|||
extern const OpcodeSpec<SelfMask> selfMask;
|
||||
extern const OpcodeSpec<FilterType> filter;
|
||||
extern const OpcodeSpec<EqType> eq;
|
||||
extern const OpcodeSpec<bool> sustainCancelsRelease;
|
||||
|
||||
// Default/max count for objects
|
||||
constexpr int numEQs { 3 };
|
||||
|
|
|
|||
|
|
@ -437,6 +437,12 @@ void Synth::Impl::handleControlOpcodes(const std::vector<Opcode>& members)
|
|||
DBG("Unsupported value for hint_stealing: " << member.value);
|
||||
}
|
||||
break;
|
||||
case hash("hint_sustain_cancels_release"):
|
||||
{
|
||||
SynthConfig& config = resources_.getSynthConfig();
|
||||
config.sustainCancelsRelease = member.read(Default::sustainCancelsRelease);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Unsupported control opcode
|
||||
DBG("Unsupported control opcode: " << member.name);
|
||||
|
|
|
|||
|
|
@ -28,5 +28,7 @@ struct SynthConfig
|
|||
{
|
||||
return freeWheeling ? freeWheelingOscillatorQuality : liveOscillatorQuality;
|
||||
}
|
||||
|
||||
bool sustainCancelsRelease { Default::sustainCancelsRelease };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -678,6 +678,7 @@ void Voice::registerCC(int delay, int ccNumber, float ccValue) noexcept
|
|||
release(delay);
|
||||
|
||||
if (region.checkSustain && (impl.sustainState_ == Impl::SustainState::Sustaining)
|
||||
&& impl.resources_.getSynthConfig().sustainCancelsRelease
|
||||
&& impl.released() && (region.trigger != Trigger::release && region.trigger != Trigger::release_key) ) {
|
||||
ModMatrix& modMatrix = impl.resources_.getModMatrix();
|
||||
modMatrix.cancelRelease(impl.id_, impl.region_->getId(), delay);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue