Maaack's Music Controller
by Maaack
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.
When editing an existing project:
- Go to the
AssetLib
tab. - Search for "Maaack's Music Controller".
- Click on the result to open the plugin details.
- Click to Download.
- Check that contents are getting installed to
addons/
and there are no conflicts. - Click to Install.
- Reload the project (you may see errors before you do this).
- Enable the plugin from the Project Settings > Plugins tab.
GitHub
- Download the latest release version from GitHub.
- Extract the contents of the archive.
- Move the
addons/maaacks_music_controller
folder into your project'saddons/
folder. - Open/Reload the project.
- 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
Download
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author