Adaptive music in the game

Does someone know how to implement this idea of adaptive music system to gdevelop? Or at least stretch whole song through a scene (ambient for example for easy stretching :slight_smile: )
I come up with the idea with the pitch changing at the specific moments (collision with object) but then it’s difficult to determine when the end of the level comes to play the end of song…
Any thoughts about this?

This can help. If someone with great knowledge of programming can translate this to js and post it as extension! I think it would be a great contribution to gdevelop.
Melodrive ai generated music