0
0

Hello

How to implement smooth transition between reverberator presets?

For example i need reverberator setting which equals 30%/70% between GENERIC and STONECORIDOR presets.

Now i am using (i think naive and wrong) code:

[code:304b0oqa]
//
template<class T>
T morph(const T& from,const T& to,float ratio)
{
return T(from+float(to-from)*ratio);
}
//
void Morph(const FMOD_REVERB_PROPERTIES& from,const FMOD_REVERB_PROPERTIES& to,float ratio, FMOD_REVERB_PROPERTIES& result)
{
result.Instance = to.Instance;
result.Environment = to.Environment;//?????????
result.EnvSize = morph(from.EnvSize,to.EnvSize,ratio);
result.EnvDiffusion = morph(from.EnvDiffusion,to.EnvDiffusion,ratio);
result.Room = morph(from.Room,to.Room,ratio);
result.RoomHF = morph(from.RoomHF,to.RoomHF,ratio);
result.RoomLF = morph(from.RoomLF,to.RoomLF,ratio);
result.DecayTime = morph(from.DecayTime,to.DecayTime,ratio);
result.DecayHFRatio = morph(from.DecayHFRatio,to.DecayHFRatio,ratio);
result.DecayLFRatio = morph(from.DecayLFRatio,to.DecayLFRatio,ratio);
result.Reflections = morph(from.Reflections,to.Reflections,ratio);
result.ReflectionsDelay = morph(from.ReflectionsDelay,to.ReflectionsDelay,ratio);
result.ReflectionsPan[0] = morph(from.ReflectionsPan[0],to.ReflectionsPan[0],ratio);
result.ReflectionsPan[1] = morph(from.ReflectionsPan[1],to.ReflectionsPan[1],ratio);
result.ReflectionsPan[2] = morph(from.ReflectionsPan[2],to.ReflectionsPan[2],ratio);
result.Reverb = morph(from.Reverb,to.Reverb,ratio);
result.ReverbDelay = morph(from.ReverbDelay,to.ReverbDelay,ratio);
result.ReverbPan[0] = morph(from.ReverbPan[0],to.ReverbPan[0],ratio);
result.ReverbPan[1] = morph(from.ReverbPan[1],to.ReverbPan[1],ratio);
result.ReverbPan[2] = morph(from.ReverbPan[2],to.ReverbPan[2],ratio);
result.EchoTime = morph(from.EchoTime,to.EchoTime,ratio);
result.EchoDepth = morph(from.EchoDepth,to.EchoDepth,ratio);
result.ModulationTime = morph(from.ModulationTime,to.ModulationTime,ratio);
result.ModulationDepth = morph(from.ModulationDepth,to.ModulationDepth,ratio);
result.AirAbsorptionHF = morph(from.AirAbsorptionHF,to.AirAbsorptionHF,ratio);
result.HFReference = morph(from.HFReference,to.HFReference,ratio);
result.LFReference = morph(from.LFReference,to.LFReference,ratio);
result.RoomRolloffFactor = morph(from.RoomRolloffFactor,to.RoomRolloffFactor,ratio);
result.Diffusion = morph(from.Diffusion,to.Diffusion,ratio);
result.Density = morph(from.Density,to.Density,ratio);
result.Flags = to.Flags | from.Flags;//?????
}
[/code:304b0oqa]
Look like this is works.

Also i have other big problem.

If i am call FMOD_System_SetReverbProperties in every frame i have clicks in output.
To reproduce this you can put this code:

[code:304b0oqa]
{
// inserted code
// causes clicks
FMOD_REVERB_PROPERTIES revProp = FMOD_PRESET_UNDERWATER;
result = FMOD_System_SetReverbProperties(system, &revProp);
}
[/code:304b0oqa]
before
[code:304b0oqa]
// this is old code
FMOD_System_Update(system);
[/code:304b0oqa]
in mail.c file from 3d example project.

Thanks.

  • You must to post comments
0
0

Ok thanks.
I will wait.

As i understood build 4.00.34 without changes in this part.

Thanks

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.