Add "Stereo Seperation" option for Tracker Modules

i forget how super stereo some of those are, even to the point of being nauseating
This commit is contained in:
alufolie91 committed 2023-08-22 06:21:33 +02:00
1 parent 84da9e2724
commit 8ae6d0c60f
5 files changed
+16 -2

No files matched your search

+1
View File
@@ -912,6 +912,7 @@ void D_RegisterClientCommands(void)
#ifdef HAVE_OPENMPT
CV_RegisterVar(&cv_modfilter);
CV_RegisterVar(&cv_stereosep);
CV_RegisterVar(&cv_amigafilter);
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
CV_RegisterVar(&cv_amigatype);
+1 -1
View File
@@ -1418,7 +1418,7 @@ static menuitem_t OP_SoundAdvancedMenu[] =
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
{IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62},
#endif
//{IT_STRING | IT_CVAR, NULL, "Dithering", &cv_mptdither, 82}
{IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 82},
};
#endif
+12 -1
View File
@@ -67,6 +67,7 @@ static void PlaySoundIfUnfocused_OnChange(void);
#ifdef HAVE_OPENMPT
static void ModFilter_OnChange(void);
static void StereoSep_OnChange(void);
static void AmigaFilter_OnChange(void);
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
static void AmigaType_OnChange(void);
@@ -141,13 +142,16 @@ consvar_t cv_music_resync_powerups_only = {"music_resync_powerups_only", "No", C
#ifdef HAVE_OPENMPT
openmpt_module *openmpt_mhandle = NULL;
static CV_PossibleValue_t interpolationfilter_cons_t[] = {{0, "Default"}, {1, "None"}, {2, "Linear"}, {4, "Cubic"}, {8, "Windowed sinc"}, {0, NULL}};
consvar_t cv_modfilter = {"modfilter", "4", CV_SAVE|CV_CALL, interpolationfilter_cons_t, ModFilter_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t stereosep_cons_t[] = {{0, "MIN"}, {200, "MAX"}, {0, NULL}};
consvar_t cv_stereosep = {"stereoseperation", "100", CV_SAVE|CV_CALL, stereosep_cons_t, StereoSep_OnChange, 0, NULL, NULL, 0, 0, NULL}; //some tracker modules have nauseously high stereo width
static CV_PossibleValue_t amigafilter_cons_t[] = {{0, "Off"}, {1, "On"}, {0, NULL}};
consvar_t cv_amigafilter = {"amigafilter", "1", CV_SAVE|CV_CALL, amigafilter_cons_t, AmigaFilter_OnChange, 0, NULL, NULL, 0, 0, NULL};
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
static CV_PossibleValue_t amigatype_cons_t[] = {{0, "auto"}, {1, "a500"}, {2, "a1200"}, {0, NULL}};
consvar_t cv_amigatype = {"amigatype", "0", CV_SAVE|CV_CALL, amigatype_cons_t, AmigaType_OnChange, 0, NULL, NULL, 0, 0, NULL};
@@ -2235,6 +2239,13 @@ void ModFilter_OnChange(void)
}
void StereoSep_OnChange(void)
{
if (openmpt_mhandle)
openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT, cv_stereosep.value);
}
void AmigaFilter_OnChange(void)
{
if (openmpt_mhandle)
+1
View File
@@ -44,6 +44,7 @@ extern consvar_t cv_playsoundifunfocused;
#ifdef HAVE_OPENMPT
extern consvar_t cv_modfilter;
extern consvar_t cv_stereosep;
extern consvar_t cv_amigafilter;
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
extern consvar_t cv_amigatype;
+1
View File
@@ -1257,6 +1257,7 @@ boolean I_PlaySong(boolean looping)
{
openmpt_module_select_subsong(openmpt_mhandle, 0);
openmpt_module_ctl_set(openmpt_mhandle, "dither", "1");
openmpt_module_set_render_param(openmpt_mhandle, OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT, cv_stereosep.value); //have a feeling some might like it
openmpt_module_ctl_set(openmpt_mhandle, "render.resampler.emulate_amiga", cv_amigafilter.value ? "1" : "0");
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
openmpt_module_ctl_set_text(openmpt_mhandle, "render.resampler.emulate_amiga_type", cv_amigatype.string);