diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/adldata.cpp | 2 | ||||
-rw-r--r-- | src/adlmidi_opl3.cpp | 21 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/adldata.cpp b/src/adldata.cpp index 0f1f77b..4ad2136 100644 --- a/src/adldata.cpp +++ b/src/adldata.cpp @@ -70,7 +70,7 @@ const BanksDump::BankEntry g_embeddedBanks[] = {0x0300, 1, 1, "SB (Action Soccer)", 114, 115}, {0x0300, 1, 0, "SB (3d Cyberpuck :: melodic only)", 116, 117}, {0x0300, 1, 0, "SB (Simon the Sorcerer :: melodic only)", 117, 118}, - {0x0304, 1, 1, "OP3 (The Fat Man 2op set)", 118, 119}, + {0x0304, 1, 1, "OP3 (The Fat Man 2op set; Win9x)", 118, 119}, {0x0307, 1, 1, "OP3 (The Fat Man 4op set)", 120, 121}, {0x0304, 1, 1, "OP3 (JungleVision 2op set :: melodic only)", 122, 123}, {0x0304, 1, 1, "OP3 (Wallace 2op set, Nitemare 3D :: melodic only)", 124, 125}, diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp index 334db43..96fa707 100644 --- a/src/adlmidi_opl3.cpp +++ b/src/adlmidi_opl3.cpp @@ -239,6 +239,22 @@ static const uint_fast32_t s_ail_vel_graph[16] = 106, 109, 112, 115, 118, 121, 124, 127 }; +//! a VERY APROXIMAL HMI volume model, TODO: Research accurate one! +static const uint_fast32_t s_hmi_volume_table[128] = +{ + 0x3f, 0x3f, 0x3a, 0x35, 0x35, 0x30, 0x30, 0x2c, 0x2c, 0x29, 0x29, + 0x25, 0x25, 0x24, 0x24, 0x23, 0x23, 0x22, 0x21, 0x21, 0x20, 0x20, + 0x1f, 0x1f, 0x1e, 0x1e, 0x1d, 0x1d, 0x1c, 0x1c, 0x1b, 0x1b, 0x1a, + 0x1a, 0x1a, 0x19, 0x19, 0x19, 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, + 0x16, 0x16, 0x16, 0x15, 0x15, 0x15, 0x14, 0x14, 0x14, 0x14, 0x13, + 0x13, 0x13, 0x13, 0x12, 0x12, 0x12, 0x12, 0x11, 0x11, 0x11, 0x10, + 0x10, 0x10, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e, 0x0e, 0x0d, 0x0d, 0x0d, + 0x0c, 0x0c, 0x0c, 0x0b, 0x0b, 0x0b, 0x0b, 0x0a, 0x0a, 0x0a, 0x0a, + 0x09, 0x09, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x07, + 0x07, 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, + 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 +}; enum { @@ -634,13 +650,14 @@ void OPL3::touchNote(size_t c, if(m_masterVolume < 127) midiVolume = (midiVolume * m_masterVolume) / 127; } + break; case Synth::VOLUME_HMI: { /* Temporarily copying DMX volume model. TODO: Reverse-engine the actual HMI volume model! */ volume = (channelVolume * channelExpression * m_masterVolume) / 16129; - volume = (s_dmx_volume_model[volume] + 1) << 1; - volume = (s_dmx_volume_model[(velocity < 128) ? velocity : 127] * volume) >> 9; + volume = (((velocity < 128) ? velocity : 127) * volume) / 127; + volume = 63 - s_hmi_volume_table[volume]; } break; } |