aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-29 03:18:31 -0800
committerChris Robinson <[email protected]>2013-12-29 03:18:31 -0800
commit1d41122372c821e85a6f150d6435b9c034365e42 (patch)
tree38ea001d55848fc19743b9710368a8b34342eff8
parentdeecbbc55d44a0043c92464949c83c9722d6be00 (diff)
Add filter properties
-rw-r--r--Alc/midi/base.c5
-rw-r--r--Alc/midi/fluidsynth.c4
-rw-r--r--Alc/midi/sf2load.c12
-rw-r--r--OpenAL32/Include/alMain.h4
-rw-r--r--OpenAL32/Include/alMidi.h5
-rw-r--r--OpenAL32/alFontsound.c38
6 files changed, 63 insertions, 5 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c
index 7eb2d2c5..19adc810 100644
--- a/Alc/midi/base.c
+++ b/Alc/midi/base.c
@@ -299,6 +299,11 @@ void ALfontsound_Construct(ALfontsound *self)
self->VibratoLfoToPitch = 0;
self->ModEnvToPitch = 0;
+ self->FilterCutoff = 13500;
+ self->FilterQ = 0;
+ self->ModLfoToFilterCutoff = 0;
+ self->ModEnvToFilterCutoff = 0;
+
self->ModEnv.DelayTime = -12000;
self->ModEnv.AttackTime = -12000;
self->ModEnv.HoldTime = -12000;
diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c
index 35092966..b19cfd03 100644
--- a/Alc/midi/fluidsynth.c
+++ b/Alc/midi/fluidsynth.c
@@ -166,6 +166,10 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan
fluid_voice_gen_set(voice, 5, sound->ModLfoToPitch);
fluid_voice_gen_set(voice, 6, sound->VibratoLfoToPitch);
fluid_voice_gen_set(voice, 7, sound->ModEnvToPitch);
+ fluid_voice_gen_set(voice, 8, sound->FilterCutoff);
+ fluid_voice_gen_set(voice, 9, sound->FilterQ);
+ fluid_voice_gen_set(voice, 10, sound->ModLfoToFilterCutoff);
+ fluid_voice_gen_set(voice, 11, sound->ModEnvToFilterCutoff);
fluid_voice_gen_set(voice, 25, sound->ModEnv.DelayTime);
fluid_voice_gen_set(voice, 26, sound->ModEnv.AttackTime);
fluid_voice_gen_set(voice, 27, sound->ModEnv.HoldTime);
diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c
index b33ea8af..de238296 100644
--- a/Alc/midi/sf2load.c
+++ b/Alc/midi/sf2load.c
@@ -802,10 +802,10 @@ static void fillZone(ALuint id, const GenModList *zone)
AL_MOD_LFO_TO_PITCH_SOFT, /* 5 - modLfoToPitch */
AL_VIBRATO_LFO_TO_PITCH_SOFT, /* 6 - vibLfoToPitch */
AL_MOD_ENV_TO_PITCH_SOFT, /* 7 - modEnvToPitch */
- 0, /* 8 - initialFilterFc */
- 0, /* 9 - initialFilterQ */
- 0, /* 10 - modLfoToFilterFc */
- 0, /* 11 - modEnvToFilterFc */
+ AL_FILTER_CUTOFF_SOFT, /* 8 - initialFilterFc */
+ AL_FILTER_RESONANCE_SOFT, /* 9 - initialFilterQ */
+ AL_MOD_LFO_TO_FILTER_CUTOFF_SOFT, /* 10 - modLfoToFilterFc */
+ AL_MOD_ENV_TO_FILTER_CUTOFF_SOFT, /* 11 - modEnvToFilterFc */
0, /* 12 - endAddrCoarseOffset */
0, /* 13 - modLfoToVolume */
0, /* 14 - */
@@ -895,7 +895,9 @@ static void fillZone(ALuint id, const GenModList *zone)
ALint value = (ALshort)gen->mAmount;
if(param == AL_BASE_KEY_SOFT && value == -1)
break;
- if(param == AL_LOOP_MODE_SOFT && value == 2)
+ if(param == AL_FILTER_RESONANCE_SOFT && value < 0)
+ value = 0;
+ else if(param == AL_LOOP_MODE_SOFT && value == 2)
value = 0;
alFontsoundiSOFT(id, param, value);
}
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index dc9cff60..86eef440 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -51,6 +51,10 @@
#define AL_MOD_LFO_TO_PITCH_SOFT 0x0005
#define AL_VIBRATO_LFO_TO_PITCH_SOFT 0x0006
#define AL_MOD_ENV_TO_PITCH_SOFT 0x0007
+#define AL_FILTER_CUTOFF_SOFT 0x0008
+#define AL_FILTER_RESONANCE_SOFT 0x0009
+#define AL_MOD_LFO_TO_FILTER_CUTOFF_SOFT 0x000A
+#define AL_MOD_ENV_TO_FILTER_CUTOFF_SOFT 0x000B
#define AL_MOD_ENV_DELAYTIME_SOFT 0x0019
#define AL_MOD_ENV_ATTACKTIME_SOFT 0x001A
#define AL_MOD_ENV_HOLDTIME_SOFT 0x001B
diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h
index acf6bf1a..a6e5c0a3 100644
--- a/OpenAL32/Include/alMidi.h
+++ b/OpenAL32/Include/alMidi.h
@@ -27,6 +27,11 @@ typedef struct ALfontsound {
ALint VibratoLfoToPitch;
ALint ModEnvToPitch;
+ ALint FilterCutoff;
+ ALint FilterQ;
+ ALint ModLfoToFilterCutoff;
+ ALint ModEnvToFilterCutoff;
+
struct {
ALint DelayTime;
ALint AttackTime;
diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c
index 6bbcaa72..d5aebb74 100644
--- a/OpenAL32/alFontsound.c
+++ b/OpenAL32/alFontsound.c
@@ -142,6 +142,24 @@ AL_API void AL_APIENTRY alFontsoundiSOFT(ALuint id, ALenum param, ALint value)
sound->ModEnvToPitch = value;
break;
+ case AL_FILTER_CUTOFF_SOFT:
+ sound->FilterCutoff = value;
+ break;
+
+ case AL_FILTER_RESONANCE_SOFT:
+ if(!(value >= 0))
+ SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
+ sound->FilterQ = value;
+ break;
+
+ case AL_MOD_LFO_TO_FILTER_CUTOFF_SOFT:
+ sound->ModLfoToFilterCutoff = value;
+ break;
+
+ case AL_MOD_ENV_TO_FILTER_CUTOFF_SOFT:
+ sound->ModEnvToFilterCutoff = value;
+ break;
+
case AL_MOD_ENV_DELAYTIME_SOFT:
sound->ModEnv.DelayTime = value;
break;
@@ -315,6 +333,10 @@ AL_API void AL_APIENTRY alFontsoundivSOFT(ALuint id, ALenum param, const ALint *
case AL_MOD_LFO_TO_PITCH_SOFT:
case AL_VIBRATO_LFO_TO_PITCH_SOFT:
case AL_MOD_ENV_TO_PITCH_SOFT:
+ case AL_FILTER_CUTOFF_SOFT:
+ case AL_FILTER_RESONANCE_SOFT:
+ case AL_MOD_LFO_TO_FILTER_CUTOFF_SOFT:
+ case AL_MOD_ENV_TO_FILTER_CUTOFF_SOFT:
case AL_MOD_ENV_DELAYTIME_SOFT:
case AL_MOD_ENV_ATTACKTIME_SOFT:
case AL_MOD_ENV_HOLDTIME_SOFT:
@@ -389,6 +411,22 @@ AL_API void AL_APIENTRY alGetFontsoundivSOFT(ALuint id, ALenum param, ALint *val
values[0] = sound->ModEnvToPitch;
break;
+ case AL_FILTER_CUTOFF_SOFT:
+ values[0] = sound->FilterCutoff;
+ break;
+
+ case AL_FILTER_RESONANCE_SOFT:
+ values[0] = sound->FilterQ;
+ break;
+
+ case AL_MOD_LFO_TO_FILTER_CUTOFF_SOFT:
+ values[0] = sound->ModLfoToFilterCutoff;
+ break;
+
+ case AL_MOD_ENV_TO_FILTER_CUTOFF_SOFT:
+ values[0] = sound->ModEnvToFilterCutoff;
+ break;
+
case AL_MOD_ENV_DELAYTIME_SOFT:
values[0] = sound->ModEnv.DelayTime;
break;