ADL&OPN: More setup: Chips count and Volume model!

Notes:
* ADL: The DMX volume model was set as default to unify volumes on all bank. Otherwise, if you will use 'Generic' or 'Win9x', the sound will became too loud than wanted. Each bank has own default volume model which is used when 'Auto' is set.
* ADL: 6 chips is optimal to work with default banks
* OPN: 8 chips are set to provide 48 polyphony channels. (each OPN2 chip has 6 channels only)
* Text files: junk spaces from end of lines are was auto-removed.
This commit is contained in:
Vitaly Novichkov 2018-03-25 04:14:39 +03:00
parent 892033931e
commit 5a7b53a865
4 changed files with 156 additions and 99 deletions

View file

@ -54,6 +54,14 @@ enum
ME_PITCHWHEEL = 0xE0
};
CUSTOM_CVAR(Int, adl_chips_count, 6, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_ADL)
{
MIDIDeviceChanged(-1, true);
}
}
CUSTOM_CVAR(Int, adl_bank, 14, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_ADL)
@ -62,6 +70,14 @@ CUSTOM_CVAR(Int, adl_bank, 14, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
}
}
CUSTOM_CVAR(Int, adl_volume_model, ADLMIDI_VolumeModel_DMX, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_ADL)
{
MIDIDeviceChanged(-1, true);
}
}
//==========================================================================
//
// ADLMIDIDevice Constructor
@ -74,7 +90,9 @@ ADLMIDIDevice::ADLMIDIDevice(const char *args)
Renderer = adl_init(44100); // todo: make it configurable
if (Renderer != nullptr)
{
adl_setBank(Renderer, 14);
adl_setBank(Renderer, (int)adl_bank);
adl_setNumChips(Renderer, (int)adl_chips_count);
adl_setVolumeRangeModel(Renderer, (int)adl_volume_model);
}
}

View file

@ -55,6 +55,14 @@ enum
ME_PITCHWHEEL = 0xE0
};
CUSTOM_CVAR(Int, opn_chips_count, 8, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_OPN)
{
MIDIDeviceChanged(-1, true);
}
}
//==========================================================================
//
// OPNMIDIDevice Constructor
@ -73,7 +81,8 @@ OPNMIDIDevice::OPNMIDIDevice(const char *args)
I_Error("No OPN bank found");
}
FMemLump data = Wads.ReadLump(lump);
opn2_openBankData(Renderer, data.GetMem(), data.GetSize());
opn2_openBankData(Renderer, data.GetMem(), (long)data.GetSize());
opn2_setNumChips(Renderer, opn_chips_count);
}
}

View file

@ -2184,6 +2184,17 @@ ADVSNDMNU_FREEVERB = "Freeverb";
ADVSNDMNU_GLOBAL_FREEVERB = "Global Freeverb";
ADVSNDMNU_ADVRESAMPLING = "Advanced Resampling";
ADVSNDMNU_OPLBANK = "OPL Bank";
ADVSNDMNU_ADLNUMCHIPS = "Number of emulated OPL chips";
ADVSNDMNU_VLMODEL = "Volume model";
ADVSNDMNU_OPNNUMCHIPS = "Number of emulated OPN chips";
// ADLMIDI's volume models
ADLVLMODEL_AUTO = "Auto (Use setup of bank)";
ADLVLMODEL_GENERIC = "Generic";
ADLVLMODEL_NATIVE = "OPL Native";
ADLVLMODEL_DMX = "DMX";
ADLVLMODEL_APOGEE = "Apogee";
ADLVLMODEL_WIN9X = "Win9X-like";
// Module Replayer Options
MODMNU_TITLE = "MODULE REPLAYER OPTIONS";

View file

@ -1765,6 +1765,7 @@ OptionMenu ModReplayerOptions protected
Submenu "$ADVSNDMNU_WILDMIDI", "WildMidiOptions", 0, 1
Submenu "$ADVSNDMNU_OPLSYNTHESIS", "OPLOptions", 0, 1
Submenu "$ADVSNDMNU_ADLMIDI", "ADLOptions", 0, 1
Submenu "$ADVSNDMNU_OPNMIDI", "OPNOptions", 0, 1
}
OptionMenu FluidsynthOptions protected
@ -1811,12 +1812,30 @@ OptionMenu ModReplayerOptions protected
Option "$ADVSNDMNU_OPLCORES", "opl_core", "OplCores"
Slider "$ADVSNDMNU_OPLNUMCHIPS", "opl_numchips", 1, 8, 1, 0
Option "$ADVSNDMNU_OPLFULLPAN", "opl_fullpan", "OnOff"
}
}
OptionValue AdlVolumeModels
{
0, "$ADLVLMODEL_AUTO"
1, "$ADLVLMODEL_GENERIC"
2, "$ADLVLMODEL_NATIVE"
3, "$ADLVLMODEL_DMX"
4, "$ADLVLMODEL_APOGEE"
5, "$ADLVLMODEL_WIN9X"
}
OptionMenu ADLOptions protected
{
Title "$ADVSNDMNU_ADLMIDI"
LabeledSubmenu "$ADVSNDMNU_OPLBANK", "adl_bank", "ADLBankMenu"
LabeledSubmenu "$ADVSNDMNU_OPLBANK", "adl_bank", "ADLBankMenu"
Slider "$ADVSNDMNU_ADLNUMCHIPS", "adl_chips_count", 1, 32, 1, 0
Option "$ADVSNDMNU_VLMODEL", "adl_volume_model", "AdlVolumeModels"
}
OptionMenu OPNOptions protected
{
Title "$ADVSNDMNU_OPNMIDI"
Slider "$ADVSNDMNU_OPNNUMCHIPS", "opn_chips_count", 1, 32, 1, 0
}
/*=======================================