0

I'm creating a procedural engine sound generator heavily inspired by AngeTheGreat's engine simulator, but using some trigonometry functions to calculate the piston and crankshaft movement instead of rigidbodies.

I'm starting with the most basic piston movement sound generation, by taking some educated guesses (I have zero experience with audio signal processing) I assumed I could generate the audio signal by using the piston velocity, which is calculated as derivative of piston position ((piston_position - previous_piston_position) / dt), the piston position is modulated by a bit of noise, to simulate the piston sliding along the cylinder walls.

So far so good, it seens to have a expected result, considering I haven't added any kind of audio processing steps, it's really simple and sounds like a piston movement. But it gets really loud as the engine speed increases, here is a demonstration of a simple v2 engine, I reduced the output signal to 10%, to avoid hearing damage. As you can see in the video, in the soundwave representation in the bottom-left, the signal goes beyond the [-1, 1] range.

So some question about piston movement audio signal generation:

  1. Is velocity input a good way to generate the piston movement audio signal?
  2. Is amplitude of the sound related by the piston frequency in real life? Shouldn't it have a constant amplitude, but with higher frequency?
  3. How I tweak the signal generation to have less amplitude at higher rpms? I should take sound propagation speed in the air into consideration?

I've tried using the piston position itself, but it sounds way more like a sine wave, the value oscilates between [0, top position] range, not [-1, 1] range, and it generates a constant non-zero signal when the piston isn't moving.

Another way to think of my problem: If I wanted to simulate the audio signal coming from a oscilating speaker, how I would generate the audio signal, taking into consideration only the speaker position? I would need to use the speaker velocity too?

ghsoares
  • 53
  • 2
  • 7

0 Answers0