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)
How would you do this in a better way? or maybe a simpler way?
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.
If your sound is on the timeline put a loop region around it
put a transition region on the same range
add a parameter
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).
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.
add a destination marker, set it to be the transition regions target.
place your tail sound at the new target marker.
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.