Skip to content

Commit

Permalink
Don't enforce MT32 defaults on XMI files
Browse files Browse the repository at this point in the history
This fully depends on bank: different AIL-based games used MT32 or GeneralMIDI depending on their bank and compilation options.
  • Loading branch information
Wohlstand committed Oct 27, 2022
1 parent 394ba00 commit 4bd0296
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/opnbank.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ struct OpnBankSetup
int lfoEnable;
int lfoFrequency;
int chipType;
bool mt32defaults;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/opnmidi_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ bool OPNMIDIplay::LoadBank(FileAndMemReader &fr)
synth.m_insBankSetup.lfoEnable = (wopn->lfo_freq & 8) != 0;
synth.m_insBankSetup.lfoFrequency = wopn->lfo_freq & 7;
synth.m_insBankSetup.chipType = wopn->chip_type;
// FIXME: Implement the bank-side flag to enable this
synth.m_insBankSetup.mt32defaults = false;
m_setup.VolumeModel = OPNMIDI_VolumeModel_AUTO;
m_setup.lfoEnable = -1;
m_setup.lfoFrequency = -1;
Expand Down
8 changes: 4 additions & 4 deletions src/opnmidi_midiplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ void OPNMIDIplay::resetMIDIDefaults(int offset)
for(size_t c = offset, n = m_midiChannels.size(); c < n; ++c)
{
MIDIchannel &ch = m_midiChannels[c];
if(synth.m_musicMode == Synth::MODE_XMIDI)

if(synth.m_musicMode == Synth::MODE_RSXX)
ch.def_volume = 127;
else if(synth.m_insBankSetup.mt32defaults)
{
ch.def_volume = 127;
ch.def_bendsense_lsb = 0;
ch.def_bendsense_msb = 12;
}
else
if(synth.m_musicMode == Synth::MODE_RSXX)
ch.def_volume = 127;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/opnmidi_opn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ OPN2::OPN2() :
m_insBankSetup.lfoEnable = false;
m_insBankSetup.lfoFrequency = 0;
m_insBankSetup.chipType = OPNChip_OPN2;
m_insBankSetup.mt32defaults = false;

// Initialize blank instruments banks
m_insBanks.clear();
Expand Down

0 comments on commit 4bd0296

Please sign in to comment.