diff options
author | Wohlstand <admin@wohlnet.ru> | 2020-08-21 00:02:52 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2020-08-21 00:02:52 +0300 |
commit | 75637f387b2d91bf81ee2558244c030c3f7df26d (patch) | |
tree | a429ea9766f62c8617a56c06850083389df3306b | |
parent | baf7ea95709451989f02e0d2e2f27750e3ce74e5 (diff) | |
parent | 5ab3afa77e91ea4f7a64769ac8a1ac016e29bfeb (diff) | |
download | libADLMIDI-75637f387b2d91bf81ee2558244c030c3f7df26d.tar.gz libADLMIDI-75637f387b2d91bf81ee2558244c030c3f7df26d.tar.bz2 libADLMIDI-75637f387b2d91bf81ee2558244c030c3f7df26d.zip |
Merge branch 'master' into wip-new-embedded-banks
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | src/adlmidi_midiplay.cpp | 9 | ||||
-rw-r--r-- | utils/midiplay/adlmidiplay.cpp | 4 |
3 files changed, 10 insertions, 4 deletions
@@ -183,6 +183,7 @@ To build that example you will need to have installed SDL2 library. * Reworked rhythm-mode percussions system, WOPL banks with rhythm-mode percussions * Added Public Domain Opal OPL3 emulator made by Reality (a team who originally made the Reality Adlib Tracker) (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!) * Added LGPL licensed JavaOPL3 emulator made by Robson Cozendey in Java and later rewritten into C++ for GZDoom (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!) + * Fixed an accuracy of the DMX volume model ## 1.4.0 2018-10-01 * Implemented a full support for Portamento! (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!) diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 9342d55..697a264 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -709,8 +709,13 @@ void MIDIplay::realTime_ChannelAfterTouch(uint8_t channel, uint8_t atVal) void MIDIplay::realTime_Controller(uint8_t channel, uint8_t type, uint8_t value) { Synth &synth = *m_synth; + + if(value > 127) // Allowed values 0~127 only + value = 127; + if(static_cast<size_t>(channel) > m_midiChannels.size()) channel = channel % 16; + switch(type) { case 1: // Adjust vibrato @@ -1316,8 +1321,8 @@ void MIDIplay::noteUpdate(size_t midCh, case Synth::VOLUME_DMX: { - volume = 2 * (m_midiChannels[midCh].volume * m_midiChannels[midCh].expression * m_masterVolume / 16129) + 1; - //volume = 2 * (Ch[MidCh].volume) + 1; + volume = (m_midiChannels[midCh].volume * m_midiChannels[midCh].expression * m_masterVolume) / 16129; + volume = (DMX_volume_mapping_table[volume] + 1) << 1; volume = (DMX_volume_mapping_table[(vol < 128) ? vol : 127] * volume) >> 9; } break; diff --git a/utils/midiplay/adlmidiplay.cpp b/utils/midiplay/adlmidiplay.cpp index d374751..808315a 100644 --- a/utils/midiplay/adlmidiplay.cpp +++ b/utils/midiplay/adlmidiplay.cpp @@ -837,9 +837,9 @@ int main(int argc, char **argv) char posHMS[25]; uint64_t milliseconds_prev = ~0u; int printsCounter = 0; - int printsCounterPeriod = 2; + int printsCounterPeriod = 1; # ifdef HARDWARE_OPL3 - printsCounterPeriod = 1000; + printsCounterPeriod = 500; # endif std::fprintf(stdout, " \r"); |