diff --git a/src/sfizz/ADSREnvelope.cpp b/src/sfizz/ADSREnvelope.cpp index e795d53f..edc708aa 100644 --- a/src/sfizz/ADSREnvelope.cpp +++ b/src/sfizz/ADSREnvelope.cpp @@ -14,7 +14,7 @@ namespace sfz { template void ADSREnvelope::reset(const Region& region, const MidiState& state, int delay, uint8_t velocity, float sampleRate) noexcept { - auto secondsToSamples = [sampleRate](auto timeInSeconds) { + auto secondsToSamples = [sampleRate](Type timeInSeconds) { return static_cast(timeInSeconds * sampleRate); }; diff --git a/src/sfizz/EventEnvelopes.cpp b/src/sfizz/EventEnvelopes.cpp index e42abcd0..c64a5415 100644 --- a/src/sfizz/EventEnvelopes.cpp +++ b/src/sfizz/EventEnvelopes.cpp @@ -53,7 +53,7 @@ void EventEnvelope::prepareEvents(int blockLength) if (resetEvents) clear(); - absl::c_stable_sort(events, [](const auto& lhs, const auto& rhs) { + absl::c_stable_sort(events, [](const std::pair& lhs, const std::pair& rhs) { return lhs.first < rhs.first; }); diff --git a/src/sfizz/Region.cpp b/src/sfizz/Region.cpp index 8dc962b4..7daa4f63 100644 --- a/src/sfizz/Region.cpp +++ b/src/sfizz/Region.cpp @@ -1011,7 +1011,7 @@ float sfz::Region::velocityCurve(uint8_t velocity) const noexcept float gain { 1.0f }; if (velocityPoints.size() > 0) { // Custom velocity curve - auto after = std::find_if(velocityPoints.begin(), velocityPoints.end(), [velocity](auto& val) { return val.first >= velocity; }); + auto after = std::find_if(velocityPoints.begin(), velocityPoints.end(), [velocity](const std::pair& val) { return val.first >= velocity; }); auto before = after == velocityPoints.begin() ? velocityPoints.begin() : after - 1; // Linear interpolation float relativePositionInSegment {