# how would you do a flamethrower loop?

**URL:** https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262
**Category:** FMOD Studio
**Created:** [January 21, 2016, 2:26pm UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262 "2016-01-21T14:26:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![orionye](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@orionye](https://qa.fmod.com/u/orionye)
#### Post date: [January 21, 2016, 2:26pm UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/1 "2016-01-21T14:26:38Z")

</div>

Hi there,

I’m brand new to Fmod , and i’m practicing, and i would like your opinion to improve the way i did my flamethrower, making it simpler or better

So basically I would like to create a flamethrower, with the sound looping while the player doesn’t release the mouse, and of course the sound would end when player release the button.

My way to do this is:  
-sound 1: I create a basic flamethrower sound (with a beginning and an end, the sound is perfect if the player just clic and doesn’t hold the button)  
-sound 2: a looping flame (i set it in a looping region)  
-a marker to say “at this point of my sound 1 , i would like to play the loop sound” (this works)  
-a parameter to end the loop, from 0 to 1 . 0 would be flamethrower on, and 1 flamethrower stop (it triggers the volume ; normal volume for 0 and no sound for 1)  
 ![my way to do this](https://imageshack.us/i/p7MI05dPp)

How would you do this in a better way? or maybe a simpler way?

thanks

---

<div class="post-metadata">

### Author: ![JesseLyon](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JesseLyon](https://qa.fmod.com/u/JesseLyon)
#### Post date: [January 21, 2016, 5:17pm UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/2 "2016-01-21T17:17:45Z")

</div>

This is the perfect example of the “play on stop” feature I was inquiring about here…

[http://www.fmod.org/questions/question/feature-request-play-on-stop/](http://www.fmod.org/questions/question/feature-request-play-on-stop/)

You would start the flamethrower loop when the user pressed the button (start event received from the game), and then stop the loop, and play the end sound when the button is released (stop event received from the game). Brett added a few other examples of how this could be done in the link above.

---

<div class="post-metadata">

### Author: ![whatisvalis1](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@whatisvalis1](https://qa.fmod.com/u/whatisvalis1)
#### Post date: [January 22, 2016, 1:55am UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/3 "2016-01-22T01:55:41Z")

</div>

> [@](#):
>
> This is the perfect example of the “play on stop” feature I was inquiring about here…
> 
> [Feature Request - Play on Stop - FMOD Studio - FMOD Forums](http://www.fmod.org/questions/question/feature-request-play-on-stop/)
> 
> You would start the flamethrower loop when the user pressed the button (start event received from the game), and then stop the loop, and play the end sound when the button is released (stop event received from the game). Brett added a few other examples of how this could be done in the link above.

Try creating a Logic condition for your loop region.

Add a parameter  
click on your loop region and in the deck click the + to set a condition

When the player releases the trigger send the desired parameter to not loop and play tail

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [January 22, 2016, 3:02am UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/4 "2016-01-22T03:02:37Z")

</div>

Here’s a new method I just came up with that only requires a stop call.

 ![enter image description here](http://i.imgur.com/heuWvFG.png)

1. If your sound is on the timeline put a loop region around it
2. put a transition region on the same range
3. add a parameter
4. modulate the parameter with an AHDSR. ADHDSR has a special feature that when you call stop, the release phase plays out even after you call stop (as long as its not stop immediate).
5. Add a parameter condition to your transition region, so that the condition triggers as soon as the release part of the AHDSR starts releasing. So if you have the condition 0-.99 and your AHDSR is set to 100% for everything except the release part, it should trigger the condition as soon as the release starts.
6. add a destination marker, set it to be the transition regions target.
7. place your tail sound at the new target marker.
8. make sure the release in the AHDSR is long enough to handle the length of the tail sound.

To test it, you hold down the stop button, dont just click it. The stop button will start flashing and execute the release stage in the envelope, it flashes for as long as the release stage is active.

---

<div class="post-metadata">

### Author: ![JesseLyon](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JesseLyon](https://qa.fmod.com/u/JesseLyon)
#### Post date: [January 22, 2016, 5:14pm UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/5 "2016-01-22T17:14:37Z")

</div>

> [@](#):
>
> Here’s a new method I just came up with that only requires a stop call.
> 
> ![enter image description here](http://i.imgur.com/heuWvFG.png)
> 
> 1. If your sound is on the timeline put a loop region around it
> 2. put a transition region on the same range
> 3. add a parameter
> 4. modulate the parameter with an AHDSR. ADHDSR has a special feature that when you call stop, the release phase plays out even after you call stop (as long as its not stop immediate).
> 5. Add a parameter condition to your transition region, so that the condition triggers as soon as the release part of the AHDSR starts releasing. So if you have the condition 0-.99 and your AHDSR is set to 100% for everything except the release part, it should trigger the condition as soon as the release starts.
> 6. add a destination marker, set it to be the transition regions target.
> 7. place your tail sound at the new target marker.
> 8. make sure the release in the AHDSR is long enough to handle the length of the tail sound.
> 
> To test it, you hold down the stop button, dont just click it. The stop button will start flashing and execute the release stage in the envelope, it flashes for as long as the release stage is active.

Love it! This is exactly what Im looking for, thanks Brett. Havent traversed into the transition marker features of FMOD too much yet, looking forward to it, seems very powerful for a lot more then just music.

---

<div class="post-metadata">

### Author: ![whatisvalis1](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@whatisvalis1](https://qa.fmod.com/u/whatisvalis1)
#### Post date: [January 22, 2016, 7:18pm UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/6 "2016-01-22T19:18:07Z")

</div>

Thanks Brett, cool solution

---

<div class="post-metadata">

### Author: ![orionye](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@orionye](https://qa.fmod.com/u/orionye)
#### Post date: [January 23, 2016, 2:10pm UTC](https://qa.fmod.com/t/how-would-you-do-a-flamethrower-loop/12262/7 "2016-01-23T14:10:14Z")

</div>

thanks guys! will try those!
