Music Controller
Last updated
Last updated
The Music Controller is a tool for playing music in your world, and for directly controlling it with a Control Panel.
Add an instance of BPM_M2_Audio_MusicController
to your level.
Import your music assets and ensure that they ALL have their Virtualization Mode
parameter set to Play when Silent
.
Set the SoundClass of your music assets to SCL_M2_NonWorld_Music
.
Create a DataTable, using S_M2_Audio_MusicData
as the Structure, and add your music tracks, giving each a unique name.
Add the DataTable to your MusicController in the Music Data Table
field, this can be found under Config
on the selected BP's Details
panel, as seen below. You can now either set the system to automatically load your music at game start, and begin playing, or be manually controlled.
Enabling Auto Play at Game Start
will load your music tracks and play them in the chosen mode (List being the default).
Once in-game, the panel can be opened as a Director by clicking on the actor, or adding the ActorTag AutoOpen
, and used as follows:
Currently Playing: This shows the currently-playing track, and the state, such as “Playing” or “Paused”. Beneath this, the time remaining on the current track is displayed.
Playlist: This will show a list of buttons for the loaded data table of music. In the above track, the Playlist is empty, as nothing has been loaded. The buttons can be clicked to immediately being playing the clicked track.
Playlist Mode:
Queue: Each track is “consumed” once played. This functions like Spotify’s Queue.
List: Each track plays in sequence, and once the playlist finishes, it loops back to the start.
Random Playlist: Tracks are played randomly from the playlist.
Play/Stop/Skip: begins playing the Playlist, stops it, or skips the current track.
Pause: Pauses the currently-playing track.
Looping: Loops the current track.
Available Tracks: Shows a drop-down of all tracks found in the DataTable.
Track List Controls: Allows addition and removal of tracks to/from the Playlist.
Preview: Plays the track that is selected in Available Tracks (only the Control Panel user will hear this).
Volume: Adjusts the current volume. In preview mode, this will only affect the music that is being previewed.