From acac06aae8e21bc36bc0a6c33718b756b6201041 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 4 Aug 2020 16:26:04 +0200 Subject: [PATCH] Rename v/r identifier vars to designate them as current --- src/sfizz/modulations/ModMatrix.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sfizz/modulations/ModMatrix.cpp b/src/sfizz/modulations/ModMatrix.cpp index 48b61f25..fe5866be 100644 --- a/src/sfizz/modulations/ModMatrix.cpp +++ b/src/sfizz/modulations/ModMatrix.cpp @@ -24,8 +24,8 @@ struct ModMatrix::Impl { uint32_t samplesPerBlock_ {}; uint32_t numFrames_ {}; - NumericId voiceId_ {}; - NumericId regionId_ {}; + NumericId currentVoiceId_ {}; + NumericId currentRegionId_ {}; struct Source { ModKey key; @@ -249,8 +249,8 @@ void ModMatrix::beginVoice(NumericId voiceId, NumericId regionId) { Impl& impl = *impl_; - impl.voiceId_ = voiceId; - impl.regionId_ = regionId; + impl.currentVoiceId_ = voiceId; + impl.currentRegionId_ = regionId; for (Impl::Source &source : impl.sources_) { const int flags = source.key.flags(); @@ -268,8 +268,8 @@ void ModMatrix::endVoice() { Impl& impl = *impl_; const uint32_t numFrames = impl.numFrames_; - const NumericId voiceId = impl.voiceId_; - const NumericId regionId = impl.regionId_; + const NumericId voiceId = impl.currentVoiceId_; + const NumericId regionId = impl.currentRegionId_; for (Impl::Source &source : impl.sources_) { if (!source.bufferReady) { @@ -281,8 +281,8 @@ void ModMatrix::endVoice() } } - impl.voiceId_ = {}; - impl.regionId_ = {}; + impl.currentVoiceId_ = {}; + impl.currentRegionId_ = {}; } float* ModMatrix::getModulation(TargetId targetId) @@ -291,7 +291,7 @@ float* ModMatrix::getModulation(TargetId targetId) return nullptr; Impl& impl = *impl_; - const NumericId regionId = impl.regionId_; + const NumericId regionId = impl.currentRegionId_; const uint32_t targetIndex = targetId.number(); Impl::Target &target = impl.targets_[targetIndex]; const int targetFlags = target.key.flags(); @@ -329,7 +329,7 @@ float* ModMatrix::getModulation(TargetId targetId) if (useThisSource) { if (isFirstSource) { - source.gen->generate(source.key, impl.voiceId_, buffer); + source.gen->generate(source.key, impl.currentVoiceId_, buffer); if (sourceDepth != 1) { for (uint32_t i = 0; i < numFrames; ++i) buffer[i] *= sourceDepth; @@ -338,7 +338,7 @@ float* ModMatrix::getModulation(TargetId targetId) } else { absl::Span temp(impl.temp_.data(), numFrames); - source.gen->generate(source.key, impl.voiceId_, temp); + source.gen->generate(source.key, impl.currentVoiceId_, temp); if (targetFlags & kModIsMultiplicative) { for (uint32_t i = 0; i < numFrames; ++i) buffer[i] *= sourceDepth * temp[i];