Page 1 of 1
Advanced music control with MasterAudio
Posted: Thu Dec 06, 2018 4:54 pm
by LewisFTG
Hi all,
I'm trying to do some clever stuff with music playlists fading in and out at specific points in the dialogue, but haven't been successful in getting it to work yet. I want Track A to start, then have it fade out as Track B starts. Finally, I want to fade out Track B.
This is what I thought would work, but it doesn't stop or fade out Track B. Any idea why?
Node 1 Sequence:
MAChangePlaylist(Track A)
Node 2 Sequence:
MAFadePlaylist(Track A, 0, 5);
MAChangePlaylist(Track B)
Node 3 Sequence:
MAFadePlaylist(Track B, 0, 5);
Re: Advanced music control with MasterAudio
Posted: Thu Dec 06, 2018 7:31 pm
by nathanj
I think the values of your Fade command are out of order.
The doc says:
Code: Select all
MAFadePlaylist(targetVolume, fadeTime, [playlistControllerName])
So you could try:
But, now I'm not sure if that will work. The issue with the distinction between playlistName and playlistControllerName.
I think to achieve this you will need to make two playlists and use the MAFadePlaylist. There doesn't seem to be a way to route the individual audio files within a playlist to different mixer channels.
Re: Advanced music control with MasterAudio
Posted: Thu Dec 06, 2018 7:49 pm
by Tony Li
I'd wager that's the issue.
Try this:
Node 1 Sequence:
MAChangePlaylist(Track A, controller1)
Node 2 Sequence:
MAFadePlaylist(0, 5, controller1);
MAChangePlaylist(Track B, controller2);
MAFadePlaylist(1, 5, controller2);
Node 3 Sequence:
MAFadePlaylist(0, 5, all);
Note that, for the last MAFadePlaylist command, I specified 'all' for the last playlist controller. The third parameter is the name of a playlist controller (or 'all'), not the name of a playlist. Feel free to change this to the name of your playlist controller if you have multiple and only want to fade one. In the first two commands, I assumed you had two separate playlist controllers.
Here's some background on the possible confusion in the order of values: Master Audio was the very first Dialogue System integration. Back when it was written, the order of values in Master Audio's API was the same as the sequencer commands. Since then, Master Audio changed the order of values in its API. I didn't want to break everyone's sequences, so I left the sequencer commands with the original order of values.
Re: Advanced music control with MasterAudio
Posted: Fri Dec 07, 2018 1:43 pm
by LewisFTG
Great stuff! Thankyou Nathan and Tony.
Much appreciated!