aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_private.hpp
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-04-11 03:45:12 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-04-11 03:45:12 +0300
commit47e2f73719ab55075d2d479daea3e9269370d421 (patch)
tree192467ca9da51ce57eead2cbf0d2f66f96c2408a /src/adlmidi_private.hpp
parentff0982dd98cd7a828730a3498e3e7b9cd1daf868 (diff)
downloadlibADLMIDI-47e2f73719ab55075d2d479daea3e9269370d421.tar.gz
libADLMIDI-47e2f73719ab55075d2d479daea3e9269370d421.tar.bz2
libADLMIDI-47e2f73719ab55075d2d479daea3e9269370d421.zip
Move controls reset into same function
Also, fixed non-reseted bend sensitivity which distorts pitch on attempt to play another MIDI file
Diffstat (limited to 'src/adlmidi_private.hpp')
-rw-r--r--src/adlmidi_private.hpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 8e5f060..caaf4f9 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -125,6 +125,10 @@ typedef int32_t ssize_t;
#define ADL_UNUSED(x) (void)x
+#define OPL_PANNING_LEFT 0x10
+#define OPL_PANNING_RIGHT 0x20
+#define OPL_PANNING_BOTH 0x30
+
extern std::string ADLMIDI_ErrorString;
/*
@@ -587,26 +591,30 @@ public:
activenotemap_t activenotes;
void reset()
{
- portamento = 0;
+ resetAllControllers();
+ patch = 0;
+ vibpos = 0;
bank_lsb = 0;
bank_msb = 0;
- patch = 0;
+ lastlrpn = 0;
+ lastmrpn = 0;
+ nrpn = false;
+ is_xg_percussion = false;
+ }
+ void resetAllControllers()
+ {
+ bend = 0.0;
+ bendsense = 2 / 8192.0;
volume = 100;
expression = 127;
- panning = 0x30;
- vibrato = 0;
sustain = 0;
- bend = 0.0;
- bendsense = 2 / 8192.0;
- vibpos = 0;
+ vibrato = 0;
vibspeed = 2 * 3.141592653 * 5.0;
vibdepth = 0.5 / 127;
vibdelay = 0;
- lastlrpn = 0;
- lastmrpn = 0;
- nrpn = false;
+ panning = OPL_PANNING_BOTH;
+ portamento = 0;
brightness = 127;
- is_xg_percussion = false;
}
MIDIchannel()
: activenotes()