6.5) Stinger and Trigger
Throughout the level, the player moves through a series of objects to get a time bonus. On hitting such an object, there’s already a sound effect in place, but it would be nice to have a musical accent to this and let it play on beat with the music. While you can’t control if the player moves through the object on beat, you can incorporate the use of Stingers to delay the music just enough so that it plays at a more musical time, such as the next beat or bar. Stingers aren’t an actual Object in Wwise. Instead, a Stinger is a designation given to either Music Segments or Sound SFX Objects which includes additional instructions on how it should synchronize its playback with other Music Segments.
In your case, the Sound SFX Object you intend to use as a Stinger can exist anywhere within the Interactive Music Hierarchy. From an organizational standpoint, it may make sense to house it within the Music Playlist Container that the Stinger would be associated with. Since this project is rather small, you don’t necessarily have to do this.
Exclude the platformer_pickup_time_ST01 Object in the Actor-Mixer Hierarchy by unchecking the box next to the Object. (Pic01 Exclude Checkbox)
Now re-import the same asset as a new Music Segment into the Interactive Music Hierarchy. You can create a Virtual Folder for the Stinger within the Music Folder. Make sure it is routed to the Music Bus after import, just as the Music Switch Container should be routed to this Bus. (Pic02 Re-import Asset as Music Segment)
Expand the Stingers Virtual Folder and Select the Music Segment and press Play.
You hear the pickup sound reaching an apex shortly after the playback begins, but not instant. Notice that the Tempo in the Property Editor is set to the default 120 BPM. You might feel that this needs to be adjusted to match the 124 BPM, but making this change really isn’t necessary. The reason you don’t need to set its Tempo designation is because only the apex or loudest part matters when aligning it to play with other Music Segments. That apex is where the Entry Cue needs to be aligned. By default, the Snap to: Bars/Beats button is on, which may prevent you from freely aligning the Entry Cue; so, you’ll want to disengage it first. (Pic03 Disable Snap to Bars/Beats)
Zoom as necessary, deselect the Bars/Beats button, hold the Ctrl key on Windows or Command key on Mac, and drag the Entry Cue to the apex of the sound. Everything before the apex is considered to be Pre-Entry and everything after the apex would be considered Post-Exit. (Pic04 Setting the Entry Cue)
Stingers rely on a special type of Game Sync called a Trigger, which represents the action in the game that is to be embellished with a musical cue. Like Event Objects used to play Sound SFX Objects, Triggers can play Music Segments, but with an added ability to defer the playback to occur at a more musical time, such as the next beat or bar. While it’s possible to program the game engine to send Triggers directly to Wwise, that won’t be necessary for the pickup time object in the Platformer Game. Standard Event calls can be configured in Wwise to initiate a Trigger, which then causes the Stinger to play.
In the Project Explorer click the Game Syncs tab.
In the Triggers folder, select the Default Work Unit.
Now right-click the Work Unit and choose New Child > Trigger, or simply select the Trigger Object in the Object row. Call it Pickup. (Pic05 Create a Trigger)
Instead of programming the Platformer Game to send a Trigger everytime the player passes through a pickup time object, it’s possible and much more convenient for the Technical Sound Designer to use the Event that was already implemented for the sound effect to initiate the Trigger you just created. If the Trigger Call was coming directly from the game engine, you’d need to name the trigger exactly the same as the Audio Programmer named the Trigger Call in the game engine. In this case, since it’s not coming from the game engine, you only need a unique name to identify the Trigger.
Now you need to associate the Trigger with the pickup time Music Segment as well as associate which piece of music the Trigger should play along with. Any Music Playlist or Music Segment can be configured with Stingers. In this instance you want to configure the Stinger to work with the start Music Playlist Container.
In the Project Explorer, click the Audio Tab then select the start Music Playlist Container and choose the Stingers Tab in the Music Playlist Container Property Editor. An empty list of associated Stingers appears.
There are at least three Properties you have to configure for a Stinger: the source Trigger, the targeted Music Playlist Container or Music Segment, and an instruction of when the targeted music should play in relation to the currently playing Music Segment.
Click Add. Then click the selector button and choose Pickup. (Pic06 Stingers Tab)
You’ve now configured the Trigger that will indicate that a Stinger should occur when this Trigger is activated, but you still need to indicate which Music Playlist or Music Segment will be played when this happens.
Drag the pickup time Music Segment to the Segment to Play column in the Property Editor, or simply click the … button and choose the Segment. (Pic07 Segment to Play)
Now, when the Trigger is activated, the pickup time Segment will be played. Now you can leverage the unique feature of a Stinger: the ability to defer the Action of when the audio is played to a musically sensitive time. Currently, the Play At Property is set to Immediate, which really doesn’t provide any advantage over simply directly playing the Music Segment from the Event. Instead, you want the pickup time Object to reach its apex at the Next Beat following the moment the player moves through the object.
Change the Play At column to Next Bar. (Pic08 Play At)
The Stinger is now configured. Stingers are part of the inheritance system in Wwise, so adding a Stinger to an Object means that your work applies to all child Objects contained within. In other words, it doesn’t matter which Music Segment is playing in the start Music Playlist Container, this pickup sound will always be heard when the player moves through the object in the game.
The thing you still need to address is that the game has not been programmed to send a Trigger Game Call when the player moves through the object. That’s ok, you’ll set up the pickup time Event to play the Trigger instead.
In the Project Explorer, select the Events tab and choose the Play_pickup_time Event. Instead of the Play Action the Event can also be set to initiate a Trigger.
In the Event Editor, click the Type Property and choose Trigger. The Event Editor adds a Trigger Action to the Event Editor, but the red outline in the Target column indicates that the Trigger is missing.
In the Project Explorer, select the Game Syncs Tab and drag the Trigger to empty area in the Event Editor's Target column, or simply click the Browse… Button to choose the Trigger. (Pic09 Trigger Action)
Now Set the Scope for this Event to Global, since a Trigger isn’t bound to any specific Game Object or Actor.
Now, everything should be configured. You can now generate the music SoundBank and test your Trigger by running through pickup time objects in the game.