BeatIt

Plugins BeatIt

HAL9001

Well-known member
Messages
125
Reactions
565
Points
93
HAL9001 submitted a new resource:

BeatIt - Plugin for flexible analysis of and reaction to sound

BeatIt is an audio analyzer that sends trigger messages to anywhere in the scene based on the intensity of certain frequencies in the music or audio (e.g., Bass). This version of an audio analyzer uses automatic calibration and volume compensation to deliver always the same reponses regardless of the volume of the Audio Source used, and it allows for full configuration of up to 8 frequency bands to look at.

View attachment 250514

I derived the code for this plugin from...

Read more about this resource...
 
This works really well, thanks for sharing!

If I may, I have a small suggestion/request. Make the demo scene a separate .var, so the plugin has no dependencies.
Thanks for the suggestion. I've noticed that separate-var-scene thing on the Hub recently, but then I am also constantly reminded by the Hub itself that having a scene built-in is useful to demonstrate a plugin.
I usually painstakingly avoid every dependency in the demo scene (you might have noticed that it only uses in-built assets), and in this case I thought: Who does NOT use Timeline ;-) However, it's only necessary to spin the lights, so I could replace it with a small script. Will have a look into it. Cheers,
 
Thanks for the suggestion. I've noticed that separate-var-scene thing on the Hub recently, but then I am also constantly reminded by the Hub itself that having a scene built-in is useful to demonstrate a plugin.
I usually painstakingly avoid every dependency in the demo scene (you might have noticed that it only uses in-built assets), and in this case I thought: Who does NOT use Timeline ;-) However, it's only necessary to spin the lights, so I could replace it with a small script. Will have a look into it. Cheers,

Thanks for the reply. Yeah, I get what you're saying and indeed it's not a big deal. But in the near future, when Timeline is updated, any scene using this and the latest version of Timeline will have 2 different versions as dependencies.
 
...But in the near future, when Timeline is updated, any scene using this and the latest version of Timeline will have 2 different versions as dependencies.
Oh, OK, that's indeed not nice. Thanks for pointing that out.
 
I played with this, but I'm still scratching my head over how this makes her head and foot move with the rhythm. Could you explain this a little?
 
I played with this, but I'm still scratching my head over how this makes her head and foot move with the rhythm. Could you explain this a little?
Hehe, well spotted. I am simply driving the jointDriveXTarget angles of the hands/neck/feet via physics: SpeakerL, Band 1 drives the hand and her neck, Band 2 drives her foot. Exercise: If you use Band 8 on her left hand (0...30 degrees), she would tap on the high-hat off-beat for Song 2.
Foot1.jpg
Foot2.jpg
 
Hey nice work.
Could this be used to trigger a small trust animation for exemple at each beat, syncing the trust with the music ?
 
Could this be used to trigger a small trust animation for exemple at each beat, syncing the trust with the music ?
Sure, nothing stops you from triggering Timeline commands, e.g. "Play Thrust" once you've setup such an animation. Just keep in mind that any blend time would delay the execution.
 
Sure, nothing stops you from triggering Timeline commands, e.g. "Play Thrust" once you've setup such an animation. Just keep in mind that any blend time would delay the execution.
It's not working immediatly, since it's frequency trigger. Using logicsbricks it's working great. I've got an initial scene working, where the beats activate the trust, thank you for this ;)
 
HAL9001 updated BeatIt with a new update entry:

v1.1 (var 3): Works properly on Person atom, too

After a prompt by @BlackMagic, I realised that the code for automatically searching the AudioSource of the atom was weird (hey, that was my first plugin ever... so I am excused) and missed the HeadAudio of a person when attached to one. Fixed now. The demo scene has a new button ("V") that makes her say something and the eyes flash based on the spoken words driven by the BeatIt plugin on the "Woman" atom.

Read the rest of this update entry...
 
Yo Hal!

I was on the verge of ending the life of VAMAudioAnalyzer after seeing your plugin yesterday (mine becomes useless with your far more advanced implementation)... and tried to migrate a scene we're working on for you plugin.

Nothing was reacting as I was expecting, I started debugging my VFX plugins thinking they weren't compatible with it... but at some point I realized it was just a stupid transition trigger and it should work.

I ended up putting two cone lights, and triggering a simple intensity change. None of the bands works besides 1.
I've checked your code, nothing seems off and I have no lead on the potential issue.

Using the last version : )
 
Yo Hal!

I was on the verge of ending the life of VAMAudioAnalyzer after seeing your plugin yesterday (mine becomes useless with your far more advanced implementation)... and tried to migrate a scene we're working on for you plugin.

Nothing was reacting as I was expecting, I started debugging my VFX plugins thinking they weren't compatible with it... but at some point I realized it was just a stupid transition trigger and it should work.

I ended up putting two cone lights, and triggering a simple intensity change. None of the bands works besides 1.
I've checked your code, nothing seems off and I have no lead on the potential issue.

Using the last version : )
Oh, weird. Could you do me a favour and try with var 2 - I hope my last change didn't break something else. What kind of atom is BeatIt attached to? What are the frequencies and bandwidths?
 
Oh, weird. Could you do me a favour and try with var 2 - I hope my last change didn't break something else. What kind of atom is BeatIt attached to? What are the frequencies and bandwidths?

Yup I can try!
I'll make a default scene with the 3 and save a basic "vanilla" json to send back to you this evening.

Basic use :)
AudioSource, tested every frequency band as mentionned. 1 is working, others aren't!
 
Hm, really weird. No matter how much I try, I cannot replicate your problem.
I'll push another minor change that prints a bit more detail when there is no AudioSource, and a Pushbutton and standalone AudioSource as test objects in the demo scene - all of them work for all bands on my computer :-(
Is it maybe the VaM version (I'm on 1.22.0.3 ... but that can't really be as AudioSource is a Unity thing).
Can you send me the scene JSON of that test scene of yours?
 
Hm, really weird. No matter how much I try, I cannot replicate your problem.
I'll push another minor change that prints a bit more detail when there is no AudioSource, and a Pushbutton and standalone AudioSource as test objects in the demo scene - all of them work for all bands on my computer :-(
Is it maybe the VaM version (I'm on 1.22.0.3 ... but that can't really be as AudioSource is a Unity thing).
Can you send me the scene JSON of that test scene of yours?

Thank you for your time. Feedback on that: I don't know what the fuck happened that night.

You know that I do my fair share of coding, and I'm extremely careful through my testing processes, especially since I hate pushing broken things or reporting incorrect behaviors (all coders love a good and thorough report : D)... so you can imagine myself doing a lot of tests before coming up into this discussion:
  • Hard resetted dozens of time
  • Created different empty scenes
  • Used internal and external music
  • and more...
None of the bands were working besides the 1.
Now yesterday, I grab the version two, create an empty scene. Thing works.
I quit VAM, delete the 2 so that the scene updates automatically to 3, the thing works... I'm like... what?

Doubting the result, I'm exiting VAM, restarting it, creating the same scene from scratch, the thing works too.
I'm actually clueless about what happened.

The only lead I have is that, that night, it was my first time testing the plugin. I downloaded it from the ingame store, and did not restart VAM. Only hard resetted it compared to yesterday's tests which obviously was a completely new session. This is the only difference. And it seems completely bonkers to me because I don't know why the code would compile and work properly only on a fraction of the code... it seems impossible. But VAM being very weird sometimes, I'm kind of like ¯\_(ツ)_/¯

So I've added to my testing process "always download and restart VAM" :p

I'm really sorry to have you worried about the stability of your plugin!

PS: I'll update the scene with BeatIt, and if everything works according to plan... I'll end the life of my plugin and directly link and recommend BeatIt as the successor everyone should use.
 
Thank you for your time. Feedback on that: I don't know what the fuck happened that night. You know that I do my fair share of coding, and I'm extremely careful through my testing processes, especially since I hate pushing broken things or reporting incorrect behaviors (all coders love a good and thorough report : D)... so you can imagine myself doing a lot of tests before coming up into this discussion ... But VAM being very weird sometimes, I'm kind of like ¯\_(ツ)_/¯ So I've added to my testing process "always download and restart VAM" :p I'm really sorry to have you worried about the stability of your plugin! PS: I'll update the scene with BeatIt, and if everything works according to plan... I'll end the life of my plugin and directly link and recommend BeatIt as the successor everyone should use.
Hehe, I totally understand the "testing/verifying" before raising an issue thing. Don't worry, no harm done, and some more testing added and additional glances over the code done on my end, so things are probably even more stable now than before. I feel honoured to have my first ever released Plugin become the successor of yours. Thanks for that. I hope you never misunderstood BeatIt being released as a criticism of your coding skills.

There is actually something else in my pipeline, and I wanted to run it by you before any release... I will PM, er, "converse" with you about that ;-)
 
Hehe, I totally understand the "testing/verifying" before raising an issue thing. Don't worry, no harm done, and some more testing added and additional glances over the code done on my end, so things are probably even more stable now than before. I feel honoured to have my first ever released Plugin become the successor of yours. Thanks for that. I hope you never misunderstood BeatIt being released as a criticism of your coding skills.

There is actually something else in my pipeline, and I wanted to run it by you before any release... I will PM, er, "converse" with you about that ;-)

Never thought about that :)
Someone properly mentionning the original source and building upon it is somewhat more a gratification than a downside ;)

Sure! no problem! See ya in PM!
 
@HAL9001 I found the origin of the bug : )
This might help you out if other people have similar issues.

I think it might have to do with the the GetSpectrumData, but long story short: if you try to migrate my plugin to yours from a scene, even after removing mine, yours won't work. If you save the scene, then reload it, bam the thing works.

So, there's potentially no issue in your plugin or mine. Both working in the same scene without hard resetting will produce one or both to not work properly. I've checked the code of both... nothing seems to indicate a potential problem... but you know, weird behaviors, that's not rare in VAM/Unity ;)

So I'm gonna drop VAMAudioAnalyzer and redirect to your plugin.

Stupid ideas if you want to improve it:
  • Be able to configure the "global" speed/update options per band.
  • Be able to bypass/enable/disable each band triggers at specific moments.
    • This could also allow to only enable the bands with actual actions (and skip the triggering part). This might not be a big load on the CPU, but you know... optimizing is always nice ^^
Cheers!
 
Last edited:
@HAL9001 I found the origin of the bug : )
Weird indeed. Might be a Unity bug - not necessarily VaM.
So I'm gonna drop VAMAudioAnalyzer and redirect to your plugin.
No pressure ;-)
Stupid ideas if you want to improve it:
  • Be able to configure the "global" speed/update options per band.
  • Be able to bypass/enable/disable each band triggers at specific moments.
    • This could also allow to only enable the bands with actual actions (and skip the triggering part). This might not be a big load on the CPU, but you know... optimizing is always nice ^^
Good suggestions, and the disable button is very easy to do. I was also wondering about trigger events flying all over a scene and have some of my plugins to only fire when the delta of the current vs. a previously fired value is larger than a threshold.
The speed thing though is a bit less trivial, starting with UI clutter, but maybe an overall speed multiplier per band. Looking at the code, I also just realised that it is only halfway framerate independent... bugger.
 
The speed thing though is a bit less trivial, starting with UI clutter, but maybe an overall speed multiplier per band. Looking at the code, I also just realised that it is only halfway framerate independent... bugger.

For the speed thing, you could use the same approach as I do in VAMS with a single UI.

At the top of the speed/global settings on the left column, you could have a title "Global settings" and once you change the edited band below, you change the title to "Band X settings" but those sliders stay the same and influence the "band X" parameters.


I was also wondering about trigger events flying all over a scene and have some of my plugins to only fire when the delta of the current vs. a previously fired value is larger than a threshold.

I think that transition triggers are quite nicely optimized in VAM. But only triggering the ones that have actual actions in them would be better. I'm saying that, but in my case it was brute forced on every frame and it wasn't a very big deal on the performances.

The thing I did optimize in VAMStory is the timed triggers which is a whole other subject.
 
Back
Top Bottom