Making an engine sound that changes pitch with speed

TobyToby Member Posts: 478
Has anyone covered this? Can't find anything in the forums.

Making a car game... (My second game) Elerium 115 is pretty much finished - hoping some GS engine performance improvements will be along shortly :) with the next update.

However....

As my car increases in speed I want the engine sound to increase in pitch with the game attribute 'speed'. This is not volume, pitch refers to the note or sound.

Cant see any attributes other than Volume?

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    It's kind of a work around, but you could have 3 sound files, normal pitch, elevated pitch and top speed pitch, then have it switch depending on the vehicles speed.

    if speed < 100
    play slow.ogg

    if speed >100 & < 200
    play medium.ogg

    if speed > 200
    play fast.ogg

    something like that anyway
  • quantumsheepquantumsheep Member Posts: 8,188
    There's an expression editor in the 'Play Sound' behaviour. Surely you could work out some sort of equation?

    The max pitch it can play at numerically is, I think, 1.

    So maybe create a number that's related to your speed variable and outputs numbers below 1.

    For example, when your speed is say '50', you would want to get the number .5

    So the expression you put into the pitch box would be speed variable/100

    Does that make sense?
Sign In or Register to comment.