aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--src/adlmidi_midiplay.cpp9
-rw-r--r--utils/midiplay/adlmidiplay.cpp4
3 files changed, 10 insertions, 4 deletions
diff --git a/README.md b/README.md
index db07572..2f00e5f 100644
--- a/README.md
+++ b/README.md
@@ -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");