aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_midiplay.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2021-01-24 21:40:00 +0300
committerWohlstand <admin@wohlnet.ru>2021-01-24 21:40:00 +0300
commitc375ab993e3eb4c04e5407580c03891d3c30baf8 (patch)
tree66e4e92b1c4ea5cdc3aea2e48fe1df840b5258a1 /src/adlmidi_midiplay.cpp
parent831964b94a4c5abcf4e4e3c223bdbb2e02bbcfca (diff)
downloadlibADLMIDI-c375ab993e3eb4c04e5407580c03891d3c30baf8.tar.gz
libADLMIDI-c375ab993e3eb4c04e5407580c03891d3c30baf8.tar.bz2
libADLMIDI-c375ab993e3eb4c04e5407580c03891d3c30baf8.zip
Added an ability to disable auto-arpeggio
Backported from libOPNMIDI
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r--src/adlmidi_midiplay.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 9517dd0..9e2e437 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -91,6 +91,7 @@ MIDIplay::MIDIplay(unsigned long sampleRate):
//m_setup.SkipForward = 0;
m_setup.scaleModulators = -1;
m_setup.fullRangeBrightnessCC74 = false;
+ m_setup.enableAutoArpeggio = true;
m_setup.delay = 0.0;
m_setup.carry = 0.0;
m_setup.tick_skip_samples_delay = 0;
@@ -1503,6 +1504,9 @@ void MIDIplay::killOrEvacuate(size_t from_channel,
{
uint16_t cs = static_cast<uint16_t>(c);
+ if(!m_setup.enableAutoArpeggio)
+ break; // Arpeggio disabled completely
+
if(c >= maxChannels)
break;
if(c == from_channel)
@@ -1726,6 +1730,13 @@ void MIDIplay::updateArpeggio(double) // amount = amount of time passed
Synth &synth = *m_synth;
+ if(!m_setup.enableAutoArpeggio) // Arpeggio was disabled
+ {
+ if(m_arpeggioCounter != 0)
+ m_arpeggioCounter = 0;
+ return;
+ }
+
#if 0
const unsigned desired_arpeggio_rate = 40; // Hz (upper limit)
# if 1