How to achieve glow particle sync to music

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By cosmo

So I am pretty new to godot, I want to make something special for my gf’s birthday.
Please take a look at this video:

how would i achieve this particle effect syncing with music in godot?

I guess one particle node cant do this, can it?
I need like 50 nodes right?

Another thing is how would you go about syncing the music?

I am thinking about using python Librosa library to find out the beat time copy the list of time as an array to GDscript.

If you have better ideas, please share, thanks guys.

:bust_in_silhouette: Reply From: Surtarso

you will have to extract the audio waveform high/low points and feed that to your particle emitter.

I have done exactly this years ago on after-effects. But no idea how to extract the audio points in godot…

Thank you for helping.

check my updated answer.

cosmo | 2020-11-05 20:13

:bust_in_silhouette: Reply From: cosmo

I used a python library called librosa to get the time stamp of the beats. I then used that info to sync my particle to the music.
At the beat, I change the size, speed ,and glowing of the particles exponentially.

meta code:
size = size * factor
you can check out the result here:
go to 1:27

Again, this is my first time making any game, dont expect too much.

I guess librosa gave you the beat points… That effect could have been achieved with a simple timer at the same beat as the music (assuming the song keeps a solid beat)

extracting the audiowave up and down points relative to muted (zero volume) give you a uint range you can extrapolate for effects like a visual mixer

so in your case the balls would grow and glow relative to their beat strength and timming in music giving a more dynamic visual feedback, rather than just beat timming =)

check around 0:45
srry its a really old video lol

game is looking good!

Surtarso | 2020-11-05 21:17

that video is effect is cool, how did you make that?

I was thinking about using volume as well, librosa can do that. I can pick a time point where is relative volume is higher than its neighbors and use that as a point to do something in the game.
Just like you said, it would be less boring than only beat timing.

If i ever make any music game in the future, ill defiantly experiment that idea.

cosmo | 2020-11-05 21:56

that was a … fun… project haha (syncing lyrics was hell)

but I used the general waveform as the emitter position, so the particle emitter would bounce to the beat of the music
than I split high and low beats and got their relative up/down points in every second of the waveform (thats a lot of points) and shoot them in oposite directions
so in the video, green is trebble and purple is bass
and the strengh (acceleration) the particle is shot depends on how high it reached on the waveform

so you get that boucing center shooting on both sides different information with just acceleration and beat

Surtarso | 2020-11-05 22:04