Create adaptive music systems in your game using the AdaptiveMusicPlayer
and AudioStemPlayer
.
Only compatible with Godot 4.x
- Easily create adaptive music systems in your Godot game.
- Dynamically change music properties like BPM, time signature, etc., through the inspector.
- Add or remove song stems from the track during runtime.
- Use the
StemPlaybackPreset
Resource to define how each stem should be played.
The AdaptiveMusicPlayer
node extends Godot's AnimationPlayer
node and provides a way to play adaptive Music.
It holds values that can be changed in the inspector that correspond to song data.
The AudioStemPlayer
node extends Godot's AudioStreamPlayer
node and is designed to be used alongside the AdaptiveMusicPlayer
. An AudioStemPlayer
represents a different stem (instrument, track, etc.) of your song.
It holds instructions for the AdaptiveMusicPlayer
for how a stem should be played and what should be played.
-
Download this repository.
-
Move
addons/AMP
to theaddons
folder of your Godot project. -
Enable the plugin in your project by going to
Project Settings
>Plugins
and activateAMP
.
or
-
Install directly from the Godot Asset Library
-
Enable the plugin in your project by going to "Project Settings" > "Plugins" and activate AMP.
-
Add the
AdaptiveMusicPlayer
node to your scene and configure its properties in the inspector, such as BPM, time signature, and measure count. -
Add one or more
AudioStemPlayer
nodes as children of theAdaptiveMusicPlayer
. -
Customize the
AudioStemPlayer
properties and assign a unique identifier to each stem. -
In your script, you can dynamically add or remove stems from the
AdaptiveMusicPlayer
using theadd(identifier)
andremove(identifier)
methods, respectively.
# Example usage of adding stems with identifiers
var amp = get_node("AdaptiveMusicPlayer")
amp.add("stem_one_identifier")
amp.add("stem_two_identifier")
# You can also use group identifiers to add multiple stems at once
amp.add("Group/group_identifier")
You can also use
StemPlaybackPreset
to define how each stem should be played and assign it to the correspondingAudioStemPlayer
node.
A browser demo using the example can be found on itch.io
This plugin is released under the MIT License.