diff options
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | src/adlmidi_midiplay.cpp | 5 |
2 files changed, 9 insertions, 2 deletions
@@ -178,6 +178,12 @@ To build that example you will need to have installed SDL2 library. * Add support of MIDI Format 2 files # Changelog +## dev + * Fixed the work on big endian processors + * Fixed ARM64 build on some platforms + * Improved support of the EA-MUS files (Thanks to [dashodanger](https://github.com/dashodanger)) + * Fixed crash on attempt to change the volume of a blank note + ## 1.5.1 2022-10-31 * Added an ability to disable the automatical arpeggio * Added an ability to set the count of loops (how many times to play the song) diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 5576e65..7d20abe 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -293,10 +293,11 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity) if(!i.is_end()) { MIDIchannel::NoteInfo &ni = i->value; - const int veloffset = ni.ains->midiVelocityOffset; + const int veloffset = ni.ains ? ni.ains->midiVelocityOffset : 0; velocity = (uint8_t)std::min(127, std::max(1, (int)velocity + veloffset)); ni.vol = velocity; - noteUpdate(channel, i, Upd_Volume); + if(ni.ains) + noteUpdate(channel, i, Upd_Volume); return false; } } |