Remove unnormalized versions from region

This commit is contained in:
Paul Fd 2020-03-26 00:32:02 +01:00 committed by Paul Ferrand
parent 1e2a18359e
commit 7ed7720a54
2 changed files with 0 additions and 88 deletions

View file

@ -805,11 +805,6 @@ bool sfz::Region::isSwitchedOn() const noexcept
return keySwitched && previousKeySwitched && sequenceSwitched && pitchSwitched && bpmSwitched && aftertouchSwitched && ccSwitched.all();
}
bool sfz::Region::registerNoteOn(int noteNumber, uint8_t velocity, float randValue) noexcept
{
return registerNoteOnNormalized(noteNumber, normalizeVelocity(velocity), randValue);
}
bool sfz::Region::registerNoteOnNormalized(int noteNumber, float velocity, float randValue) noexcept
{
ASSERT(velocity >= 0.0f && velocity <= 1.0f);
@ -864,11 +859,6 @@ bool sfz::Region::registerNoteOnNormalized(int noteNumber, float velocity, float
return keyOk && velOk && randOk && (attackTrigger || firstLegatoNote || notFirstLegatoNote);
}
bool sfz::Region::registerNoteOff(int noteNumber, uint8_t velocity, float randValue) noexcept
{
return registerNoteOffNormalized(noteNumber, normalizeVelocity(velocity), randValue);
}
bool sfz::Region::registerNoteOffNormalized(int noteNumber, float velocity, float randValue) noexcept
{
ASSERT(velocity >= 0.0f && velocity <= 1.0f);
@ -895,11 +885,6 @@ bool sfz::Region::registerNoteOffNormalized(int noteNumber, float velocity, floa
return keyOk && velOk && randOk && releaseTrigger;
}
bool sfz::Region::registerCC(int ccNumber, uint8_t ccValue) noexcept
{
return registerCCNormalized(ccNumber, normalizeCC(ccValue));
}
bool sfz::Region::registerCCNormalized(int ccNumber, float ccValue) noexcept
{
ASSERT(ccValue >= 0.0f && ccValue <= 1.0f);
@ -945,11 +930,6 @@ void sfz::Region::registerTempo(float secondsPerQuarter) noexcept
bpmSwitched = false;
}
float sfz::Region::getBasePitchVariation(int noteNumber, uint8_t velocity) const noexcept
{
return getBasePitchVariationNormalized(noteNumber, normalizeVelocity(velocity));
}
float sfz::Region::getBasePitchVariationNormalized(int noteNumber, float velocity) const noexcept
{
ASSERT(velocity >= 0.0f && velocity <= 1.0f);
@ -1059,11 +1039,6 @@ float crossfadeOut(const sfz::Range<T>& crossfadeRange, U value, SfzCrossfadeCur
return 1.0f;
}
float sfz::Region::getNoteGain(int noteNumber, uint8_t velocity) const noexcept
{
return getNoteGainNormalized(noteNumber, normalizeVelocity(velocity));
}
float sfz::Region::getNoteGainNormalized(int noteNumber, float velocity) const noexcept
{
ASSERT(velocity >= 0.0f && velocity <= 1.0f);
@ -1107,11 +1082,6 @@ float sfz::Region::getCrossfadeGain() const noexcept
return gain;
}
float sfz::Region::velocityCurve(uint8_t velocity) const noexcept
{
return velocityCurveNormalized(normalizeVelocity(velocity));
}
float sfz::Region::velocityCurveNormalized(float velocity) const noexcept
{
ASSERT(velocity >= 0.0f && velocity <= 1.0f);

View file

@ -74,30 +74,6 @@ struct Region {
* @return false
*/
bool isSwitchedOn() const noexcept;
/**
* @brief Register a new note on event. The region may be switched on or off using keys so
* this function updates the keyswitches state.
*
* @param noteNumber
* @param velocity
* @param randValue a random value between 0 and 1 used to randomize a bit the region activations
* and vary the samples
* @return true if the region should trigger on this event.
* @return false
*/
bool registerNoteOn(int noteNumber, uint8_t velocity, float randValue) noexcept;
/**
* @brief Register a new note off event. The region may be switched on or off using keys so
* this function updates the keyswitches state.
*
* @param noteNumber
* @param velocity
* @param randValue a random value between 0 and 1 used to randomize a bit the region activations
* and vary the samples
* @return true if the region should trigger on this event.
* @return false
*/
bool registerNoteOff(int noteNumber, uint8_t velocity, float randValue) noexcept;
/**
* @brief Register a new note on event. The region may be switched on or off using keys so
* this function updates the keyswitches state.
@ -122,16 +98,6 @@ struct Region {
* @return false
*/
bool registerNoteOffNormalized(int noteNumber, float velocity, float randValue) noexcept;
/**
* @brief Register a new CC event. The region may be switched on or off using CCs so
* this function checks if it indeeds need to activate or not.
*
* @param ccNumber
* @param ccValue
* @return true if the region should trigger on this event
* @return false
*/
bool registerCC(int ccNumber, uint8_t ccValue) noexcept;
/**
* @brief Register a new CC event. The region may be switched on or off using CCs so
* this function checks if it indeeds need to activate or not.
@ -161,15 +127,6 @@ struct Region {
*/
void registerTempo(float secondsPerQuarter) noexcept;
/**
* @brief Get the base pitch of the region depending on which note has been
* pressed and at which velocity.
*
* @param noteNumber
* @param velocity
* @return float
*/
float getBasePitchVariation(int noteNumber, uint8_t velocity) const noexcept;
/**
* @brief Get the base pitch of the region depending on which note has been
* pressed and at which velocity.
@ -179,15 +136,6 @@ struct Region {
* @return float
*/
float getBasePitchVariationNormalized(int noteNumber, float velocity) const noexcept;
/**
* @brief Get the note-related gain of the region depending on which note has been
* pressed and at which velocity.
*
* @param noteNumber
* @param velocity
* @return float
*/
float getNoteGain(int noteNumber, uint8_t velocity) const noexcept;
/**
* @brief Get the note-related gain of the region depending on which note has been
* pressed and at which velocity.
@ -225,12 +173,6 @@ struct Region {
* @return float
*/
float getPhase() const noexcept;
/**
* @brief Computes the gain value related to the velocity of the note
*
* @return float
*/
float velocityCurve(uint8_t velocity) const noexcept;
/**
* @brief Computes the gain value related to the velocity of the note
*