aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/midi
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/midi')
-rw-r--r--Alc/midi/base.c9
-rw-r--r--Alc/midi/fluidsynth.c8
-rw-r--r--Alc/midi/sf2load.c16
3 files changed, 25 insertions, 8 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c
index 470157e1..11c43d25 100644
--- a/Alc/midi/base.c
+++ b/Alc/midi/base.c
@@ -295,6 +295,15 @@ void ALfontsound_Construct(ALfontsound *self)
self->MinVelocity = 0;
self->MaxVelocity = 127;
+ self->VolEnv.DelayTime = -12000;
+ self->VolEnv.AttackTime = -12000;
+ self->VolEnv.HoldTime = -12000;
+ self->VolEnv.DecayTime = -12000;
+ self->VolEnv.SustainVol = 0;
+ self->VolEnv.ReleaseTime = -12000;
+ self->VolEnv.KeyToHoldTime = 0;
+ self->VolEnv.KeyToDecayTime = 0;
+
self->Start = 0;
self->End = 0;
self->LoopStart = 0;
diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c
index 5b57de21..d5174887 100644
--- a/Alc/midi/fluidsynth.c
+++ b/Alc/midi/fluidsynth.c
@@ -163,6 +163,14 @@ 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, 33, sound->VolEnv.DelayTime);
+ fluid_voice_gen_set(voice, 34, sound->VolEnv.AttackTime);
+ fluid_voice_gen_set(voice, 35, sound->VolEnv.HoldTime);
+ fluid_voice_gen_set(voice, 36, sound->VolEnv.DecayTime);
+ fluid_voice_gen_set(voice, 37, sound->VolEnv.SustainVol);
+ fluid_voice_gen_set(voice, 38, sound->VolEnv.ReleaseTime);
+ fluid_voice_gen_set(voice, 39, sound->VolEnv.KeyToHoldTime);
+ fluid_voice_gen_set(voice, 40, sound->VolEnv.KeyToDecayTime);
fluid_voice_gen_set(voice, 54, sound->LoopMode);
for(m = 0;m < sample->NumMods;m++)
fluid_voice_add_mod(voice, &sample->Mods[m], FLUID_VOICE_OVERWRITE);
diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c
index e8b4fb1b..e5fcee43 100644
--- a/Alc/midi/sf2load.c
+++ b/Alc/midi/sf2load.c
@@ -827,14 +827,14 @@ static void fillZone(ALuint id, const GenModList *zone)
0, /* 30 - releaseModEnv */
0, /* 31 - keynumToModEnvHold */
0, /* 32 - keynumToModEnvDecay */
- 0, /* 33 - delayVolEnv */
- 0, /* 34 - attackVolEnv */
- 0, /* 35 - holdVolEnv */
- 0, /* 36 - decayVolEnv */
- 0, /* 37 - sustainVolEnv */
- 0, /* 38 - releaseVolEnv */
- 0, /* 39 - keynumToVolEnvHold */
- 0, /* 40 - keynumToVolEnvDecay */
+ AL_VOLUME_ENV_DELAYTIME_SOFT, /* 33 - delayVolEnv */
+ AL_VOLUME_ENV_ATTACKTIME_SOFT, /* 34 - attackVolEnv */
+ AL_VOLUME_ENV_HOLDTIME_SOFT, /* 35 - holdVolEnv */
+ AL_VOLUME_ENV_DECAYTIME_SOFT, /* 36 - decayVolEnv */
+ AL_VOLUME_ENV_SUSTAINVOLUME_SOFT, /* 37 - sustainVolEnv */
+ AL_VOLUME_ENV_RELEASETIME_SOFT, /* 38 - releaseVolEnv */
+ AL_VOLUME_ENV_KEY_TO_HOLDTIME_SOFT, /* 39 - keynumToVolEnvHold */
+ AL_VOLUME_ENV_KEY_TO_DECAYTIME_SOFT, /* 40 - keynumToVolEnvDecay */
0, /* 41 - */
0, /* 42 - */
AL_KEY_RANGE_SOFT, /* 43 - keyRange */