diff options
author | Chris Robinson <[email protected]> | 2013-12-29 02:25:40 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-29 02:25:40 -0800 |
commit | d9aedc14167c7f5c4fc02f95de6be89ef8db63c2 (patch) | |
tree | c484a1e0cb9928df7873b03221f2f3bf4b6a1cfa | |
parent | fc928bb75a8b677e101785e50b8c4cf0d39a62aa (diff) |
Add a few more pitch properties
-rw-r--r-- | Alc/midi/base.c | 4 | ||||
-rw-r--r-- | Alc/midi/fluidsynth.c | 3 | ||||
-rw-r--r-- | Alc/midi/sf2load.c | 6 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 3 | ||||
-rw-r--r-- | OpenAL32/Include/alMidi.h | 4 | ||||
-rw-r--r-- | OpenAL32/alFontsound.c | 27 |
6 files changed, 44 insertions, 3 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c index 11c43d25..00114f59 100644 --- a/Alc/midi/base.c +++ b/Alc/midi/base.c @@ -295,6 +295,10 @@ void ALfontsound_Construct(ALfontsound *self) self->MinVelocity = 0; self->MaxVelocity = 127; + self->ModLfoToPitch = 0; + self->VibratoLfoToPitch = 0; + self->ModEnvToPitch = 0; + self->VolEnv.DelayTime = -12000; self->VolEnv.AttackTime = -12000; self->VolEnv.HoldTime = -12000; diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c index d5174887..7855132a 100644 --- a/Alc/midi/fluidsynth.c +++ b/Alc/midi/fluidsynth.c @@ -163,6 +163,9 @@ static int FPreset_noteOn(fluid_preset_t *preset, fluid_synth_t *synth, int chan if(voice == NULL) return FLUID_FAILED; + 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, 33, sound->VolEnv.DelayTime); fluid_voice_gen_set(voice, 34, sound->VolEnv.AttackTime); fluid_voice_gen_set(voice, 35, sound->VolEnv.HoldTime); diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c index e5fcee43..be2cb1df 100644 --- a/Alc/midi/sf2load.c +++ b/Alc/midi/sf2load.c @@ -799,9 +799,9 @@ static void fillZone(ALuint id, const GenModList *zone) 0, /* 2 - startloopAddrOffset */ 0, /* 3 - endloopAddrOffset */ 0, /* 4 - startAddrCoarseOffset */ - 0, /* 5 - modLfoToPitch */ - 0, /* 6 - vibLfoToPitch */ - 0, /* 7 - modEnvToPitch */ + 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 */ diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 2f9440b9..4c980b96 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -48,6 +48,9 @@ #define AL_KEY_CORRECTION_SOFT 0x2006 #define AL_SAMPLE_TYPE_SOFT 0x2007 #define AL_FONTSOUND_LINK_SOFT 0x2008 +#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_VOLUME_ENV_DELAYTIME_SOFT 0x0021 #define AL_VOLUME_ENV_ATTACKTIME_SOFT 0x0022 #define AL_VOLUME_ENV_HOLDTIME_SOFT 0x0023 diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h index cdaebc28..8daeaf53 100644 --- a/OpenAL32/Include/alMidi.h +++ b/OpenAL32/Include/alMidi.h @@ -23,6 +23,10 @@ typedef struct ALfontsound { ALint MinKey, MaxKey; ALint MinVelocity, MaxVelocity; + ALint ModLfoToPitch; + ALint VibratoLfoToPitch; + ALint ModEnvToPitch; + struct { ALint DelayTime; ALint AttackTime; diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c index e4da6503..e6abf677 100644 --- a/OpenAL32/alFontsound.c +++ b/OpenAL32/alFontsound.c @@ -130,6 +130,18 @@ AL_API void AL_APIENTRY alFontsoundiSOFT(ALuint id, ALenum param, ALint value) SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done); switch(param) { + case AL_MOD_LFO_TO_PITCH_SOFT: + sound->ModLfoToPitch = value; + break; + + case AL_VIBRATO_LFO_TO_PITCH_SOFT: + sound->VibratoLfoToPitch = value; + break; + + case AL_MOD_ENV_TO_PITCH_SOFT: + sound->ModEnvToPitch = value; + break; + case AL_VOLUME_ENV_DELAYTIME_SOFT: sound->VolEnv.DelayTime = value; break; @@ -282,6 +294,9 @@ AL_API void AL_APIENTRY alFontsoundivSOFT(ALuint id, ALenum param, const ALint * alFontsound2iSOFT(id, param, values[0], values[1]); return; + case AL_MOD_LFO_TO_PITCH_SOFT: + case AL_VIBRATO_LFO_TO_PITCH_SOFT: + case AL_MOD_ENV_TO_PITCH_SOFT: case AL_VOLUME_ENV_DELAYTIME_SOFT: case AL_VOLUME_ENV_ATTACKTIME_SOFT: case AL_VOLUME_ENV_HOLDTIME_SOFT: @@ -336,6 +351,18 @@ AL_API void AL_APIENTRY alGetFontsoundivSOFT(ALuint id, ALenum param, ALint *val SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done); switch(param) { + case AL_MOD_LFO_TO_PITCH_SOFT: + values[0] = sound->ModLfoToPitch; + break; + + case AL_VIBRATO_LFO_TO_PITCH_SOFT: + values[0] = sound->VibratoLfoToPitch; + break; + + case AL_MOD_ENV_TO_PITCH_SOFT: + values[0] = sound->ModEnvToPitch; + break; + case AL_VOLUME_ENV_DELAYTIME_SOFT: values[0] = sound->VolEnv.DelayTime; break; |