# Event play cuts off sharply despite async

**URL:** <https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046>\
**Category:** FMOD Studio\
**Tags:** unity, csharp\
**Created:** [January 1, 2024, 11:25am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046 "2024-01-01T11:25:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [January 1, 2024, 11:25am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/1 "2024-01-01T11:25:09Z")

</div>

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

This is the setup. All the events have similar properties to the selected one. What I’m trying to do is loop between the various songs with the fade-in and fade-out from the AHDSR curves, and if I just let this play in Unity it works fine.

tracks.setTimelinePosition(milliseconds);

In Unity I use this code to change the timeline cursor’s position to the Song 1, Song 2, Song 3, etc, markers, to force a song change outside the already present logic.

When I do this, the release of the AHDSR does NOT play, and instead of a nice fade-out I get a jarring cut. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 3, 2024, 10:25pm UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/2 "2024-01-03T22:25:55Z")

</div>

Hi,

Thank you for the screenshot and the information.

Rather than using `tracks.setTimelinePosition(milliseconds);` could you try using a [Transition Region](https://fmod.com/docs/2.02/studio/glossary.html#transition-region). This should allow FMOD to transition the audio while also using the automation on the events.

If that does not solve the issue, would it be possible to get a copy of your FMOD project with the following settings:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/89198f6a2a4e71268e35112c926f6f9d8255ae68.png)  
[Uploaded](https://fmod.com/profile#uploads) to your [profile](https://fmod.com/profile)? Please note you will have to register a project with us before you can upload files.

---

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [January 5, 2024, 4:14am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/3 "2024-01-05T04:14:05Z")

</div>

Thank you for the reply.

I’ll follow your suggestions and let you know.

Since all songs should be able to transition to all other songs, that’s in this case 3 transition regions per song. Is there a less clunky way of doing it?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 7, 2024, 10:03pm UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/4 "2024-01-07T22:03:01Z")

</div>

Hi,

Unfortunately, each transition region can only move to one marker so you will have to have a region per destination.

---

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [January 14, 2024, 3:59am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/5 "2024-01-14T03:59:04Z")

</div>

I’ve removed the system I had and replaced it with this:

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

All the transition regions have a similar setup (track number value 1 leads to song 1, 3 to song 3, etc), and they all move - but neither allow the release of the aforementioned AHDSR curve to play. The fadeout doesn’t happen.

I’ve been recommended to attempt magnet regions, see if they can do the job and I’ll go for that and post that result.

You asked me for a copy of my project with the settings - I’ll post that later today.

---

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [January 15, 2024, 12:55pm UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/6 "2024-01-15T12:55:17Z")

</div>

Excuse the delay. I’ve registered the project and am pending approval. Once that’s done, I’ll upload the requested file.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 16, 2024, 2:09am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/7 "2024-01-16T02:09:09Z")

</div>

Hi,

You should have approval to upload the project now.

---

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [January 18, 2024, 7:39am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/8 "2024-01-18T07:39:35Z")

</div>

File uploaded.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 21, 2024, 10:00pm UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/10 "2024-01-21T22:00:27Z")

</div>

Hi,

Thank you for the project.

When in FMOD Studio I was able to hear the fade out between songs. Do you also hear it in Studio and not in Unity? Or do you not hear it at all?

What version of Studio are you using? I noticed there was a [Transition Region](https://fmod.com/docs/2.02/studio/glossary.html#transition-region) only on the transition to `song 4`:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/7bf88e064f61f683c760b9a77397ce5fd60b0e58.png)  
This may cause unexpected behavior when transitioning to `song 4`.

---

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [February 1, 2024, 2:40am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/11 "2024-02-01T02:40:09Z")

</div>

Hello,

Thanks for taking a look at the project and excuse the delay, I’m working on this as much as my time allows.

I should’ve been more clear: Inside FMOD it all works as intended, even when using only the variable to manipulate the playing. I can hear the fadeouts properly. It’s when I try the same thing in Unity it doesn’t work. This was true from the start.

> What version of Studio are you using?

I’m taking this as an encouragement to update my FMOD. I’ll do that and get back to you.

> I noticed there was a [Transition Region] only on the transition to `song 4` :

Do you mean that you don’t see the transition regions to `song 1`, `song 2` and `song 3`? Because they’re there and I see them (they are transition regions, right?).

> This may cause unexpected behavior when transitioning to `song 4` .

Transitioning to `song 4` is something I haven’t tested and will test later on - not yet.

---

<div class="post-metadata">

**Author:** ![Iopas](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@Iopas](https://qa.fmod.com/u/Iopas)\
**Post date:** [February 1, 2024, 2:49am UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/12 "2024-02-01T02:49:23Z")

</div>

> I’m taking this as an encouragement to update my FMOD. I’ll do that and get back to you.

Scratch that. My FMOD version is 2.02.04 which appears to be nearly the newest if not the newest.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [February 4, 2024, 10:27pm UTC](https://qa.fmod.com/t/event-play-cuts-off-sharply-despite-async/21046/13 "2024-02-04T22:27:54Z")

</div>

Hi

The latest Unity Verified version is 2.02.19  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/48a936334db93c149c50f140727ad206e2034e21.png)

> [@Iopas](#):
>
> Do you mean that you don’t see the transition regions

Apologies, I meant [Transition Timelines](https://fmod.com/docs/2.02/studio/glossary.html#transition-timeline). If there is a transition timeline it is indicated by the circle on the transition region.

Using the following code:

```auto
public FMODUnity.StudioEventEmitter emitter;

// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown(KeyCode.Alpha1))
    {
        emitter.EventInstance.setParameterByName("Track number", 0);
    }
	if (Input.GetKeyDown(KeyCode.Alpha2))
	{
		emitter.EventInstance.setParameterByName("Track number", 1);
	}
	if (Input.GetKeyDown(KeyCode.Alpha3))
	{
		emitter.EventInstance.setParameterByName("Track number", 2);
	}
	if (Input.GetKeyDown(KeyCode.Alpha4))
	{
		emitter.EventInstance.setParameterByName("Track number", 3);
	}
}

```

I will DM you a profiler recording of changing the tracks, please let me know if this is the expected behaviour.
