views:

447

answers:

3

I'm working on a "retro" motorbike game in flash, similar to the Road rash series on the mega drive and after having a long play with the sound sampling capabilities of flash I can't manage to find the "right" way to generate the noise.

I've been trying to basically change the frequency on a sine wave in line with the revs, so as the revs increase so does the frequency - it sorta works but sounds nothing like a real engine (I've been a biker for a while and I ride to work on my bike every day so I "know" what it should sound like :-p).

I'm not so much after a realistic sound, just somthing that sounds "okay", or good enough that most people playing the game wouldn't notice and be happy that the sound actually relates to the revs and speed as apposed to just a flat mp3.

I can't seem to search on google as I can't find the right words, "engine" just dilutes all of the results with game engines and what not.

The majority of articles I find also suggest using sampling - but there are 2 major issues with this:

  • Even though I have a bike and could record the sounds; recording samples of the rpm - say 15 if I do samples at 1000 intervals (my gsxr revs all the way to 16k :-p) I'd then have to also sample each one at various loads, i.e. 0mph, 10mph, 20mph, 30mph, 40mph as the engine noise varies greatly depending on load - which totals a whopping 80 samples - although I'm not sure if the load can be simulated somehow on top of the rpm samples?
  • All those samples add up to bytes that have to be downloaded before you can play.

Cheers, Chris

+2  A: 

One way I've found uses a mix of sampled engine sounds and synthesized tones. Get samples of an engine at a couple of different RPMs and use those for the base. Mix two samples based on the current RPM, e.g. if it's 1650 RPM, play a sample taken at 1500 RPM at 70% volume and a 2000 RPM sample at 30% volume. Modify the overall volume based on the throttle. Add a sine wave tone based on the RPM like you've done.

The technique is described in the paper Design of a Driving Simulation Sound Engine (PDF), which is about synthesizing engine (and other driving-related sounds) for a driving simulator. I found it by searching for sound synthesis "engine sound" (with "engine sound" in quotes. Motor sound effect synthesis has some discussion of synthesizing motor sounds in general, with instructions for the Pure Data environment.

Selene
+1  A: 

Sonoflash have a library of code-based sounds (some for free), and may have something appropriate for you, or at least a starting point. Their 'machine propeller', for example.

IanT
actually the drill one is perfect :-p Thanks!
widgisoft
A: 

I've tried Sonoflash as well, it's really good!

http://www.sonoflash.com/sounds/#EngineLight

This might be a sound you are looking out for.

audiosapien