Start and stop sound linked to bone rotation?

Hey there!

I have a probably stupid question regarding sound and skeletal animation… I have a robot arm skeletal mesh with animation, and a rather long one at 8+ minutes… and would like to add sound to it to make it a bit more realistic. I have lots of recorded servo motor sounds to apply but am unsure of how to approach it with the least amount of tedious manual work. So before placing probably several hundred sounds on a time line by hand: Is there a way to trigger SFX for selected bones at least semi-automatically, starting and stopping with their rotation animation? A “play while moving” functionality I don’t know about yet?

Thanks in advance :slight_smile:

Hey @Agile_Aardvark! Welcome to the Forums!

To be clear, are you meaning that you do not want to use Anim Notifies on the animation or do you have a timeline in level that you do not want to manually place sounds on?

Any additional specifics or information you can provide may go a long way in solving your problem!

1 Like

thinking aloud:

you can have some looped servo sound. You spawn it and store it in a Variable.
set autodestroy OFF so the spawned sound wont be destroyed when reachs end.

somehow you can measure the rotation speed between bones (by comparing the angular difference on delta time) and use it to drive the volume and pitch of the spawned sound.
This variation could be reached with Finterp that makes variations of floats move in a soft ease way.

if speed = 0 you can even pause the sound. you could implement all this in an actor that is focused exclusively on this and it works only if you set the two bones you want to evalaluate so you can have two public bone variables and some other parameters to control it.

I think is totally doable :slight_smile:

2 Likes

Hey :slight_smile:

Sorry for obviously not being precise enough in my description before…
Yes, I would love to avoid having to use anim notifies as there are multiple servos involved in articulating the arm and creating those notifies by hand would mean I’d have to go through the whole 8+ minutes for each one of the 10+ different motors with, combined, probably a few hundred separate activations through the animation, so the same number of notifies to add which would be a really frustrating and time consuming thing to have to do. In addition, if the animation does change it could mean redoing it all more or less from scratch because things depend on and thus move with each other, which would eat up even more time. That’s why I thought there might be a smarter solution based on bone rotation or another information I could theoretically get from the animation sequence.

Thanks for your quick reply :slight_smile:

Oh, this sounds really interesting and a lot like what I thought the solution could be. (With my limited knowledge of UE - I started learning it a month ago - I thought there was some kind of “trigger” I could just add to the bones somewhere though)
I actually do have a looping servo sound and using the calculated speed to modify the volume and pitch would make it even better, I didn’t think of that and was going to accept the static start/stop. Nice!

Since in reality the change in pitch is directly related to the servos speed, with this idea it would be possible to even do the ramp up/down in a semi realistic way, all with one short looping sound…

I’ll test around a bit and try to find a way to get this to work. I have more than enough bones in there to reference, of course :smiley: I think it could be enough to get the angle change in delta t to do this, without needing to reference a second bone.

I really do appreaciate your time!

1 Like

its a nice challenge
Good luck! :slight_smile:

1 Like

Soo. I think I got it :smiley:

I had a bit of trouble because Adjust Volume stops the sound when the “Adjust Volume Level” value is set to 0, but 0.0001 does the trick of practically muting it while keeping it adjustable because it doesn’t stop completely.

I have a timer checking if the current angle value (Get Socket Rotation, which to my surprise takes bone names too so I don’t have to add additional sockets) is different from the one from the last timer cycle and use it to adjust the volume with a bit of threshold to “mute” slightly jittery animation, then set the old angle value to be the latest one. Rinse and repeat. Now all I have to do is add more checks for additional bones and a few iterations of the sound file for some difference between the components of the arm.

While I “debugged” the values via UI text boxes (:stuck_out_tongue:) I noticed that the values I get for angle delta per timer cycle are more than good enough (with some clamping for safety) to change volume and probably also pitch, although so far I had no luck finding the pitch change node. EDIT: Found it :smiley:

Thanks again for this idea :slight_smile:

1 Like

awesome! well done :slight_smile: