Wwise Callbacks + Unreal: Making a Music Timer

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/elementor/thumbs/Tapa2-plxc8mlkgknu494ln1rgil2ongjt0cfppjthfk8whs.png

Hi there! My name is Conrado Laje, and in this post I will show how I made a musical timer “clock” sound using Callbacks in Wwise.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Callbacks-768×513.gif

In this installment of the series  “my journey into game audio”, I’m making a simple system that uses Wwise’s “Callbacks” to make a “clock sound” that starts playing to inform the player through sound that the timer is about to end. I could simply Post a sound Event that fires every second, but given the rhythmic nature of a timer (60 BPM), it’ll clash with the playing music, that most probably uses another BPM.

So that’s where Callbacks are great. Callbacks provide the information about the music’s beat. You can request this information from the sound engine using music notifications.

At the end of this post there’s a video of the system in action.

The Wwise side of things

I’ve set 3 music tracks with different BPM’s in Wwise to show how the system adapts to different tempos. The music it’s from Blue Fire, the game that I’ve made the Sound Design & Implementation and it’s composed by the great Ariel Contreras Esquivel.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_20.png

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_26-300×98.png

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_27-300×217.png

The Music Segment’s has States added that lower the Voice Volume when the Timer it’s “On”

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_21.png

The Clock Trigger

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_1.png

Now it’s turn the create the Clock Trigger. This is an Actor that I’ve made just to have a timer that starts when the player overlaps a Box collision.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_3-768×384.png

The “Clock Trigger” updates the timer text, and it’s the responsible for starting the music, through a reference of the other actor, the “Music System” Actor.  This Blueprint it’s also setting an Enumerator that changes from Clock “None”, to “Slow”, to “Fast”. This information will make changes about how the music system works, and will Set a State on Wwise.

Here’s the full Blueprint. Please note that you can click on the image and double click to zoom further.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/complete-clock-trigger.png

The Enumerator, and the variables.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_12.png

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_11.png

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_10.png

The Music System

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_2.png

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_4-1024×608.png

The Music System is the Actor that controls the Music, and that play’s the clock sound effects. It has a public variable type “wwise event” that allows the designer to change the music that you want to play.

When the players enters the Box of the “Clock Trigger”, the “Start Music” event it’s called and it Post an Ak Event. The Target is an Ak Component, the Ak Event it’s our public Variable with the desired Event. We retrieve and event from the Post Event Callback, in this case, called “CallbackClock”

It’s really important to set the “Callbacks Mask” to the desired information that you want to retrieve. In this case, “Music Sync Beat” and “Music Sync Grid”.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_15.png

You can keep it simple and just, play the Clock SFX in the “Music Sync Beat” execution pin. But I wanted to add more tension as the timer is ending. So I will use the Beat information for the “slow timer” and the Grid (half time than beat) information for the “fast timer”.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Callback-music.png

That’s pretty much it! The rest is some extra work, to assure that the clock sfx only starts in the firts beat of a bar, to make more sense musically speaking, and to play a “strong clock sfx” followed by tree “weak clock sfx”. For that I’ve made a Beat counter.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_18.png

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_19.png

When the timer ends I’m stopping the music playing and trigger a alarm style SFX.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/Screenshot_17.png

The full Blueprint look’s like this.

!https://web.archive.org/web/20230529182231im_/https://conradolaje.com/wp-content/uploads/2022/03/all-music-system.png

The Result:

And that’s all for the musical Clock System! I hope you found it interesting!

If you have any comments, please reach out through my Twitter, I would love to see if you have any suggestions to further improve this system!

By the way, I’m making one of this blogs per month so… please stay tuned! Thanks for reading! Till the next one!

Here’s the showcase!