I'm messing around with sounds this morning and wanting to get my 'flight' audio worked out. Specifically, I'm trying to replicate how the flight audio works
as heard here.
As the ship in Zaxxon gains and loses altitude, the pitch of the flight audio rises and falls. Player information / feedback-wise, this is super important and is something I absolutely want in my own game.
I've grabbed a
bfxr sample and placed the following code in my obj_player's Create Event
Code:
Flying = audio_play_sound(sou_fly1,1,true)
And in the Step Event
Code:
FlyPitch = Altitude / 15
audio_sound_pitch(Flying, FlyPitch)
(since Altitude ranges from 0-75, this reduces that down to a 0-5 range)
However it's not working as I'd expected, which may simply be because I'm no musician / audio engineer and maybe my understanding of 'pitch' is screwy.
In addition to making the audio sound 'higher' or 'lower', the change in audio_sound_pitch() also seems to be adjusting the frequency of the audio loop, faster and slower, such that low Altitudes sound like a slow Giant's footsteps (
kuuusssh... kuuusssh... kuuusssh...), where high Altitudes sound like a tinny helicopter (
ktch!-ktch!-ktch!-ktch!-ktch!-ktch!-ktch!-).
Is that proper behaviour for audio_sound-pitch()? Any thoughts, code-wise, on how to achieve the pitch shift I'm after, or is my code okay, in theory at least?
The second issue I'm having, though this is perhaps one I simply need to spend some time fiddling with, is making a 'flat' sound in bfxr such that it loops cleanly. Every single sample I've made has some 'curve' to it, making the loop super obvious. Are there any tricks to making a completely uniform 'crunchy' sample in bfxr, similar to the flight sound in that Zaxxon video posted above.
EDIT : made a couple of improvements,
First I adjusted the Step code to
Code:
FlyPitch = 0.3 + (Altitude / 200)
audio_sound_pitch(Flying, FlyPitch)
Giving a *much* lower range for FlyPitch, which has certainly helped a little. The distance between the min and max Altitude points feels roughly where it needs to be now.
To try and get a 'flat' bfxr sample, I took the flattest sounding .wav I had, and pushed it into Audacity (which I'm mostly unfamiliar with). I found the most uniform looking part of the waveform and just cropped the sample down to something like a tenth of a second, saved and put it into GM.
It actually got rid of the frequency issue for the most part (or made it much less apparent), but the few attempts I've made all, without fail, now sound like motorbikes. Excellent motorbike sounds! But sadly not what I'm after. So yeah, still trying to figure out how to make that nice flat, crunchy, static-ey audio loop.
EDIT2: ha, the more I fiddle with this, the more I suspect it's not an "ask the forum experts for help" thing, but that it's just a science of sound problem and that I need to take the time to figure out the correct sample. I'm pretty sure my code is fine and everything's working as it should, I'm just using poorly chosen audio.