Forum rules - please read before posting.

Smooth Music Transitions

I've noticed that when I change between scenes that have 2 different types of background music, it just stops the previous one and then plays the next. Creating a jarring sound.

Is there not a feature where to music crossfades in to the next so that the transition is seamless?


Also, I've noticed that if I've lowered the volume of the music in a scene, it will play it at it's normal volume for a split second before altering it to it's set volume. This creates an unpleasant 'burst' of sound. Can this in any way be fixed?

Comments

  • To fix the 'burst': play the sound using an Action, rather than checking the AudioClip's Play on awake checkbox - this is run before AC has a chance to lower the sound manually.

    To crossfade music, you'll have to make the first music survive the scene change and then play the new music once it's loaded.  Check Play across scenes? on the Sound component.
  • Thanks Chris.

    However, using the play across scenes is fine if a certain amount of scenes use the same music but if 2 scenes have different music then it plays the previous scene's music AND the new scene's music at the same time.

    How do I actually crossfade smoothly between the 2, and how do I change the duration of the crossfading music?
  • Hey, changing the duration of crossfades would be a very nice feature.
  • If you want to crossfade between two tracks, obviously they both need to be in the same scene at the same time - so you'll need the first one to survive the scene change.  Don't have the second track set to play when the scene begins - you can now use sound Actions to fade the first out, and the second one in, over any duration you choose.
  • Thanks Chris but I'm really not sure how to use the sound actions to achieve this.
  • Hi @TayannaStudios - the sound actions allow you to start, stop and fade music in and out and specify the length of time it takes to do so. So, say you wanted there to be a 2-second smooth transition, you make the first piece of music survive the scene change, then when the next scene loads, have an action list which tells the first piece of music to fade out over 2 seconds and then immediately (tell the next scene's music to fade in over 2 seconds.
  • edited February 2017
    Hi Chris,
    I have an issue (or maybe cant use AC Properly).
    Im having 2 music pieces in 1 scene 
    (Nr 1 is normal "bacground music" Nr 2 is "zoomed camera music").

    So Im having action like this "Zoom In Trigger":
    (I want Nr 1 music volume set to 0)
    and start playing music Nr 2
    so far so good (it works):

    But when player walks off  "Zoom Out Trigger"
    Than I want Nr 2  to stop and Nr 1 fade in (volume, not start from begining).
    and this is not working...  Nr2 is off but Nr 1 is silent as well:

    Is there something wrong in my scrypt ? or AC has some limits ?
    How can I achieve what I want ?



  • You should switch to AC's new dedicated Sound: Play Music Action - there you have greater control over effects such as cross-fading and resuming music.  See Section 5.11 of the Manual, and the updated 3D Demo which makes use of that method as well.
  • edited February 2017
    Ok,

    Im using it now, its better,
    But is that possible to use this method and music being present during Pause ?
    Before it worked (with sound objects in scene ;])

    Thanks 
  • Also,
    I have situation like this now:
    1 I have "Main theme Music" (it is starting to play in cutscene "OnStart").
    2. I have "Zoom Music" (it is turned on using the same "Play Music" action during player is on trigger).
    So far so good
    But when camera zoomes out I want "Main theme" to continue from the same second it faded out during zoom in. (trigger interaction).

    But this is not possible and aesthetic effect is poor 
    (it starts again from the begining)
    Is it possible to add "pause" function to "Play Music" action AC some day ?

    I know this is possible becouse music pauses during pause screen.



  • edited February 2017
    Music can be played when paused via the Music can play when game is paused? in the Music Storage window.

    Music pausing during pause screens is due to Time.timeScale being set to zero - not due to the sound itself being manipulated.  I will, however, see about an alternative technique that allows previously-played music to be resumed.
  • Great this will add overall quality to all games made in this engine, with this future sound methods.

    Thanks for clue about pause screen (I haven't noticed it by myself).




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.