Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfd committed Mar 25, 2021
1 parent 6a00979 commit c53cbc4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/sfizz/modulations/sources/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ void ControllerSource::generate(const ModKey& sourceKey, NumericId<Voice> voiceI
const float fillValue =
voice && voice->getTriggerEvent().type == TriggerEventType::NoteOn ?
voice->getTriggerEvent().value : 0.0f;
sfz::fill(buffer, transformValue(fillValue));

if (p.step > 0.0f)
sfz::fill(buffer, std::trunc(transformValue(fillValue) / p.step) * p.step);
else
sfz::fill(buffer, transformValue(fillValue));

canShortcut = true;
break;
}
Expand All @@ -114,7 +119,12 @@ void ControllerSource::generate(const ModKey& sourceKey, NumericId<Voice> voiceI
const float fillValue =
voice && voice->getTriggerEvent().type == TriggerEventType::NoteOff ?
voice->getTriggerEvent().value : 0.0f;
sfz::fill(buffer, transformValue(fillValue));

if (p.step > 0.0f)
sfz::fill(buffer, std::trunc(transformValue(fillValue) / p.step) * p.step);
else
sfz::fill(buffer, transformValue(fillValue));

canShortcut = true;
break;
}
Expand Down

0 comments on commit c53cbc4

Please sign in to comment.