# Inconsistent fade envelopes

**URL:** <https://qa.fmod.com/t/inconsistent-fade-envelopes/17670>\
**Category:** FMOD Studio\
**Created:** [September 13, 2021, 9:09am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670 "2021-09-13T09:09:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shredd](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Shredd](https://qa.fmod.com/u/Shredd)\
**Post date:** [September 13, 2021, 9:09am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/1 "2021-09-13T09:09:24Z")

</div>

Why do fade envelopes like these produce inconsistent playback each time I click Play in the Studio app? Is there anything that can be done to fix this? I’m using FMOD 2.02.02, Windows 10.

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/d2dc0eec5c43057850d15f540ebbb1d76cc29878.png)

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [September 14, 2021, 6:43am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/2 "2021-09-14T06:43:57Z")

</div>

When I test here, playback of synchronous single instruments with fade-in curves appears to be consistent from one playback to the next.

Is there any more information you can give us about this issue? For example, exactly how does the instrument’s behavior change from one playback to the next? Are any of the instrument’s properties subject to modulation or automation? What is the instrument’s start offset property set to?

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [September 14, 2021, 11:53am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/3 "2021-09-14T11:53:20Z")

</div>

I also always noticed some inconsistencies on the transients at the very beginning after a transition. I first thought if was related to transitions, but as Shredd spotted, it’s probably rather related to the fades I include in the transition timeline.  
I just investigated further and it’s quite easy to spot. Here it is: a really short sound, a really short fade in the transition timeline. The sound is never the same, or even don’t play at all.  
I should have displayed time rather than beats. For info, the fade is 30 ms duration and the sound 14 ms.

[![](https://img.youtube.com/vi/6npPwU_wwfU/maxresdefault.jpg "FMOD inconsistent fades-in") ](https://www.youtube.com/watch?v=6npPwU_wwfU)

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [September 14, 2021, 12:35pm UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/4 "2021-09-14T12:35:11Z")

</div>

Or even with a fade directly on the instrument, that’s obvious too:

[![](https://img.youtube.com/vi/nV53oQmnQak/hqdefault.jpg "FMOD fade inconsistencies 2") ](https://www.youtube.com/watch?v=nV53oQmnQak)

---

<div class="post-metadata">

**Author:** ![Shredd](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Shredd](https://qa.fmod.com/u/Shredd)\
**Post date:** [September 14, 2021, 1:13pm UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/5 "2021-09-14T13:13:25Z")

</div>

I think @Alcibiade already nailed it with their videos, thanks! Here’s mine with a kick drum:

[![](https://img.youtube.com/vi/yB2nzLcmQVk/maxresdefault.jpg "FMOD Fade in-curve inconsistency") ](https://www.youtube.com/watch?v=yB2nzLcmQVk)

So essentially, I think the fade-in length keeps changing randomly. And sometimes it sounds like the very first milliseconds of the transient are let through, too, as if the fade-in curve wasn’t there. Just to be clear, this happens the same way whether I click Play manually every time, or loop it.

I was not using modulation or start offset in this example, nor my earlier screenshot. Just dragged and dropped the sample in and disabled the spatializer.

This is most easily heard when using very short sounds, but it happens regularly with any length of audio clip.

What audio hardware are you using @joseph? I shot the video while I was using just WASAPI drivers, but I tested with my audio interface’s ASIO drivers (SSL+2), and it was the same.

---

<div class="post-metadata">

**Author:** ![Skaven252](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/skaven252/32/63_2.png) [@Skaven252](https://qa.fmod.com/u/Skaven252)\
**Post date:** [September 15, 2021, 10:28am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/6 "2021-09-15T10:28:16Z")

</div>

All fades and automation in FMOD are basically quantized to the frame rate. If the fades are very short it’s mostly a matter where the steps occur. You can hear the steppiness very clearly if you try fading a pure sine wave tone in and out.

If you increase FMOD’s internal frame rate from the API you get smoother fades and automation but it increases the performance cost.

AFAIK sample-accurate fades and automation are in the FMOD development backlog but these would come at a performance cost as well.

---

<div class="post-metadata">

**Author:** ![Shredd](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Shredd](https://qa.fmod.com/u/Shredd)\
**Post date:** [September 15, 2021, 10:31pm UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/7 "2021-09-15T22:31:52Z")

</div>

Interesting. But frame rate of what, exactly? The FMOD Studio app itself?

---

<div class="post-metadata">

**Author:** ![Skaven252](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/skaven252/32/63_2.png) [@Skaven252](https://qa.fmod.com/u/Skaven252)\
**Post date:** [September 16, 2021, 4:28am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/8 "2021-09-16T04:28:58Z")

</div>

The FMOD developers will need to answer that one. Update length steps, mixing blocks, not sure what the exact rate is.

Older thread:

> [@AHDSR attack and release bug?](https://qa.fmod.com/t/ahdsr-attack-and-release-bug/15981):
>
> Hi all! Been having some issues with short attack and release times using AHDSR modulation. This is my setup: Multi-instruments played within a labelled parameter in FMOD 2.00.05. Each MI has AHDSR modulation on its volume to smooth out transitions between other MIs. The problem/bug is that having very short attack and release times is introducing random clicks. The attack doesn’t seem to be smooth when looking at the a capture of me playing with this in editor: I…

---

<div class="post-metadata">

**Author:** ![Shredd](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Shredd](https://qa.fmod.com/u/Shredd)\
**Post date:** [September 20, 2021, 9:34am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/9 "2021-09-20T09:34:41Z")

</div>

Can you describe how you get the playback to be consistent on your end? And what frame rate is FMOD automation quantized to?

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [October 1, 2021, 4:08am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/10 "2021-10-01T04:08:53Z")

</div>

> [@Shredd](#):
>
> But frame rate of what, exactly? The FMOD Studio app itself?

A frame is the period of time between successive updates of the FMOD Studio system. In synchronous mode, the FMOD Studio system updates when `FMOD:Studio::update` is called; whereas in asynchronous mode, it updates whenever the asynchronous update thread triggers (which by default is every 20 ms, but can be adjusted).

---

<div class="post-metadata">

**Author:** ![g.hadji](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@g.hadji](https://qa.fmod.com/u/g.hadji)\
**Post date:** [October 5, 2021, 10:17am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/11 "2021-10-05T10:17:55Z")

</div>

Kinda similar issue here. I’m trying to loop a multi instrument using a destination marker and a transition marker. The audio pop as the transition cursor hit the destination fade-in, as if it let the transient pass through. Here’s an example:

[https://youtu.be/qFAtmXJeCX8](https://youtu.be/qFAtmXJeCX8)

Could it be related to this framerate issue and is it possible to eliminate this poping effect without affecting the performances too much ?

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [October 5, 2021, 12:06pm UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/12 "2021-10-05T12:06:11Z")

</div>

This pop is weird, I’m not able to reproduce it…

By the way, do you know you can do your loop with a loop region? Loop regions now have transition region as well.

---

<div class="post-metadata">

**Author:** ![g.hadji](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@g.hadji](https://qa.fmod.com/u/g.hadji)\
**Post date:** [October 5, 2021, 1:11pm UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/13 "2021-10-05T13:11:06Z")

</div>

I didn’t know that, thanks for the tip ! Unfortunately it didn’t solve the pops problem.

Good news is that since I want each audio file to transition smoothly with the next random one, I didn’t rely on any strong transient to make the event sound the way I want. So, I just had to add a tiny fade-in on each audio assets in my DAW(I use to always cut my files on a silent sample point when I export audio files) to cut any transient.

It works, but it doesn’t solve the weird fmod fade-in behaviour tho.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 12, 2021, 12:32am UTC](https://qa.fmod.com/t/inconsistent-fade-envelopes/17670/14 "2021-10-12T00:32:04Z")

</div>

The strange behaviour you are seeing is the same by-product of how quickly the FMOD system updates. Essentially what is happening is the instrument is triggering and playing faster than it realises it has a fade. This is apparent on very short audio files. This can be mitigated at runtime by using a quicker call to `System::update()` but will have more of a performance hit.

Edit: I’ve been informed by our development team that this isn’t entirely accurate. This is more of an internal issue. If your fade curve is short it might be skipped completely, ramping from 0 to full volume only over 64 samples. We are looking into fixing this behaviour, which will likely come at an increase of CPU usage, for a future release.
