Maaack's Music Controller

by Maaack

5

Godot Music Controller

For Godot 4.2

This music controller keeps music playing between scenes and blends tracks.

Example on itch.io
Example is of Maaack's Game Template, which includes additional features.

Use Case

For mainting music playback during scene changes and blending between tracks.

Features

  • Automatically detects and reparents audio streams with a matching audio bus (Music by default) and autoplay enabled.
  • Allows blending between tracks, and fade-in/fade-out timers.
  • Works with Godot's built-in AudioStreamPlayer.
  • Includes a simple scene extending AudioStreamPlayer with the audio bus and autoplay already set.

How it Works

  • project_music_controller.tscn is an autoload that keeps music playing between scenes. It detects music stream players as they are added to the scene tree, reparents them to itself when they are removed, and blends the tracks.
  • An audio bus is added at runtime that manages blending the fade in with any other animations on a music player.

Installation

Godot Asset Library

This package is available as a plugin, meaning it can be added to an existing project.

Package Icon

When editing an existing project:

  1. Go to the AssetLib tab.
  2. Search for "Maaack's Music Controller".
  3. Click on the result to open the plugin details.
  4. Click to Download.
  5. Check that contents are getting installed to addons/ and there are no conflicts.
  6. Click to Install.
  7. Reload the project (you may see errors before you do this).
  8. Enable the plugin from the Project Settings > Plugins tab.

GitHub

  1. Download the latest release version from GitHub.
  2. Extract the contents of the archive.
  3. Move the addons/maaacks_music_controller folder into your project's addons/ folder.
  4. Open/Reload the project.
  5. Enable the plugin from the Project Settings > Plugins tab.

Extras

Users that want additional features can try Maaack's Game Template.

Usage

In your project settings, under the Globals tab, confirm that the ProjectMusicController is listed as an autoload.

Open project_music_controller.tscn scene, and inspect the root node of the scene tree. Set the music controller's audio bus to the one designated for playing background music ("Music" by default).

Important

The controller assumes a "Music" audio bus has been added to the project. The Audio controls are usually available on the bottom panel of the editor.

Use AudioStreamPlayer nodes in your scenes to play background music as normal. Set the audio bus to the one designated for playing background music, and set autoplay to true.

You should be able to interact with your audio stream in the scene as normal. It will not get reparented until it's parent scene exits the scene tree.

Links

Attribution
License

Version

0.14.0

Engine

4.2

Category

Scripts

Download

Version0.14.0
Download Now

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author