How can I play a random song and fade in and out from a battle song when needed?

I want to essentially shuffle through random ambient songs (once a song is finished then play a different one at random). Then when the player gets into combat I want to fade into a battle song. Then when they are finished the battle fade back into the ambient songs.

Is the best way to achieve this with a timeline sheet? I’m not sure how to play a song at random on the timeline.

Thank you!

Hi, there is a number a ways to achieve this. I would imagine something like this:
Ambient songs are put in the playlist of a multi-instrument (in shuffle mode), the battle music will have its own event. The main parent event would have a parameter sheet (triggering ambiant/battle), in which you put the ambient multi and the battle event. Transitions between both would be set with AHDSR on both elements. If you want a more specific transition between ambient and battle, you can also put both elements in a timeline instead, with magnet regions and transition timelines.

1 Like

Is the battle song a variant of the song that’s already playing? Or is it a separate, independent song?

1 Like

A separate song.

Thanks for your response! I am trying your first suggested method. I have made an action that shuffles all the ambient songs and another action for the battle song. And then put those actions into a parameter sheet of a new parent action.

I can start either action within the parent action without issue. But when I change the parameter to play the other action, the original action doesn’t stop playing. Should I just manually stop it before changing the parameter or is there a more elegant solution?

Only check the “cut” button on each multi! (and set AHDSR on the multi’s volume knob)

Just to be clear, “action events” don’t really exist, “2D Action” is only a preset (creating an event with an action sheet inside). If you only use a parameter sheet, you can remove the action and/or timeline sheet.
And by the way, insead of nested action sheets, you can save a level of nesting and simply create your multi-instruments directly in the parent event’s parameter sheet.

1 Like

There’s a few different ways you could do this, but the easiest option is just to put an AHDSR modulator on the volume of each multi instrument. This will ensure that the instrument fades out to silence when untriggered.