How do I syncopate sound/music based on events?

Get help using Construct 2

Post » Sat Jun 21, 2014 2:35 pm

Dear all, I'm trying to get my music tracks to fade in and out, depending on the situation. I could use some help conceptualizing it.

The game: sneak around and don't get seen. Hide in shadows and evade guards/cameras.

The wanted effect: imagine a 80's funk baseline track playing in the background. This loops for as long as the player remains unseen. As soon as the player is within a guard's/camera's LOS the music fades out and a timer "detection" starts running for 3 seconds. When "detection" runs >/= 0, another funk track (james brownish trumpets) already running in the background fades in (increase volume from 0 to the desired volume, 100 by default), changing the background music to a more upbeat loop. This continues until the player is hiden again. The trumpets fade out to mute and the base fades back up.

Am I on the right track?

As always, thank's for reading
B
7
S
2
Posts: 51
Reputation: 627

Post » Sat Jun 21, 2014 3:33 pm

Just switch your volume settings to go from -100 to 0 and you should be fine (sound is at it's max at 0db. You always decrease volume.)
ImageImageImage
B
71
S
22
G
257
Posts: 3,790
Reputation: 142,696

Post » Sat Jun 21, 2014 3:35 pm

Ah, that´s good to know. Still wondering about syncopation though.....
B
7
S
2
Posts: 51
Reputation: 627

Post » Sat Jun 21, 2014 3:47 pm

Use the Timer behaviour to run your 3 second timer. When the LOS condition occurs, start the timer, use lerp to adjust the two volumes, when the timer triggers, use lerp in the opposite direction for the volumes.
ImageImageImage
B
71
S
22
G
257
Posts: 3,790
Reputation: 142,696

Post » Sat Jun 21, 2014 3:59 pm

Ok. I´m ashamed to say I don´t fully understand lerp yet. I´ve used it for my camera movement, but fail to see how it would work with sound. Would you/anyone mind explaining lerp in noobish?

Thanks
B
7
S
2
Posts: 51
Reputation: 627

Post » Sat Jun 21, 2014 4:47 pm

ImageImageImage
B
71
S
22
G
257
Posts: 3,790
Reputation: 142,696


Return to How do I....?

Who is online

Users browsing this forum: Voytek and 6 guests