Interval Attack Calibration
This is one of the per-clip setting field on FootstepBehaviour
.
The problem
There is this less-known problem in playing footsteps repeatedly as the character walks around : Each clip has different distance of attack point measured from the beginning of the clip. Sometimes slightly, sometimes a lot.
"Attack" refers to the first phase in ADSR Envelope, a term used often in music making software.
If the impact is sudden enough compared to the ramp-up (usually the case for footsteps), listener perceive the sound as "occuring" on the peak of attack, not at the beginning of the file. Only C# code knows the moment at the beginning of the file, not human.
AudioClip
playing code has no idea about this attack peak inside the file. If you picks from 3 AudioClip
randomly and repeatedly play them spaced out equally, if attack points of each audio clip are too different, to the listener it will sounds like interval is inconsistent.
It leads to annoying sounding footsteps that sound like the characters hurt their leg and can't walk in consistent cycle. Yet, it is not ideal if audio engineer has to trim the details at the beginning out just to have attack right at the beginning. Some footsteps like walking inside very tall grass or struggling inside thick snow/mud is characterized by these build-up leading up to the attack of the step.
This slight delay is usually not a problem in general one-shot SFX playing, but it can become a real problem in footsteps because footsteps are repeated in generally fixed interval. Player can quickly compare the new step with previous one and notice irregularity.
Confirming the problem in a clip
Unity's audio preview can play where you click the mouse instead of from the beginning, therefore try clicking where you think the peak is and listen if the impact is more instant than playing normally from the beginning of the clip or not. If it is, then you may need calibration. The 3 dots menu on the top right also has "Convert to Floating Window" to get it bigger.
Unfortunately it is difficult to obtain an exact time to enter into the box, because time display goes forward immediately when you click on that point, you cannot see clearly what is an exact time. And this preview window can't just position the play head without playing either. It is best to use external audio editing program to pinpoint an exact time.
The fix
This Interval Attack Calibration field available in each Clips member allows specifying a time from the beginning of the clip to that peak you want to counter-"calibrate". Unit is in seconds.
Whenever it is picked, Modular Footstep can automatically play this clip earlier in time in an attempt to move that peak back, so it sounds like the attack is immediately right at the moment of play. Remember that it is per-clip, so clip that doesn't need a calibration can stay the same.
Natrually, it is only effective in Interval Play where Modular Footstep knows the future and can plan out accordingly. One-Shot Play plays immediately when called, there is no "earlier in time" available to automatically shift back. To help you remember this, "Interval" is in the name of this field.
The move back is also capped by interval duration you specify on play. The more spaced out your character walks, the more calibration room Modular Footstep has. It will counter-adjust as much as it could.