diff --git a/lib/Envelope.cpp b/lib/Envelope.cpp index d328237..6b3b2e5 100644 --- a/lib/Envelope.cpp +++ b/lib/Envelope.cpp @@ -1,20 +1,22 @@ #include "amuse/Envelope.hpp" +#include + #include "amuse/AudioGroupPool.hpp" #include "amuse/Voice.hpp" namespace amuse { -static int32_t MIDItoTIME[104] = {/* [0..103] -> milliseconds */ - 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, - 110, 120, 130, 140, 150, 160, 170, 190, 200, 220, 230, 250, - 270, 290, 310, 330, 350, 380, 410, 440, 470, 500, 540, 580, - 620, 660, 710, 760, 820, 880, 940, 1000, 1000, 1100, 1200, 1300, - 1400, 1500, 1600, 1700, 1800, 2000, 2100, 2300, 2400, 2600, 2800, 3000, - 3200, 3500, 3700, 4000, 4300, 4600, 4900, 5300, 5700, 6100, 6500, 7000, - 7500, 8100, 8600, 9300, 9900, 10000, 11000, 12000, 13000, 14000, 15000, 16000, - 17000, 18000, 19000, 21000, 22000, 24000, 26000, 28000, 30000, 32000, 34000, 37000, - 39000, 42000, 45000, 49000, 50000, 55000, 60000, 65000}; +// [0..103] -> milliseconds +constexpr std::array MIDItoTIME{ + 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 110, 120, 130, + 140, 150, 160, 170, 190, 200, 220, 230, 250, 270, 290, 310, 330, 350, 380, + 410, 440, 470, 500, 540, 580, 620, 660, 710, 760, 820, 880, 940, 1000, 1000, + 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 2000, 2100, 2300, 2400, 2600, 2800, 3000, + 3200, 3500, 3700, 4000, 4300, 4600, 4900, 5300, 5700, 6100, 6500, 7000, 7500, 8100, 8600, + 9300, 9900, 10000, 11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 21000, 22000, 24000, + 26000, 28000, 30000, 32000, 34000, 37000, 39000, 42000, 45000, 49000, 50000, 55000, 60000, 65000, +}; void Envelope::reset(const ADSR* adsr) { m_phase = State::Attack;