Author Topic: Music transitions (Fading in/out)  (Read 144 times)

ChampionLeake

  • Newbie
  • *
  • Posts: 1
    • View Profile
Music transitions (Fading in/out)
« on: June 09, 2018, 09:18:31 pm »
I currently trying to explore a way to make the bgm fade in/out when I'm switching in a transition from a map to a new area. As the screen fades out (as a transition), I want the music to slowly fade out as well. Same thing when I'm entering a new map where I want the  bgm to fade in.

Is there a way to get started with that? I've been looking around for some scripts.

Diarandor

  • Hero Member
  • *****
  • Posts: 966
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Music transitions (Fading in/out)
« Reply #1 on: June 09, 2018, 11:39:29 pm »
Exercise: code it yourself. (Hint: use timers to change the volume in a smooth way.)
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

Max

  • Full Member
  • ***
  • Posts: 126
    • View Profile
Re: Music transitions (Fading in/out)
« Reply #2 on: June 10, 2018, 01:45:43 am »
You should probably know before you try coding though, I don't think Solarus has two tracks for music, so crossfading would (as far as I can tell) be impossible, since playing a new track automatically overwrites the current track. I'd recommend a quicker fade so there isn't much silence. Or embrace the silence and compose tracks like Breath of the Wild's.

Max

  • Full Member
  • ***
  • Posts: 126
    • View Profile
Re: Music transitions (Fading in/out)
« Reply #3 on: June 18, 2018, 08:01:23 pm »
Something else I thought of- there's a few games I've played (Metroid, Hollow Knight) that when transitioning between areas, have a room with no music. The rooms also visually transition between the spaces, and you could use map:on_started() in the transition room to get the music that was playing from a savegame variable, and fade it out, then in the first room of each area use map:on_opening_transition_finished to fade in music that you start silently on map:on_started.