aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_midiplay.cpp
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-05-31 02:37:09 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-05-31 02:37:09 +0300
commit91d6cdb84996710e993ccdf85203ac65c3238457 (patch)
tree6317a50369df58c0fbc6696898fb61297926617e /src/adlmidi_midiplay.cpp
parenta8f35b0f4449a395a8b9960d72eec9271b2d70bc (diff)
downloadlibADLMIDI-91d6cdb84996710e993ccdf85203ac65c3238457.tar.gz
libADLMIDI-91d6cdb84996710e993ccdf85203ac65c3238457.tar.bz2
libADLMIDI-91d6cdb84996710e993ccdf85203ac65c3238457.zip
Failed attempt to move RSXX note-on to aftertouch conversion
into preprocessor
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r--src/adlmidi_midiplay.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 52d8409..0ecb023 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1246,28 +1246,23 @@ void MIDIplay::realTime_NoteOff(uint8_t channel, uint8_t note)
void MIDIplay::realTime_NoteAfterTouch(uint8_t channel, uint8_t note, uint8_t atVal)
{
channel = channel % 16;
- MIDIchannel::activenoteiterator
- i = Ch[channel].activenotes_find(note);
- if(!i)
+ MIDIchannel::activenoteiterator i = Ch[channel].activenotes_find(note);
+ if(i)
{
- // Ignore touch if note is not active
- return;
+ i->vol = 127 - atVal;
+ NoteUpdate(channel, i, Upd_Volume);
}
- i->vol = 127 - atVal;
- NoteUpdate(channel, i, Upd_Volume);
}
void MIDIplay::realTime_ChannelAfterTouch(uint8_t channel, uint8_t atVal)
{
// TODO: Verify, is this correct action?
channel = channel % 16;
- for(MIDIchannel::activenoteiterator
- i = Ch[channel].activenotes_begin(); i; ++i)
+ for(MIDIchannel::activenoteiterator i = Ch[channel].activenotes_begin(); i; ++i)
{
// Set this pressure to all active notes on the channel
i->vol = 127 - atVal;
}
-
NoteUpdate_All(channel, Upd_Volume);
}
@@ -1964,9 +1959,16 @@ MIDIplay::MidiEvent MIDIplay::parseEvent(uint8_t **pptr, uint8_t *end, int &stat
evt.data.push_back(*(ptr++));
evt.data.push_back(*(ptr++));
- if((evType == MidiEvent::T_NOTEON) && (evt.data[1] == 0))
+ /* TODO: Implement conversion of RSXX's note volumes out of synthesizer */
+ /*if((opl.m_musicMode == OPL3::MODE_RSXX) && (evType == MidiEvent::T_NOTEON) && (evt.data[1] != 0))
+ {
+ //NOT WORKING YET
+ evt.type = MidiEvent::T_NOTETOUCH;
+ }
+ else */if((evType == MidiEvent::T_NOTEON) && (evt.data[1] == 0))
+ {
evt.type = MidiEvent::T_NOTEOFF; // Note ON with zero velocity is Note OFF!
- //111'th loopStart controller (RPG Maker and others)
+ } //111'th loopStart controller (RPG Maker and others)
else if((evType == MidiEvent::T_CTRLCHANGE) && (evt.data[0] == 111))
{
//Change event type to custom Loop Start event and clear data