Add LFO frequency as an EG target

This commit is contained in:
Python Blue 2022-07-20 02:24:46 +02:00 committed by Paul Ferrand
parent 1eb728c8d2
commit 935be2e55a
4 changed files with 20 additions and 0 deletions

View file

@ -1657,6 +1657,19 @@ bool sfz::Region::parseEGOpcodeV2(const Opcode& opcode)
break;
}
case hash("eg&_freq_lfo&"):
if (lfos.size() < opcode.parameters[1] - 1)
return false;
EG_target(ModKey::createNXYZ(ModId::LFOFrequency, id, opcode.parameters[1] - 1), Default::lfoFreqMod);
break;
case_any_ccN("eg&_freq_lfo&"):
if (lfos.size() < opcode.parameters[1] - 1)
return false;
EG_target_cc(ModKey::createNXYZ(ModId::LFOFrequency, id, opcode.parameters[1] - 1), Default::lfoFreqMod);
break;
default:
return false;
}

View file

@ -150,6 +150,8 @@ int ModIds::flags(ModId id) noexcept
return kModIsPerVoice|kModIsAdditive;
case ModId::EGEqBandwidthDepth:
return kModIsPerVoice|kModIsAdditive;
case ModId::EGLFOFreqDepth:
return kModIsPerVoice|kModIsAdditive;
// unknown
default:

View file

@ -89,6 +89,7 @@ enum class ModId : int {
EGEqGainDepth,
EGEqFrequencyDepth,
EGEqBandwidthDepth,
EGLFOFreqDepth,
_TargetsEnd,
// [/targets] --------------------------------------------------------------

View file

@ -220,6 +220,8 @@ std::string ModKey::toString() const
return absl::StrCat("EGEqFrequencyDepth {", region_.number(), ", N=", 1 + params_.N, ", X=", 1 + params_.X, "}");
case ModId::EGEqBandwidthDepth:
return absl::StrCat("EGEqBandwidthDepth {", region_.number(), ", N=", 1 + params_.N, ", X=", 1 + params_.X, "}");
case ModId::EGLFOFreqDepth:
return absl::StrCat("EGLFOFreqDepth {", region_.number(), ", N=", 1 + params_.N, ", X=", 1 + params_.X, "}");
default:
return {};
@ -334,6 +336,8 @@ ModKey ModKey::getSourceDepthKey(ModKey source, ModKey target)
return ModKey::createNXYZ(ModId::EGEqFrequencyDepth, region, tp.N, tp.X);
case ModId::EqBandwidth:
return ModKey::createNXYZ(ModId::EGEqBandwidthDepth, region, tp.N, tp.X);
case ModId:: LFOFrequency:
return ModKey::createNXYZ(ModId::EGLFOFreqDepth, region, tp.N, tp.X);
default:
break;
}