Hi guys, i have a question, how make this sound action:
- Start audio effect part
- Middle audio effect part is looping (only in pressed button)
- Play end audio effect
I could easily do the first two actions, but how to make the third audio part play is correctly.
When I release the button, I need to break the loop and play the ending?
You can do it using Key_off functionality. Just place sustain point at the end of you loop ( it should be async and looped on item by the way, cut activated too) and your ending sound right after the sustain point. Your loop area should be short enough for cases when player will press and release button very quick.
Thank you, but it doesn’t work quite correctly, I need the sound to break off and go to the final part, and the method you showed makes an event when the region is finished playing.
That is, I need to break the loop at any time when I release the key and play final audio…
I’m afraid I don’t understand what you mean by “the method you showed makes an event when the region is finished playing.” As far as I can tell, FoxyMusic’s method does not create new events or event instances at any point. Do you mean it triggers an instrument when the playback position leaves the loop region? If so, how does that differ from what you wanted?
Also, have you looked at the “Music/Level 03” event in the “examples.fspro” project that comes with FMOD Studio? It contains transition regions and loop regions designed to cause the playback position to jump from one part of an audio file to another when a parameter value changes. I believe these features could be used to get the behavior you want.
@black_racer (and also @joseph) I made an example project on how you can make an event which plays a OneShot as LeadIn → Loops → Plays another OneShot on LeadOut:
- When Play() is called, it starts playing a LeadIn Sound + starts playing a loop
- When Stop() is called, it transitions and plays a LeadOut Sound.
Here’s a Dropbox-link to the project if you want to try it out (it’s got a README and all )
Here’s a video of it in action:
Here are some pics from the project:
Nested Event with Loop + Nested LeadIn Event:
Nested LeadIn Event:
Nested LeadOut (Tail) Event
Parameter Value Modulation (the magic that makes it work)
Here’s how it works:
The Main Event will play the tail/oneshot when the event is stopped, ie. avoid writing special code for that to happen, or playing the oneshot as a separate event.
HOW IT WORKS
The “TailOnStop”-parameter is modulated through an AHDSR-modulator on the parameter-value-knob (in the parameter view).
Assuming the parameter’s initial value is “0”, this AHDSR-modulator will make the parameter set itself to “1” while the event is playing (ie. it is on)
When the event is stopped, the modulation will jump down the value to “0”, which triggers the transition to the “Tail”.
FADE OUT MODULATIONS
The “loop”-sub event has an AHDSR-modulator to allow the loop to fade out (ie. crossfade with the Tail), if you so wish.
Additionally there’s an AHDSR-modulator on the Master-track of the main event, which makes the event play out the tail (make it audible) when it is stopped.
You just made it too comlecated. It works just the same way in one event. With all the same functionality. you can adjust fade time as you like, and even stop it as it made in your event with parameter on stop and transition region. But there’s defenetly no need for bunch of sub events. Just use async and loop functionality on your files directly.