aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--banks.ini6
-rw-r--r--include/adlmidi.h1
-rw-r--r--libADLMIDI-test.pro1
-rw-r--r--libADLMIDI.pro1
-rw-r--r--src/adldata.cpp8
-rw-r--r--src/adlmidi.cpp6
-rw-r--r--src/adlmidi_midiplay.cpp2
-rw-r--r--src/adlmidi_opl3.cpp2
-rw-r--r--src/cvt_xmi2mid.hpp2
-rw-r--r--src/midi_sequencer_impl.hpp13
-rw-r--r--utils/gen_adldata/scrapped.txt2
12 files changed, 33 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91baffb..aeec85e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,6 +226,7 @@ if(WITH_MIDI_SEQUENCER)
list(APPEND libADLMIDI_SOURCES
${libADLMIDI_SOURCE_DIR}/src/adlmidi_sequencer.cpp
)
+ add_definitions(-DENABLE_END_SILENCE_SKIPPING)
endif()
if(NOT WITH_MUS_SUPPORT OR NOT WITH_MIDI_SEQUENCER)
diff --git a/banks.ini b/banks.ini
index 33b55c5..a91c6aa 100644
--- a/banks.ini
+++ b/banks.ini
@@ -472,10 +472,10 @@ format = TMB
file = "fm_banks/op3_files/gmopl_wohl_mod.tmb"
prefix = "b65"
-; Jammey O'Connel's bank used in his FM Driver for Win3x/9x and was
+; Jamie O'Connell's bank used in his FM Driver for Win3x/9x and was
; pre-included with his SB-Timbre editor. Percussions are custom.
[bank-66]
-name = "SB (Jammey O'Connel's bank)"
+name = "SB (Jamie O'Connell's bank)"
format = TMB
file = "fm_banks/op3_files/gmoconel.tmb"
prefix = "b66"
@@ -484,7 +484,7 @@ prefix = "b66"
; May be listened from the setup utiltiy while testing music,
; or in the Duke Nukem 3D Beta.
[bank-67]
-name = "TMB (Default bank of Apgee Sound System)"
+name = "TMB (Default bank of Apogee Sound System)"
format = TMB
file = "fm_banks/tmb_files/default.tmb"
prefix = "3drm67"
diff --git a/include/adlmidi.h b/include/adlmidi.h
index 6ae184e..e2bc035 100644
--- a/include/adlmidi.h
+++ b/include/adlmidi.h
@@ -329,6 +329,7 @@ extern ADLMIDI_DECLSPEC int adl_loadEmbeddedBank(struct ADL_MIDIPlayer *device,
* If you want to specify custom number of four operator channels,
* please call this function after bank change (adl_setBank() or adl_openBank()),
* otherwise, value will be overwritten by auto-calculated.
+ * If the count is specified as -1, an auto-calculated amount is used instead.
*
* @param device Instance of the library
* @param ops4 Count of four-op channels to allocate between all emulating chips
diff --git a/libADLMIDI-test.pro b/libADLMIDI-test.pro
index d98d6bd..ec5dd1a 100644
--- a/libADLMIDI-test.pro
+++ b/libADLMIDI-test.pro
@@ -18,6 +18,7 @@ LIBS += -lSDL2 -lpthread -ldl
#DEFINES += DISABLE_EMBEDDED_BANKS
#DEFINES += ADLMIDI_USE_DOSBOX_OPL
#DEFINES += ENABLE_BEGIN_SILENCE_SKIPPING
+DEFINES += ENABLE_END_SILENCE_SKIPPING
#DEFINES += DEBUG_TRACE_ALL_EVENTS
#DEFINES += DEBUG_TRACE_ALL_CHANNELS
diff --git a/libADLMIDI.pro b/libADLMIDI.pro
index 92c6009..0044b76 100644
--- a/libADLMIDI.pro
+++ b/libADLMIDI.pro
@@ -12,6 +12,7 @@ INSTALLINCLUDESTO = ADLMIDI
include($$PWD/../audio_codec_common.pri)
DEFINES += ADLMIDI_DISABLE_CPP_EXTRAS
+DEFINES += ENABLE_END_SILENCE_SKIPPING
macx: QMAKE_CXXFLAGS_WARN_ON += -Wno-absolute-value
diff --git a/src/adldata.cpp b/src/adldata.cpp
index 6606e1f..b7fd3a1 100644
--- a/src/adldata.cpp
+++ b/src/adldata.cpp
@@ -9449,8 +9449,8 @@ const char* const banknames[76] =
"TMB (Shadow Warrior)",
"DMX (Raptor)",
"OP3 (Modded GMOPL by Wohlstand)",
- "SB (Jammey O'Connel's bank)",
- "TMB (Default bank of Apgee Sound System)",
+ "SB (Jamie O'Connell's bank)",
+ "TMB (Default bank of Apogee Sound System)",
"WOPL (4op bank by James Alan Nguyen and Wohlstand)",
"TMB (Blood)",
"TMB (Lee)",
@@ -10882,8 +10882,8 @@ const AdlBankSetup adlbanksetup[75] =
{3, 0, 0, 0, 0}, //Bank 63, TMB (Shadow Warrior)
{2, 0, 0, 0, 0}, //Bank 64, DMX (Raptor)
{3, 0, 0, 0, 0}, //Bank 65, OP3 (Modded GMOPL by Wohlstand)
- {3, 0, 0, 0, 0}, //Bank 66, SB (Jammey O'Connel's bank)
- {3, 0, 0, 0, 0}, //Bank 67, TMB (Default bank of Apgee Sound System)
+ {3, 0, 0, 0, 0}, //Bank 66, SB (Jamie O'Connell's bank)
+ {3, 0, 0, 0, 0}, //Bank 67, TMB (Default bank of Apogee Sound System)
{0, 1, 1, 0, 0}, //Bank 68, WOPL (4op bank by James Alan Nguyen and Wohlstand)
{3, 0, 0, 0, 0}, //Bank 69, TMB (Blood)
{3, 0, 0, 0, 0}, //Bank 70, TMB (Lee)
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index c7c5cf3..26a21e4 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -351,6 +351,10 @@ ADLMIDI_EXPORT int adl_setNumFourOpsChn(ADL_MIDIPlayer *device, int ops4)
{
if(!device)
return -1;
+
+ if(ops4 == -1)
+ return adlRefreshNumCards(device);
+
MidiPlayer *play = GET_MIDI_PLAYER(device);
if((unsigned int)ops4 > 6 * play->m_setup.numChips)
{
@@ -364,7 +368,7 @@ ADLMIDI_EXPORT int adl_setNumFourOpsChn(ADL_MIDIPlayer *device, int ops4)
play->m_synth.m_numFourOps = play->m_setup.numFourOps;
play->m_synth.updateChannelCategories();
- return 0; //adlRefreshNumCards(device);
+ return 0;
}
ADLMIDI_EXPORT int adl_getNumFourOpsChn(struct ADL_MIDIPlayer *device)
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index cdd4086..9a76236 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1600,7 +1600,7 @@ void MIDIplay::setRPN(size_t midCh, unsigned value, bool MSB)
case 0x0109 + 1*0x10000 + 1*0x20000:
if((m_synthMode & Mode_XG) != 0) // Vibrato depth
{
- m_midiChannels[midCh].vibdepth = ((value - 64) * 0.15) * 0.01;
+ m_midiChannels[midCh].vibdepth = (((int)value - 64) * 0.15) * 0.01;
}
break;
case 0x010A + 1*0x10000 + 1*0x20000:
diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp
index 7ec1fd6..60c173e 100644
--- a/src/adlmidi_opl3.cpp
+++ b/src/adlmidi_opl3.cpp
@@ -528,7 +528,7 @@ void OPL3::updateChannelCategories()
for(size_t b = 0; b < 23; ++b)
{
m_channelCategory[a * 23 + b] =
- (b >= 18) ? static_cast<int>(ChanCat_Rhythm_Bass + (b - 18)) :
+ (b >= 18) ? static_cast<ChanCat>(ChanCat_Rhythm_Bass + (b - 18)) :
(b >= 6 && b < 9) ? ChanCat_Rhythm_Slave : ChanCat_Regular;
}
}
diff --git a/src/cvt_xmi2mid.hpp b/src/cvt_xmi2mid.hpp
index decb25c..e8d9dbf 100644
--- a/src/cvt_xmi2mid.hpp
+++ b/src/cvt_xmi2mid.hpp
@@ -640,7 +640,7 @@ static int xmi2mid_GetVLQ2(struct xmi2mid_xmi_ctx *ctx, uint32_t *quant) {
int32_t data;
*quant = 0;
- for (i = 0; i < 4; i++) {
+ for (i = 0; xmi2mid_getsrcpos(ctx) != xmi2mid_getsrcsize(ctx); ++i) {
data = xmi2mid_read1(ctx);
if (data & 0x80) {
xmi2mid_skipsrc(ctx, -1);
diff --git a/src/midi_sequencer_impl.hpp b/src/midi_sequencer_impl.hpp
index 0fe6192..e54c7ee 100644
--- a/src/midi_sequencer_impl.hpp
+++ b/src/midi_sequencer_impl.hpp
@@ -614,6 +614,19 @@ bool BW_MidiSequencer::buildSmfTrackData(const std::vector<std::vector<uint8_t>
}
}
+#ifdef ENABLE_END_SILENCE_SKIPPING
+ //Have track end on its own row? Clear any delay on the row before
+ if(event.subtype == MidiEvent::ST_ENDTRACK && evtPos.events.size() == 1)
+ {
+ if (!m_trackData[tk].empty())
+ {
+ MidiTrackRow &previous = m_trackData[tk].back();
+ previous.delay = 0;
+ previous.timeDelay = 0;
+ }
+ }
+#endif
+
if((evtPos.delay > 0) || (event.subtype == MidiEvent::ST_ENDTRACK))
{
evtPos.absPos = abs_position;
diff --git a/utils/gen_adldata/scrapped.txt b/utils/gen_adldata/scrapped.txt
index 10c15cd..51a0497 100644
--- a/utils/gen_adldata/scrapped.txt
+++ b/utils/gen_adldata/scrapped.txt
@@ -75,7 +75,7 @@ static const char *const banknames[] =
"TMB (Shadow Warrior)",
"DMX (Raptor)",
"OP3 (Modded GMOPL by Wohlstand)",
- "SB (Jammey O'Connel's bank)",
+ "SB (Jamie O'Connell's bank)",
"TMB (Default bank of Build Engine)",
"OP3 (4op bank by James Alan Nguyen)",
"TMB (Blood)",