diff options
author | Chris Robinson <[email protected]> | 2013-12-29 04:36:01 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-29 04:36:01 -0800 |
commit | 4c35f7c63243c7ffa251047074d44e6073edb435 (patch) | |
tree | a2e58b8cc67a3df124b66437afd7fb6c27414fe1 | |
parent | 15aa12847d7d2797d5ef37ae428d5ab9afe0753a (diff) |
Add chorus and reverb send properties
-rw-r--r-- | Alc/midi/base.c | 3 | ||||
-rw-r--r-- | Alc/midi/fluidsynth.c | 2 | ||||
-rw-r--r-- | Alc/midi/sf2load.c | 6 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alMidi.h | 3 | ||||
-rw-r--r-- | OpenAL32/alFontsound.c | 22 |
6 files changed, 36 insertions, 2 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c index 1c6a2fcf..82e35a9d 100644 --- a/Alc/midi/base.c +++ b/Alc/midi/base.c @@ -306,6 +306,9 @@ void ALfontsound_Construct(ALfontsound *self) self->Pan = 0; + self->ChorusSend = 0; + self->ReverbSend = 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 106f538d..944b7b8f 100644 --- a/Alc/midi/fluidsynth.c +++ b/Alc/midi/fluidsynth.c @@ -170,6 +170,8 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan 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, 15, sound->ChorusSend); + fluid_voice_gen_set(voice, 16, sound->ReverbSend); fluid_voice_gen_set(voice, 17, sound->Pan); fluid_voice_gen_set(voice, 25, sound->ModEnv.DelayTime); fluid_voice_gen_set(voice, 26, sound->ModEnv.AttackTime); diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c index 931b5945..af342a9e 100644 --- a/Alc/midi/sf2load.c +++ b/Alc/midi/sf2load.c @@ -809,8 +809,8 @@ static void fillZone(ALuint id, const GenModList *zone) 0, /* 12 - endAddrCoarseOffset */ 0, /* 13 - modLfoToVolume */ 0, /* 14 - */ - 0, /* 15 - chorusEffectsSend */ - 0, /* 16 - reverbEffectsSend */ + AL_CHORUS_SEND_SOFT, /* 15 - chorusEffectsSend */ + AL_REVERB_SEND_SOFT, /* 16 - reverbEffectsSend */ AL_PAN_SOFT, /* 17 - pan */ 0, /* 18 - */ 0, /* 19 - */ @@ -897,6 +897,8 @@ static void fillZone(ALuint id, const GenModList *zone) break; if(param == AL_FILTER_RESONANCE_SOFT || param == AL_ATTENUATION_SOFT) value = maxi(0, value); + else if(param == AL_CHORUS_SEND_SOFT || param == AL_REVERB_SEND_SOFT) + value = clampi(value, 0, 1000); else if(param == AL_LOOP_MODE_SOFT) { if(!(value == 0 || value == 1 || value == 3)) diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 1fe6b7e7..ff00fdac 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -55,6 +55,8 @@ #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_CHORUS_SEND_SOFT 0x000F +#define AL_REVERB_SEND_SOFT 0x0010 #define AL_PAN_SOFT 0x0011 #define AL_MOD_ENV_DELAYTIME_SOFT 0x0019 #define AL_MOD_ENV_ATTACKTIME_SOFT 0x001A diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h index 47b159ba..b9adc4f2 100644 --- a/OpenAL32/Include/alMidi.h +++ b/OpenAL32/Include/alMidi.h @@ -32,6 +32,9 @@ typedef struct ALfontsound { ALint ModLfoToFilterCutoff; ALint ModEnvToFilterCutoff; + ALint ChorusSend; + ALint ReverbSend; + ALint Pan; struct { diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c index c5b04970..78722426 100644 --- a/OpenAL32/alFontsound.c +++ b/OpenAL32/alFontsound.c @@ -160,6 +160,18 @@ AL_API void AL_APIENTRY alFontsoundiSOFT(ALuint id, ALenum param, ALint value) sound->ModEnvToFilterCutoff = value; break; + case AL_CHORUS_SEND_SOFT: + if(!(value >= 0 && value <= 1000)) + SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); + sound->ChorusSend = value; + break; + + case AL_REVERB_SEND_SOFT: + if(!(value >= 0 && value <= 1000)) + SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); + sound->ReverbSend = value; + break; + case AL_PAN_SOFT: sound->Pan = value; break; @@ -358,6 +370,8 @@ AL_API void AL_APIENTRY alFontsoundivSOFT(ALuint id, ALenum param, const ALint * case AL_FILTER_RESONANCE_SOFT: case AL_MOD_LFO_TO_FILTER_CUTOFF_SOFT: case AL_MOD_ENV_TO_FILTER_CUTOFF_SOFT: + case AL_CHORUS_SEND_SOFT: + case AL_REVERB_SEND_SOFT: case AL_PAN_SOFT: case AL_MOD_ENV_DELAYTIME_SOFT: case AL_MOD_ENV_ATTACKTIME_SOFT: @@ -453,6 +467,14 @@ AL_API void AL_APIENTRY alGetFontsoundivSOFT(ALuint id, ALenum param, ALint *val values[0] = sound->ModEnvToFilterCutoff; break; + case AL_CHORUS_SEND_SOFT: + values[0] = sound->ChorusSend; + break; + + case AL_REVERB_SEND_SOFT: + values[0] = sound->ReverbSend; + break; + case AL_PAN_SOFT: values[0] = sound->Pan; break; |