Skip to main content

Sounds Actually Kinda Alright

·864 words·5 mins

Took a break from sound effects yesterday because honestly, it was a little disheartening. Didn’t think the result of my first venture would be quite so bad. (The Audacity!)

I did some programming and drawing instead.

Came up with a couple ideas for the sounds in the meantime, though.

One. Instead of finding a bee sound or learning to generate one using a synth, I can just record my voice. So here I am making various buzzing sounds into the mic in Audacity.

Best case scenario, with some editing I can get sounds I can actually use. Maybe since the drawings look so home made the sounds being home made will be alright, too. Hopefully not as home made as Desktop Tower Defense but at least it’ll never be mistaken for AI.

Here’s Tower Defense in case you’re wondering.

Some of it is hand drawn but looks like the enemies at least are vector art..?

Anyway.

Number two. Last time I triggered a buzz sound when the velocity from “a while ago” is going in a very different direction from the velocity now. The timing felt off. Probably partly because of the sound file I was using but I think there were other issues.

One issue is the onset of the sound would be delayed until the velocity was actually changed. So the buzzing would happen after the bee had changed its velocity, not during the heavy acceleration change.

The other issue is the sound was not tied directly to player control. It would feel much better if pressing a button triggered the sound that way it feels like it’s coming from you.

So I think I can get a much better effect just by comparing the current velocity and the controller direction. If they’re very different then trigger the sound.

The vocal buzz works okay. I can’t get the loop quite seamless but it’ll do for now.

I’m doing a lot of Tween tweaking to get the buzzing sound to fade in and out at the right times. It’s pretty tricky.

Right now I’m comparing the velocity and direction with both vectors normalized. If they’re very different then start the buzz. If they’re similar then stop the buzz. However, this quits the buzzing too early. As soon as the apex is reached the buzz stops but really, I want it to keep buzzing until it reaches the velocity the player/controller wants.

Or at least, what the player/controller is able to attain.

That’s 580 when going up and to the side, 990 when going straight down, 815 when falling to one side, and 460 going up. That, uh… makes things tricky.

Let’s try buzzing if the target speed is 400 since that’s below the lowest.

I tried using really short clips instead of a long looping one so I could just trigger it and let it finish on its own. Doesn’t work very well. It just doesn’t match the motion.

Then, in an effort to figure out what I wanted I tried capturing a video of the bee just flying around silently. Then I replayed parts of the video while making buzzing noises. It’s weird. It’s hard to know what I’m after. Mostly I’m just getting a lot of things that I know I don’t want.

Maybe the pitch should change with the height of the player. Or the velocity, let’s try.

Okay, so far I like using the acceleration vs. controller direction for the volume and the global y-position of the bee as the pitch.

Using the velocity of the bee directly is also a possibility. Then when you’re traveling in one direction for a while it gets louder. But I really like having the turns produce a sound.

I smoothed out the acceleration vs. controller direction because otherwise it’s very very spiky and that makes the sound come in and out really quickly. That’s annoying.

I need to tweak the values some more. I have a couple constraints I can use.

When the bee is moving from side to side and it has enough time to build up speed in one direction before switching to the other I do want to hear a buzzing sound at the turn.

But when it just goes side to side really quickly like the image below, I don’t want to hear a buzz.

Another issue is starting at a high y position and pressing the right controller key. That should be pretty quiet or even silent. Not a lot of turn and burn going on there. But since the velocity is affected so heavily by gravity, it differs from the controller direction a lot.

Should I store the impact of gravity on the velocity separately? Or maybe add gravity to the controller direction?

Adding gravity to the controller direction worked but it’s kinda hacky. The numbers seem very magical. Probably falls apart at different frame rates for one. That’ll be tricky to sort out.

I ended up combining the y-velocity and the y-position of the bee to adjust the pitch. And I did a quick quadratic function to boost the volume of the buzzing in the mid range. (Thanks once again, Desmos.)