aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--src/adlmidi_midiplay.cpp9
-rw-r--r--src/adlmidi_private.hpp4
3 files changed, 12 insertions, 2 deletions
diff --git a/README.md b/README.md
index 16b1b83..4ab9256 100644
--- a/README.md
+++ b/README.md
@@ -138,6 +138,7 @@ To build that example you will need to have installed SDL2 library.
* Added ability to disable embedded MIDI sequencer to use library as RealTime synthesizer only or use any custom MIDI sequencer plugins.
* Fixed blank instruments fallback in multi-bank support. When using non-zero bank, if instrument is blank, then, instrument will be taken from a root (I.e. zero bank).
* Added support for real-time switching the emulator
+ * Added support for CC-120 - "All sound off" on the MIDI channel
## 1.3.1 2017-12-16
* Added Real-Time MIDI API (MIDI event functions and adl_generate() to generate PCM between of event rows) which allows you to implement plugin for media players or even a real time MIDI playing driver.
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 7b15349..b053f01 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1338,6 +1338,10 @@ void MIDIplay::realTime_Controller(uint8_t channel, uint8_t type, uint8_t value)
KillSustainingNotes(channel);
break;
+ case 120: // All sounds off
+ NoteUpdate_All(channel, Upt_OffMute);
+ break;
+
case 123: // All notes off
NoteUpdate_All(channel, Upd_Off);
break;
@@ -1490,7 +1494,8 @@ void MIDIplay::NoteUpdate(uint16_t MidCh,
uint16_t c = j->first;
const MIDIchannel::NoteInfo::Phys &ins = j->second;
- if(select_adlchn >= 0 && c != select_adlchn) continue;
+ if(select_adlchn >= 0 && c != select_adlchn)
+ continue;
if(props_mask & Upd_Off) // note off
{
@@ -1507,6 +1512,8 @@ void MIDIplay::NoteUpdate(uint16_t MidCh,
if(ch[c].users.empty())
{
opl.NoteOff(c);
+ if(props_mask & Upd_Mute) // Mute the note
+ opl.Touch_Real(c, 0);
ch[c].koff_time_until_neglible =
ains.ms_sound_koff;
}
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 82a6627..4f727e2 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -943,7 +943,9 @@ private:
Upd_Volume = 0x4,
Upd_Pitch = 0x8,
Upd_All = Upd_Pan + Upd_Volume + Upd_Pitch,
- Upd_Off = 0x20
+ Upd_Off = 0x20,
+ Upd_Mute = 0x40,
+ Upt_OffMute = Upd_Off + Upd_Mute
};
void NoteUpdate(uint16_t MidCh,