# Delay not working for command instruments?

**URL:** https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624
**Category:** FMOD Studio
**Created:** [September 6, 2023, 9:00am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624 "2023-09-06T09:00:44Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![deHaan](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/dehaan/32/68_2.png) [@deHaan](https://qa.fmod.com/u/deHaan)
#### Post date: [September 6, 2023, 9:00am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/1 "2023-09-06T09:00:44Z")

</div>

I am trying to use delays for command instruments, but it seems like it does not work. If I e.g. use a command instrument to set a parameter to 1 and that parameter trigs an instrument, I hear the intsrument play as soon as the playhead hits the command instrument, even though I put a 2 second delay interval on it.

Is this a bug?

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [September 6, 2023, 11:43pm UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/2 "2023-09-06T23:43:49Z")

</div>

Hi,

~~Unfortunately, I haven’t been able to reproduce the issue on the latest release (2.02.17), or 2.02.03, which you said you’ve used in a previous post.~~

On further testing, I’ve been able to reproduce an issue similar to what you’re describing, but only when playing a command instrument on one parameter sheet and moving the cursor/parameter value off the command instrument.

Could you please provide your FMOD Studio version, as well as some more details on where you’re observing this issue (parameter sheets, timeline, etc.) and a simple list of steps that consistently reproduces the issue for you?

---

<div class="post-metadata">

### Author: ![deHaan](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/dehaan/32/68_2.png) [@deHaan](https://qa.fmod.com/u/deHaan)
#### Post date: [September 7, 2023, 11:01am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/3 "2023-09-07T11:01:38Z")

</div>

Hi Leah.

I found out when it is happening:

- You have a looping event with a command instrument set to “Set Parameter” filling up the entire loop
- The command instrument should have a trigger condition so it only plays when another parameter is set to e.g. 1

In this case the delay does not work. Did that make sense?

I am on 2.02.12 btw

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [September 7, 2023, 11:58pm UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/4 "2023-09-07T23:58:04Z")

</div>

Thanks for the additional information, that does makes sense. To clarify, are you observing that the delay is ignored at all/any points in timeline region the command instrument occupies? Or is it only when the end of the loop is reached, and as a result the command instrument untriggers and then retriggers?

---

<div class="post-metadata">

### Author: ![deHaan](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/dehaan/32/68_2.png) [@deHaan](https://qa.fmod.com/u/deHaan)
#### Post date: [September 8, 2023, 7:49am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/5 "2023-09-08T07:49:30Z")

</div>

The delay is ignored any time in the timeline when the command istrument is trigged by setting a parameter

---

<div class="post-metadata">

### Author: ![wurliz1](https://avatars.discourse-cdn.com/v4/letter/w/e47774/32.png) [@wurliz1](https://qa.fmod.com/u/wurliz1)
#### Post date: [November 13, 2023, 3:23am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/6 "2023-11-13T03:23:46Z")

</div>

Hi, have there been any solutions to this issue? I think it is the only way to complete my project.

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [November 13, 2023, 4:58am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/7 "2023-11-13T04:58:09Z")

</div>

Unfortunately, while the issue has been noted, I can’t offer any exact time frame that a fix will become available. In the meantime, so that I can potentially help you to work around it, can I get you to elaborate on the context of the exact issue that you’re running into?

---

<div class="post-metadata">

### Author: ![wurliz1](https://avatars.discourse-cdn.com/v4/letter/w/e47774/32.png) [@wurliz1](https://qa.fmod.com/u/wurliz1)
#### Post date: [November 13, 2023, 5:04am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/8 "2023-11-13T05:04:27Z")

</div>

Yep sure. I’ve got a relatively simple unity game that plays looped music depending on which box the player has collided with most recently. In FMOD, the entire thing is on a parameter sheet, where a global variable is responsible for which music segment currently plays. I need to quantise these changes, so that the music seamlessly transitions from segment to segment. I have tried quantising with nested events and command instruments, however the quantisation doesnt work and the audio files immediately transition. When using just the quantisation of the single/multiple instrument tracks, the audio cut out as soon as the parameter changed. Are there any other ways to do this?

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [November 14, 2023, 12:45am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/9 "2023-11-14T00:45:46Z")

</div>

The simplest way to handle this would be to set up the quantized transitions in a single timeline, i.e. something like the following:

 ![quantizedtransitions](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/e/edf84b460d2ec172d72e218366b9bd095d9d30a6.png)

In this example, I have 3 separate audio files that are set up with corresponding magnet and loop regions. The magnet regions will transition the timeline cursor to them when the parameter GlobalParam equals the corresponding value (i.e. 1 = “Track 1”). The magnet region transitions are also quantized to a bar, and each one has a one bar transition region to crossfade the transition.

If you instead wanted to stick with nested/referenced events, you could set up a parent event as follows:

 ![parentevent](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/c412feed7bcb661912c816bb01a2409a85e5b2fa.png)

Each of event instruments is quantized to a bar, and I’ve added a timeline to the parent event with a temp marker to ensure the parent event is quantizing to the correct tempo.

Then, I’ve set the nested events to use a one bar transition region to fade in/out when the they start and end, though you could opt to use an AHDSR on the master track volume for this instead. The transition region is quantized to a bar, and transitions when the global parameter no longer corresponds to that nested event.

 ![nestedevent](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/c/caf6d6365ba343c5d9963d9d4070e548b74db63e.png)

If neither of these examples fits your use-case, what issues are you running into that they don’t address?

---

<div class="post-metadata">

### Author: ![wurliz1](https://avatars.discourse-cdn.com/v4/letter/w/e47774/32.png) [@wurliz1](https://qa.fmod.com/u/wurliz1)
#### Post date: [November 14, 2023, 12:49am UTC](https://qa.fmod.com/t/delay-not-working-for-command-instruments/20624/10 "2023-11-14T00:49:49Z")

</div>

Thank you, I will try out the first method.
