Fade music in Construct 2?

0 favourites
  • 11 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • First of all, Construct 2's the best! This is the only program I know where you can make a full game in just a few minutes! <img src="smileys/smiley4.gif" border="0" align="middle" />

    Anyway, I know it's a noobish question for you guys (I'm still quite new at this), but I've been searching on the forums how to do just that -- sadly, the only solution found applies only for Construct Classic.

    Any help would be appreciated! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Extract from the how do I FAQ (sticky in that forum) section "Audio" :

    olume control on a sound played - LINK

    This is for sounds, but should also apply to music.

    Also to fade it, use the lerp expression (also explained in the how do I FAQ).

  • Extract from the how do I FAQ (sticky in that forum) section "Audio" :

    olume control on a sound played - LINK

    This is for sounds, but should also apply to music.

    Also to fade it, use the lerp expression (also explained in the how do I FAQ).

    I did try that, but I don't have any idea how to implement lerp into Soundvol. I attempted adding a 'lerp (-40, 0, 2*dt)' to the 'add to' action for variable Soundvol, but it didn't work. Any ideas?

  • guess you should set the new value, instead of adding it.

  • Thanks a lot! :D

  • Thanks for example Kyatric .... really interesting ... hummm ... HAVE SOMEONE a formula for doing a Rlerp (Reverse Lerp) ... the fade out is really to fast !!

    This give me a idea to improve this example :

    • > With a jungle sound only on right stereo channel
    • > And the same jungle sound only on left stereo channel

    Seems easy to create a 2D positionnal system ajusting volume on the two channels no ?

    I don't have tools to do this sounds but i'm really ready to create a bigger example with this 2D features !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Kyatric Hi, I was just following this capx and I couldn't for the life of me work out what the number 40 was used for in the LoopVolume actions and conditions.

    I was trying to modify this as to allow the music to start at -10, but really couldn't work out what was happening in the beginning - any help would be great :)

  • sean Noonan: Audio volume works in -10 (db) intervals.

    -10 is half as loud as 0.

    It's an old example so I can't remember exactly what the thought process was, but I think through trial and error that -40 ended up being a true "no sound volume anymore".

  • Kyatric

    I thought Ashley mention the true absolutely no sound to be -99.

    When I put my computer and amplifier at max, I found -40 still audible and only -99 to produce no sound.

    Just my experience.

  • I would also change this be instead of

    LoopVolume < 40

    I would use System LoopVolume < 39 -> Set 'Loop' volume to -LoopVolume db

    This will save some processing. As you lerp from 39 onwards, the values get progressively smaller, extra cpu cycles that aren't needed. IE it goes 0-39 fast but then 39-40 after a few seconds.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)