diff options
Diffstat (limited to 'src/devices/sound/spu_tables.cpp')
-rw-r--r-- | src/devices/sound/spu_tables.cpp | 838 |
1 files changed, 419 insertions, 419 deletions
diff --git a/src/devices/sound/spu_tables.cpp b/src/devices/sound/spu_tables.cpp index 922f2c2bccb..39cdf87d4b7 100644 --- a/src/devices/sound/spu_tables.cpp +++ b/src/devices/sound/spu_tables.cpp @@ -4,420 +4,6 @@ #include "spu.h" #include "spureverb.h" -const float spu_device::linear_rate[]= -{ - ms_to_rate(0.05f), - ms_to_rate(0.06f), - ms_to_rate(0.07f), - ms_to_rate(0.09f), - ms_to_rate(0.10f), - ms_to_rate(0.12f), - ms_to_rate(0.15f), - ms_to_rate(0.18f), - ms_to_rate(0.21f), - ms_to_rate(0.24f), - ms_to_rate(0.29f), - ms_to_rate(0.36f), - ms_to_rate(0.41f), - ms_to_rate(0.48f), - ms_to_rate(0.58f), - ms_to_rate(0.73f), - ms_to_rate(0.83f), - ms_to_rate(0.97f), - ms_to_rate(1.2f), - ms_to_rate(1.5f), - ms_to_rate(1.7f), - ms_to_rate(1.9f), - ms_to_rate(2.3f), - ms_to_rate(2.9f), - ms_to_rate(3.3f), - ms_to_rate(3.9f), - ms_to_rate(4.6f), - ms_to_rate(5.8f), - ms_to_rate(6.6f), - ms_to_rate(7.7f), - ms_to_rate(9.3f), - ms_to_rate(12.0f), - ms_to_rate(13.0f), - ms_to_rate(15.0f), - ms_to_rate(19.0f), - ms_to_rate(23.0f), - ms_to_rate(27.0f), - ms_to_rate(31.0f), - ms_to_rate(37.0f), - ms_to_rate(46.0f), - ms_to_rate(53.0f), - ms_to_rate(62.0f), - ms_to_rate(74.0f), - ms_to_rate(93.0f), - s_to_rate(0.11f), - s_to_rate(0.12f), - s_to_rate(0.15f), - s_to_rate(0.19f), - s_to_rate(0.21f), - s_to_rate(0.25f), - s_to_rate(0.30f), - s_to_rate(0.37f), - s_to_rate(0.42f), - s_to_rate(0.50f), - s_to_rate(0.59f), - s_to_rate(0.74f), - s_to_rate(0.85f), - s_to_rate(0.99f), - s_to_rate(1.2f), - s_to_rate(1.5f), - s_to_rate(1.7f), - s_to_rate(2.0f), - s_to_rate(2.4f), - s_to_rate(3.0f), - s_to_rate(3.4f), - s_to_rate(4.0f), - s_to_rate(4.8f), - s_to_rate(5.9f), - s_to_rate(6.8f), - s_to_rate(7.9f), - s_to_rate(9.5f), - s_to_rate(12.0f), - s_to_rate(14.0f), - s_to_rate(16.0f), - s_to_rate(19.0f), - s_to_rate(24.0f), - s_to_rate(27.0f), - s_to_rate(32.0f), - s_to_rate(38.0f), - s_to_rate(48.0f), - s_to_rate(54.0f), - s_to_rate(63.0f), - s_to_rate(76.0f), - s_to_rate(95.0f), - s_to_rate(109.0f), - s_to_rate(127.0f), - s_to_rate(152.0f), - s_to_rate(190.0f), - s_to_rate(218.0f), - s_to_rate(254.0f), - s_to_rate(304.0f), - s_to_rate(380.0f), - s_to_rate(436.0f), - s_to_rate(508.0f), - s_to_rate(608.0f), - s_to_rate(760.0f), - s_to_rate(872.0f), - s_to_rate(1016.0f), - s_to_rate(1216.0f), - s_to_rate(1520.0f), - s_to_rate(1744.0f), - s_to_rate(2032.0f), - s_to_rate(2432.0f), - s_to_rate(3040.0f), - s_to_rate(3488.0f), - s_to_rate(4064.0f), - s_to_rate(4864.0f), - s_to_rate(6080.0f) -}; - - -const float spu_device::pos_exp_rate[]= -{ - ms_to_rate(0.09f), - ms_to_rate(0.11f), - ms_to_rate(0.13f), - ms_to_rate(0.16f), - ms_to_rate(0.18f), - ms_to_rate(0.21f), - ms_to_rate(0.25f), - ms_to_rate(0.32f), - ms_to_rate(0.36f), - ms_to_rate(0.42f), - ms_to_rate(0.51f), - ms_to_rate(0.64f), - ms_to_rate(0.73f), - ms_to_rate(0.85f), - ms_to_rate(1.0f), - ms_to_rate(1.3f), - ms_to_rate(1.5f), - ms_to_rate(1.7f), - ms_to_rate(2.0f), - ms_to_rate(2.5f), - ms_to_rate(2.9f), - ms_to_rate(3.4f), - ms_to_rate(4.1f), - ms_to_rate(5.1f), - ms_to_rate(5.8f), - ms_to_rate(6.8f), - ms_to_rate(8.1f), - ms_to_rate(10.0f), - ms_to_rate(12.0f), - ms_to_rate(14.0f), - ms_to_rate(16.0f), - ms_to_rate(20.0f), - ms_to_rate(23.0f), - ms_to_rate(27.0f), - ms_to_rate(33.0f), - ms_to_rate(41.0f), - ms_to_rate(46.0f), - ms_to_rate(54.0f), - ms_to_rate(65.0f), - ms_to_rate(81.0f), - ms_to_rate(93.0f), - s_to_rate(0.11f), - s_to_rate(0.13f), - s_to_rate(0.16f), - s_to_rate(0.19f), - s_to_rate(0.22f), - s_to_rate(0.26f), - s_to_rate(0.33f), - s_to_rate(0.37f), - s_to_rate(0.43f), - s_to_rate(0.52f), - s_to_rate(0.65f), - s_to_rate(0.74f), - s_to_rate(0.87f), - s_to_rate(1.0f), - s_to_rate(1.3f), - s_to_rate(1.5f), - s_to_rate(1.7f), - s_to_rate(2.1f), - s_to_rate(2.6f), - s_to_rate(3.0f), - s_to_rate(3.5f), - s_to_rate(4.2f), - s_to_rate(5.2f), - s_to_rate(5.9f), - s_to_rate(6.9f), - s_to_rate(8.3f), - s_to_rate(10.0f), - s_to_rate(12.0f), - s_to_rate(14.0f), - s_to_rate(17.0f), - s_to_rate(21.0f), - s_to_rate(24.0f), - s_to_rate(28.0f), - s_to_rate(33.0f), - s_to_rate(42.0f), - s_to_rate(48.0f), - s_to_rate(55.0f), - s_to_rate(67.0f), - s_to_rate(83.0f), - s_to_rate(95.0f), - s_to_rate(111.0f), - s_to_rate(133.0f), - s_to_rate(166.0f), - s_to_rate(190.0f), - s_to_rate(222.0f), - s_to_rate(266.0f), - s_to_rate(333.0f), - s_to_rate(380.0f), - s_to_rate(444.0f), - s_to_rate(532.0f), - s_to_rate(666.0f), - s_to_rate(760.0f), - s_to_rate(888.0f), - s_to_rate(1064.0f), - s_to_rate(1332.0f), - s_to_rate(1520.0f), - s_to_rate(1776.0f), - s_to_rate(2128.0f), - s_to_rate(2664.0f) -}; - - -const float spu_device::neg_exp_rate[]= -{ - ms_to_rate(0.07f), - ms_to_rate(0.09f), - ms_to_rate(0.11f), - ms_to_rate(0.14f), - ms_to_rate(0.18f), - ms_to_rate(0.21f), - ms_to_rate(0.25f), - ms_to_rate(0.31f), - ms_to_rate(0.39f), - ms_to_rate(0.45f), - ms_to_rate(0.53f), - ms_to_rate(0.64f), - ms_to_rate(0.81f), - ms_to_rate(0.93f), - ms_to_rate(1.1f), - ms_to_rate(1.3f), - ms_to_rate(1.6f), - ms_to_rate(1.9f), - ms_to_rate(2.2f), - ms_to_rate(2.6f), - ms_to_rate(3.3f), - ms_to_rate(3.8f), - ms_to_rate(4.4f), - ms_to_rate(5.3f), - ms_to_rate(6.7f), - ms_to_rate(7.6f), - ms_to_rate(8.9f), - ms_to_rate(11.0f), - ms_to_rate(13.0f), - ms_to_rate(15.0f), - ms_to_rate(18.0f), - ms_to_rate(21.0f), - ms_to_rate(27.0f), - ms_to_rate(31.0f), - ms_to_rate(36.0f), - ms_to_rate(43.0f), - ms_to_rate(53.0f), - ms_to_rate(61.0f), - ms_to_rate(71.0f), - ms_to_rate(86.0f), - s_to_rate(0.11f), - s_to_rate(0.12f), - s_to_rate(0.14f), - s_to_rate(0.17f), - s_to_rate(0.21f), - s_to_rate(0.24f), - s_to_rate(0.29f), - s_to_rate(0.34f), - s_to_rate(0.43f), - s_to_rate(0.49f), - s_to_rate(0.57f), - s_to_rate(0.68f), - s_to_rate(0.86f), - s_to_rate(0.98f), - s_to_rate(1.1f), - s_to_rate(1.4f), - s_to_rate(1.7f), - s_to_rate(2.0f), - s_to_rate(2.3f), - s_to_rate(2.7f), - s_to_rate(3.4f), - s_to_rate(3.9f), - s_to_rate(4.6f), - s_to_rate(5.5f), - s_to_rate(6.8f), - s_to_rate(7.8f), - s_to_rate(9.1f), - s_to_rate(11.0f), - s_to_rate(14.0f), - s_to_rate(16.0f), - s_to_rate(18.0f), - s_to_rate(22.0f), - s_to_rate(27.0f), - s_to_rate(31.0f), - s_to_rate(36.0f), - s_to_rate(44.0f), - s_to_rate(55.0f), - s_to_rate(63.0f), - s_to_rate(73.0f), - s_to_rate(88.0f), - s_to_rate(109.0f), - s_to_rate(125.0f), - s_to_rate(146.0f), - s_to_rate(175.0f), - s_to_rate(219.0f), - s_to_rate(250.0f), - s_to_rate(292.0f), - s_to_rate(350.0f), - s_to_rate(438.0f), - s_to_rate(500.0f), - s_to_rate(584.0f), - s_to_rate(700.0f), - s_to_rate(876.0f), - s_to_rate(1000.0f), - s_to_rate(1168.0f), - s_to_rate(1400.0f), - s_to_rate(1752.0f), - s_to_rate(2000.0f), - s_to_rate(2336.0f), - s_to_rate(2800.0f), - s_to_rate(3504.0f), - s_to_rate(4000.0f), - s_to_rate(4672.0f), - s_to_rate(5600.0f), - s_to_rate(7008.0f), - s_to_rate(8000.0f), - s_to_rate(9344.0f), - s_to_rate(11200.0f) -}; - - -const float spu_device::decay_rate[16]= -{ - ms_to_rate(0.07f), - ms_to_rate(0.18f), - ms_to_rate(0.39f), - ms_to_rate(0.81f), - ms_to_rate(1.6f), - ms_to_rate(3.3f), - ms_to_rate(6.7f), - ms_to_rate(13.0f), - ms_to_rate(27.0f), - ms_to_rate(53.0f), - s_to_rate(0.11f), - s_to_rate(0.21f), - s_to_rate(0.43f), - s_to_rate(0.86f), - s_to_rate(1.7f), - s_to_rate(3.4f), -}; - -const float spu_device::linear_release_rate[]= -{ - ms_to_rate(0.04f), - ms_to_rate(0.09f), - ms_to_rate(0.18f), - ms_to_rate(0.36f), - ms_to_rate(0.73f), - ms_to_rate(1.5f), - ms_to_rate(2.9f), - ms_to_rate(5.8f), - ms_to_rate(12.0f), - ms_to_rate(23.0f), - ms_to_rate(46.0f), - ms_to_rate(93.0f), - s_to_rate(0.19f), - s_to_rate(0.37f), - s_to_rate(1.74f), - s_to_rate(1.5f), - s_to_rate(3.0f), - s_to_rate(5.9f), - s_to_rate(12.0f), - s_to_rate(24.0f), - s_to_rate(48.0f), - s_to_rate(95.0f), - s_to_rate(190.0f), - s_to_rate(380.0f), - s_to_rate(760.0f), - s_to_rate(1520.0f), - s_to_rate(3040.0f) -}; - - -const float spu_device::exp_release_rate[]= -{ - ms_to_rate(0.07f), - ms_to_rate(0.18f), - ms_to_rate(0.39f), - ms_to_rate(0.81f), - ms_to_rate(1.6f), - ms_to_rate(3.3f), - ms_to_rate(6.7f), - ms_to_rate(13.0f), - ms_to_rate(27.0f), - ms_to_rate(53.0f), - s_to_rate(0.11f), - s_to_rate(0.21f), - s_to_rate(0.43f), - s_to_rate(0.86f), - s_to_rate(1.7f), - s_to_rate(3.4f), - s_to_rate(6.8f), - s_to_rate(14.0f), - s_to_rate(27.0f), - s_to_rate(55.0f), - s_to_rate(109.0f), - s_to_rate(219.0f), - s_to_rate(438.0f), - s_to_rate(876.0f), - s_to_rate(1752.0f), - s_to_rate(3504.0f), - s_to_rate(7008.0f) -}; - // // @@ -615,9 +201,423 @@ spu_device::reverb_preset spu_device::reverb_presets[]= // // + + +void spu_device::generate_linear_rate_table() +{ + linear_rate[0] = ms_to_rate(0.05f); + linear_rate[1] = ms_to_rate(0.06f); + linear_rate[2] = ms_to_rate(0.07f); + linear_rate[3] = ms_to_rate(0.09f); + linear_rate[4] = ms_to_rate(0.10f); + linear_rate[5] = ms_to_rate(0.12f); + linear_rate[6] = ms_to_rate(0.15f); + linear_rate[7] = ms_to_rate(0.18f); + linear_rate[8] = ms_to_rate(0.21f); + linear_rate[9] = ms_to_rate(0.24f); + linear_rate[10] = ms_to_rate(0.29f); + linear_rate[11] = ms_to_rate(0.36f); + linear_rate[12] = ms_to_rate(0.41f); + linear_rate[13] = ms_to_rate(0.48f); + linear_rate[14] = ms_to_rate(0.58f); + linear_rate[15] = ms_to_rate(0.73f); + linear_rate[16] = ms_to_rate(0.83f); + linear_rate[17] = ms_to_rate(0.97f); + linear_rate[18] = ms_to_rate(1.2f); + linear_rate[19] = ms_to_rate(1.5f); + linear_rate[20] = ms_to_rate(1.7f); + linear_rate[21] = ms_to_rate(1.9f); + linear_rate[22] = ms_to_rate(2.3f); + linear_rate[23] = ms_to_rate(2.9f); + linear_rate[24] = ms_to_rate(3.3f); + linear_rate[25] = ms_to_rate(3.9f); + linear_rate[26] = ms_to_rate(4.6f); + linear_rate[27] = ms_to_rate(5.8f); + linear_rate[28] = ms_to_rate(6.6f); + linear_rate[29] = ms_to_rate(7.7f); + linear_rate[30] = ms_to_rate(9.3f); + linear_rate[31] = ms_to_rate(12.0f); + linear_rate[32] = ms_to_rate(13.0f); + linear_rate[33] = ms_to_rate(15.0f); + linear_rate[34] = ms_to_rate(19.0f); + linear_rate[35] = ms_to_rate(23.0f); + linear_rate[36] = ms_to_rate(27.0f); + linear_rate[37] = ms_to_rate(31.0f); + linear_rate[38] = ms_to_rate(37.0f); + linear_rate[39] = ms_to_rate(46.0f); + linear_rate[40] = ms_to_rate(53.0f); + linear_rate[41] = ms_to_rate(62.0f); + linear_rate[42] = ms_to_rate(74.0f); + linear_rate[43] = ms_to_rate(93.0f); + linear_rate[44] = s_to_rate(0.11f); + linear_rate[45] = s_to_rate(0.12f); + linear_rate[46] = s_to_rate(0.15f); + linear_rate[47] = s_to_rate(0.19f); + linear_rate[48] = s_to_rate(0.21f); + linear_rate[49] = s_to_rate(0.25f); + linear_rate[50] = s_to_rate(0.30f); + linear_rate[51] = s_to_rate(0.37f); + linear_rate[52] = s_to_rate(0.42f); + linear_rate[53] = s_to_rate(0.50f); + linear_rate[54] = s_to_rate(0.59f); + linear_rate[55] = s_to_rate(0.74f); + linear_rate[56] = s_to_rate(0.85f); + linear_rate[57] = s_to_rate(0.99f); + linear_rate[58] = s_to_rate(1.2f); + linear_rate[59] = s_to_rate(1.5f); + linear_rate[60] = s_to_rate(1.7f); + linear_rate[61] = s_to_rate(2.0f); + linear_rate[62] = s_to_rate(2.4f); + linear_rate[63] = s_to_rate(3.0f); + linear_rate[64] = s_to_rate(3.4f); + linear_rate[65] = s_to_rate(4.0f); + linear_rate[66] = s_to_rate(4.8f); + linear_rate[67] = s_to_rate(5.9f); + linear_rate[68] = s_to_rate(6.8f); + linear_rate[69] = s_to_rate(7.9f); + linear_rate[70] = s_to_rate(9.5f); + linear_rate[71] = s_to_rate(12.0f); + linear_rate[72] = s_to_rate(14.0f); + linear_rate[73] = s_to_rate(16.0f); + linear_rate[74] = s_to_rate(19.0f); + linear_rate[75] = s_to_rate(24.0f); + linear_rate[76] = s_to_rate(27.0f); + linear_rate[77] = s_to_rate(32.0f); + linear_rate[78] = s_to_rate(38.0f); + linear_rate[79] = s_to_rate(48.0f); + linear_rate[80] = s_to_rate(54.0f); + linear_rate[81] = s_to_rate(63.0f); + linear_rate[82] = s_to_rate(76.0f); + linear_rate[83] = s_to_rate(95.0f); + linear_rate[84] = s_to_rate(109.0f); + linear_rate[85] = s_to_rate(127.0f); + linear_rate[86] = s_to_rate(152.0f); + linear_rate[87] = s_to_rate(190.0f); + linear_rate[88] = s_to_rate(218.0f); + linear_rate[89] = s_to_rate(254.0f); + linear_rate[90] = s_to_rate(304.0f); + linear_rate[91] = s_to_rate(380.0f); + linear_rate[92] = s_to_rate(436.0f); + linear_rate[93] = s_to_rate(508.0f); + linear_rate[94] = s_to_rate(608.0f); + linear_rate[95] = s_to_rate(760.0f); + linear_rate[96] = s_to_rate(872.0f); + linear_rate[97] = s_to_rate(1016.0f); + linear_rate[98] = s_to_rate(1216.0f); + linear_rate[99] = s_to_rate(1520.0f); + linear_rate[100] = s_to_rate(1744.0f); + linear_rate[101] = s_to_rate(2032.0f); + linear_rate[102] = s_to_rate(2432.0f); + linear_rate[103] = s_to_rate(3040.0f); + linear_rate[104] = s_to_rate(3488.0f); + linear_rate[105] = s_to_rate(4064.0f); + linear_rate[106] = s_to_rate(4864.0f); + linear_rate[107] = s_to_rate(6080.0f); +} + + +void spu_device::generate_pos_exp_rate_table() +{ + pos_exp_rate[0] = ms_to_rate(0.09f); + pos_exp_rate[1] = ms_to_rate(0.11f); + pos_exp_rate[2] = ms_to_rate(0.13f); + pos_exp_rate[3] = ms_to_rate(0.16f); + pos_exp_rate[4] = ms_to_rate(0.18f); + pos_exp_rate[5] = ms_to_rate(0.21f); + pos_exp_rate[6] = ms_to_rate(0.25f); + pos_exp_rate[7] = ms_to_rate(0.32f); + pos_exp_rate[8] = ms_to_rate(0.36f); + pos_exp_rate[9] = ms_to_rate(0.42f); + pos_exp_rate[10] = ms_to_rate(0.51f); + pos_exp_rate[11] = ms_to_rate(0.64f); + pos_exp_rate[12] = ms_to_rate(0.73f); + pos_exp_rate[13] = ms_to_rate(0.85f); + pos_exp_rate[14] = ms_to_rate(1.0f); + pos_exp_rate[15] = ms_to_rate(1.3f); + pos_exp_rate[16] = ms_to_rate(1.5f); + pos_exp_rate[17] = ms_to_rate(1.7f); + pos_exp_rate[18] = ms_to_rate(2.0f); + pos_exp_rate[19] = ms_to_rate(2.5f); + pos_exp_rate[20] = ms_to_rate(2.9f); + pos_exp_rate[21] = ms_to_rate(3.4f); + pos_exp_rate[22] = ms_to_rate(4.1f); + pos_exp_rate[23] = ms_to_rate(5.1f); + pos_exp_rate[24] = ms_to_rate(5.8f); + pos_exp_rate[25] = ms_to_rate(6.8f); + pos_exp_rate[26] = ms_to_rate(8.1f); + pos_exp_rate[27] = ms_to_rate(10.0f); + pos_exp_rate[28] = ms_to_rate(12.0f); + pos_exp_rate[29] = ms_to_rate(14.0f); + pos_exp_rate[30] = ms_to_rate(16.0f); + pos_exp_rate[31] = ms_to_rate(20.0f); + pos_exp_rate[32] = ms_to_rate(23.0f); + pos_exp_rate[33] = ms_to_rate(27.0f); + pos_exp_rate[34] = ms_to_rate(33.0f); + pos_exp_rate[35] = ms_to_rate(41.0f); + pos_exp_rate[36] = ms_to_rate(46.0f); + pos_exp_rate[37] = ms_to_rate(54.0f); + pos_exp_rate[38] = ms_to_rate(65.0f); + pos_exp_rate[39] = ms_to_rate(81.0f); + pos_exp_rate[40] = ms_to_rate(93.0f); + pos_exp_rate[41] = s_to_rate(0.11f); + pos_exp_rate[42] = s_to_rate(0.13f); + pos_exp_rate[43] = s_to_rate(0.16f); + pos_exp_rate[44] = s_to_rate(0.19f); + pos_exp_rate[45] = s_to_rate(0.22f); + pos_exp_rate[46] = s_to_rate(0.26f); + pos_exp_rate[47] = s_to_rate(0.33f); + pos_exp_rate[48] = s_to_rate(0.37f); + pos_exp_rate[49] = s_to_rate(0.43f); + pos_exp_rate[50] = s_to_rate(0.52f); + pos_exp_rate[51] = s_to_rate(0.65f); + pos_exp_rate[52] = s_to_rate(0.74f); + pos_exp_rate[53] = s_to_rate(0.87f); + pos_exp_rate[54] = s_to_rate(1.0f); + pos_exp_rate[55] = s_to_rate(1.3f); + pos_exp_rate[56] = s_to_rate(1.5f); + pos_exp_rate[57] = s_to_rate(1.7f); + pos_exp_rate[58] = s_to_rate(2.1f); + pos_exp_rate[59] = s_to_rate(2.6f); + pos_exp_rate[60] = s_to_rate(3.0f); + pos_exp_rate[61] = s_to_rate(3.5f); + pos_exp_rate[62] = s_to_rate(4.2f); + pos_exp_rate[63] = s_to_rate(5.2f); + pos_exp_rate[64] = s_to_rate(5.9f); + pos_exp_rate[65] = s_to_rate(6.9f); + pos_exp_rate[66] = s_to_rate(8.3f); + pos_exp_rate[67] = s_to_rate(10.0f); + pos_exp_rate[68] = s_to_rate(12.0f); + pos_exp_rate[69] = s_to_rate(14.0f); + pos_exp_rate[70] = s_to_rate(17.0f); + pos_exp_rate[71] = s_to_rate(21.0f); + pos_exp_rate[72] = s_to_rate(24.0f); + pos_exp_rate[73] = s_to_rate(28.0f); + pos_exp_rate[74] = s_to_rate(33.0f); + pos_exp_rate[75] = s_to_rate(42.0f); + pos_exp_rate[76] = s_to_rate(48.0f); + pos_exp_rate[77] = s_to_rate(55.0f); + pos_exp_rate[78] = s_to_rate(67.0f); + pos_exp_rate[79] = s_to_rate(83.0f); + pos_exp_rate[80] = s_to_rate(95.0f); + pos_exp_rate[81] = s_to_rate(111.0f); + pos_exp_rate[82] = s_to_rate(133.0f); + pos_exp_rate[83] = s_to_rate(166.0f); + pos_exp_rate[84] = s_to_rate(190.0f); + pos_exp_rate[85] = s_to_rate(222.0f); + pos_exp_rate[86] = s_to_rate(266.0f); + pos_exp_rate[87] = s_to_rate(333.0f); + pos_exp_rate[88] = s_to_rate(380.0f); + pos_exp_rate[89] = s_to_rate(444.0f); + pos_exp_rate[90] = s_to_rate(532.0f); + pos_exp_rate[91] = s_to_rate(666.0f); + pos_exp_rate[92] = s_to_rate(760.0f); + pos_exp_rate[93] = s_to_rate(888.0f); + pos_exp_rate[94] = s_to_rate(1064.0f); + pos_exp_rate[95] = s_to_rate(1332.0f); + pos_exp_rate[96] = s_to_rate(1520.0f); + pos_exp_rate[97] = s_to_rate(1776.0f); + pos_exp_rate[98] = s_to_rate(2128.0f); + pos_exp_rate[99] = s_to_rate(2664.0f); +} + + +void spu_device::generate_neg_exp_rate_table() +{ + neg_exp_rate[0] = ms_to_rate(0.07f); + neg_exp_rate[1] = ms_to_rate(0.09f); + neg_exp_rate[2] = ms_to_rate(0.11f); + neg_exp_rate[3] = ms_to_rate(0.14f); + neg_exp_rate[4] = ms_to_rate(0.18f); + neg_exp_rate[5] = ms_to_rate(0.21f); + neg_exp_rate[6] = ms_to_rate(0.25f); + neg_exp_rate[7] = ms_to_rate(0.31f); + neg_exp_rate[8] = ms_to_rate(0.39f); + neg_exp_rate[9] = ms_to_rate(0.45f); + neg_exp_rate[10] = ms_to_rate(0.53f); + neg_exp_rate[11] = ms_to_rate(0.64f); + neg_exp_rate[12] = ms_to_rate(0.81f); + neg_exp_rate[13] = ms_to_rate(0.93f); + neg_exp_rate[14] = ms_to_rate(1.1f); + neg_exp_rate[15] = ms_to_rate(1.3f); + neg_exp_rate[16] = ms_to_rate(1.6f); + neg_exp_rate[17] = ms_to_rate(1.9f); + neg_exp_rate[18] = ms_to_rate(2.2f); + neg_exp_rate[19] = ms_to_rate(2.6f); + neg_exp_rate[20] = ms_to_rate(3.3f); + neg_exp_rate[21] = ms_to_rate(3.8f); + neg_exp_rate[22] = ms_to_rate(4.4f); + neg_exp_rate[23] = ms_to_rate(5.3f); + neg_exp_rate[24] = ms_to_rate(6.7f); + neg_exp_rate[25] = ms_to_rate(7.6f); + neg_exp_rate[26] = ms_to_rate(8.9f); + neg_exp_rate[27] = ms_to_rate(11.0f); + neg_exp_rate[28] = ms_to_rate(13.0f); + neg_exp_rate[29] = ms_to_rate(15.0f); + neg_exp_rate[30] = ms_to_rate(18.0f); + neg_exp_rate[31] = ms_to_rate(21.0f); + neg_exp_rate[32] = ms_to_rate(27.0f); + neg_exp_rate[33] = ms_to_rate(31.0f); + neg_exp_rate[34] = ms_to_rate(36.0f); + neg_exp_rate[35] = ms_to_rate(43.0f); + neg_exp_rate[36] = ms_to_rate(53.0f); + neg_exp_rate[37] = ms_to_rate(61.0f); + neg_exp_rate[38] = ms_to_rate(71.0f); + neg_exp_rate[39] = ms_to_rate(86.0f); + neg_exp_rate[40] = s_to_rate(0.11f); + neg_exp_rate[41] = s_to_rate(0.12f); + neg_exp_rate[42] = s_to_rate(0.14f); + neg_exp_rate[43] = s_to_rate(0.17f); + neg_exp_rate[44] = s_to_rate(0.21f); + neg_exp_rate[45] = s_to_rate(0.24f); + neg_exp_rate[46] = s_to_rate(0.29f); + neg_exp_rate[47] = s_to_rate(0.34f); + neg_exp_rate[48] = s_to_rate(0.43f); + neg_exp_rate[49] = s_to_rate(0.49f); + neg_exp_rate[50] = s_to_rate(0.57f); + neg_exp_rate[51] = s_to_rate(0.68f); + neg_exp_rate[52] = s_to_rate(0.86f); + neg_exp_rate[53] = s_to_rate(0.98f); + neg_exp_rate[54] = s_to_rate(1.1f); + neg_exp_rate[55] = s_to_rate(1.4f); + neg_exp_rate[56] = s_to_rate(1.7f); + neg_exp_rate[57] = s_to_rate(2.0f); + neg_exp_rate[58] = s_to_rate(2.3f); + neg_exp_rate[59] = s_to_rate(2.7f); + neg_exp_rate[60] = s_to_rate(3.4f); + neg_exp_rate[61] = s_to_rate(3.9f); + neg_exp_rate[62] = s_to_rate(4.6f); + neg_exp_rate[63] = s_to_rate(5.5f); + neg_exp_rate[64] = s_to_rate(6.8f); + neg_exp_rate[65] = s_to_rate(7.8f); + neg_exp_rate[66] = s_to_rate(9.1f); + neg_exp_rate[67] = s_to_rate(11.0f); + neg_exp_rate[68] = s_to_rate(14.0f); + neg_exp_rate[69] = s_to_rate(16.0f); + neg_exp_rate[70] = s_to_rate(18.0f); + neg_exp_rate[71] = s_to_rate(22.0f); + neg_exp_rate[72] = s_to_rate(27.0f); + neg_exp_rate[73] = s_to_rate(31.0f); + neg_exp_rate[74] = s_to_rate(36.0f); + neg_exp_rate[75] = s_to_rate(44.0f); + neg_exp_rate[76] = s_to_rate(55.0f); + neg_exp_rate[77] = s_to_rate(63.0f); + neg_exp_rate[78] = s_to_rate(73.0f); + neg_exp_rate[79] = s_to_rate(88.0f); + neg_exp_rate[80] = s_to_rate(109.0f); + neg_exp_rate[81] = s_to_rate(125.0f); + neg_exp_rate[82] = s_to_rate(146.0f); + neg_exp_rate[83] = s_to_rate(175.0f); + neg_exp_rate[84] = s_to_rate(219.0f); + neg_exp_rate[85] = s_to_rate(250.0f); + neg_exp_rate[86] = s_to_rate(292.0f); + neg_exp_rate[87] = s_to_rate(350.0f); + neg_exp_rate[88] = s_to_rate(438.0f); + neg_exp_rate[89] = s_to_rate(500.0f); + neg_exp_rate[90] = s_to_rate(584.0f); + neg_exp_rate[91] = s_to_rate(700.0f); + neg_exp_rate[92] = s_to_rate(876.0f); + neg_exp_rate[93] = s_to_rate(1000.0f); + neg_exp_rate[94] = s_to_rate(1168.0f); + neg_exp_rate[95] = s_to_rate(1400.0f); + neg_exp_rate[96] = s_to_rate(1752.0f); + neg_exp_rate[97] = s_to_rate(2000.0f); + neg_exp_rate[98] = s_to_rate(2336.0f); + neg_exp_rate[99] = s_to_rate(2800.0f); + neg_exp_rate[100] = s_to_rate(3504.0f); + neg_exp_rate[101] = s_to_rate(4000.0f); + neg_exp_rate[102] = s_to_rate(4672.0f); + neg_exp_rate[103] = s_to_rate(5600.0f); + neg_exp_rate[104] = s_to_rate(7008.0f); + neg_exp_rate[105] = s_to_rate(8000.0f); + neg_exp_rate[106] = s_to_rate(9344.0f); + neg_exp_rate[107] = s_to_rate(11200.0f); +} + +void spu_device::generate_decay_rate_table() +{ + decay_rate[0] = ms_to_rate(0.07f); + decay_rate[1] = ms_to_rate(0.18f); + decay_rate[2] = ms_to_rate(0.39f); + decay_rate[3] = ms_to_rate(0.81f); + decay_rate[4] = ms_to_rate(1.6f); + decay_rate[5] = ms_to_rate(3.3f); + decay_rate[6] = ms_to_rate(6.7f); + decay_rate[7] = ms_to_rate(13.0f); + decay_rate[8] = ms_to_rate(27.0f); + decay_rate[9] = ms_to_rate(53.0f); + decay_rate[10] = s_to_rate(0.11f); + decay_rate[11] = s_to_rate(0.21f); + decay_rate[12] = s_to_rate(0.43f); + decay_rate[13] = s_to_rate(0.86f); + decay_rate[14] = s_to_rate(1.7f); + decay_rate[15] = s_to_rate(3.4f); +} + +void spu_device::generate_linear_release_rate_table() +{ + linear_release_rate[0] = ms_to_rate(0.04f); + linear_release_rate[1] = ms_to_rate(0.09f); + linear_release_rate[2] = ms_to_rate(0.18f); + linear_release_rate[3] = ms_to_rate(0.36f); + linear_release_rate[4] = ms_to_rate(0.73f); + linear_release_rate[5] = ms_to_rate(1.5f); + linear_release_rate[6] = ms_to_rate(2.9f); + linear_release_rate[7] = ms_to_rate(5.8f); + linear_release_rate[8] = ms_to_rate(12.0f); + linear_release_rate[9] = ms_to_rate(23.0f); + linear_release_rate[10] = ms_to_rate(46.0f); + linear_release_rate[11] = ms_to_rate(93.0f); + linear_release_rate[12] = s_to_rate(0.19f); + linear_release_rate[13] = s_to_rate(0.37f); + linear_release_rate[14] = s_to_rate(1.74f); + linear_release_rate[15] = s_to_rate(1.5f); + linear_release_rate[16] = s_to_rate(3.0f); + linear_release_rate[17] = s_to_rate(5.9f); + linear_release_rate[18] = s_to_rate(12.0f); + linear_release_rate[19] = s_to_rate(24.0f); + linear_release_rate[20] = s_to_rate(48.0f); + linear_release_rate[21] = s_to_rate(95.0f); + linear_release_rate[22] = s_to_rate(190.0f); + linear_release_rate[23] = s_to_rate(380.0f); + linear_release_rate[24] = s_to_rate(760.0f); + linear_release_rate[25] = s_to_rate(1520.0f); + linear_release_rate[26] = s_to_rate(3040.0f); +} + +void spu_device::generate_exp_release_rate_table() +{ + exp_release_rate[0] = ms_to_rate(0.07f); + exp_release_rate[1] = ms_to_rate(0.18f); + exp_release_rate[2] = ms_to_rate(0.39f); + exp_release_rate[3] = ms_to_rate(0.81f); + exp_release_rate[4] = ms_to_rate(1.6f); + exp_release_rate[5] = ms_to_rate(3.3f); + exp_release_rate[6] = ms_to_rate(6.7f); + exp_release_rate[7] = ms_to_rate(13.0f); + exp_release_rate[8] = ms_to_rate(27.0f); + exp_release_rate[9] = ms_to_rate(53.0f); + exp_release_rate[10] = s_to_rate(0.11f); + exp_release_rate[11] = s_to_rate(0.21f); + exp_release_rate[12] = s_to_rate(0.43f); + exp_release_rate[13] = s_to_rate(0.86f); + exp_release_rate[14] = s_to_rate(1.7f); + exp_release_rate[15] = s_to_rate(3.4f); + exp_release_rate[16] = s_to_rate(6.8f); + exp_release_rate[17] = s_to_rate(14.0f); + exp_release_rate[18] = s_to_rate(27.0f); + exp_release_rate[19] = s_to_rate(55.0f); + exp_release_rate[20] = s_to_rate(109.0f); + exp_release_rate[21] = s_to_rate(219.0f); + exp_release_rate[22] = s_to_rate(438.0f); + exp_release_rate[23] = s_to_rate(876.0f); + exp_release_rate[24] = s_to_rate(1752.0f); + exp_release_rate[25] = s_to_rate(3504.0f); + exp_release_rate[26] = s_to_rate(7008.0f); +} + float spu_device::get_linear_rate(const int n) { - static constexpr int num_linear_rates=ARRAY_LENGTH(linear_rate); + int num_linear_rates=std::size(linear_rate); if (n>=num_linear_rates) return 0.0f; return linear_rate[n]*freq_multiplier; } @@ -630,7 +630,7 @@ float spu_device::get_linear_rate_neg_phase(const int n) float spu_device::get_pos_exp_rate(const int n) { - static constexpr int num_pos_exp_rates=ARRAY_LENGTH(pos_exp_rate); + int num_pos_exp_rates=std::size(pos_exp_rate); if (n>=num_pos_exp_rates) return 0.0f; return pos_exp_rate[n]*freq_multiplier; } @@ -643,7 +643,7 @@ float spu_device::get_pos_exp_rate_neg_phase(const int n) float spu_device::get_neg_exp_rate(const int n) { - static constexpr int num_neg_exp_rates=ARRAY_LENGTH(neg_exp_rate); + int num_neg_exp_rates=std::size(neg_exp_rate); if (n>=num_neg_exp_rates) return 0.0f; return -neg_exp_rate[n]*freq_multiplier; } @@ -666,14 +666,14 @@ float spu_device::get_sustain_level(const int n) float spu_device::get_linear_release_rate(const int n) { - static constexpr int num_linear_release_rates=ARRAY_LENGTH(linear_release_rate); + int num_linear_release_rates=std::size(linear_release_rate); if (n>=num_linear_release_rates) return 0.0f; return linear_release_rate[n]*freq_multiplier; } float spu_device::get_exp_release_rate(const int n) { - static constexpr int num_exp_release_rates=ARRAY_LENGTH(exp_release_rate); + int num_exp_release_rates=std::size(exp_release_rate); if (n>=num_exp_release_rates) return 0.0f; return exp_release_rate[n]*freq_multiplier; } |