From c375ab993e3eb4c04e5407580c03891d3c30baf8 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sun, 24 Jan 2021 21:40:00 +0300 Subject: Added an ability to disable auto-arpeggio Backported from libOPNMIDI --- src/adlmidi_midiplay.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/adlmidi_midiplay.cpp') 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(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 -- cgit v1.2.3