Moderator: GZDoom Developers
pitch = desired_frequency / original_frequency
GAA1992 wrote:(somehow it logged out and i created the thread, but anyway)
I knew it would be hard to explain. But what i want to do is to set the exact pitch, or control the exact variation of the pitch to a certain sound instead of typing "$pitchshift misc/teleport 3", for example.
Think the sound "DSTELEPT" or whatever the Doom teleport sound is called. It's in the key of #F. limiting "misc/teleport" with "3" plays keys below and above #F as far as i know. What if i want it to shift pitch to only lower values than #F, or, get Cherno's example of a car engine sound always going up according to speed.
Chris wrote:GAA1992 wrote:(somehow it logged out and i created the thread, but anyway)
I knew it would be hard to explain. But what i want to do is to set the exact pitch, or control the exact variation of the pitch to a certain sound instead of typing "$pitchshift misc/teleport 3", for example.
Think the sound "DSTELEPT" or whatever the Doom teleport sound is called. It's in the key of #F. limiting "misc/teleport" with "3" plays keys below and above #F as far as i know. What if i want it to shift pitch to only lower values than #F, or, get Cherno's example of a car engine sound always going up according to speed.
Ah. Well, controlling the particular key/tone a sound plays at is unlikely, since it would depend on analyzing the sound to find the dominant frequency to know how much to shift for a given desired key (and then deal with inevitable ambiguities). Although, other than potential compatibility issues, I see no technical reason why you couldn't have more control over the upper and lower randomized limit. For example, setting a range of 0.5-1.0 so it won't randomly play less than half or more than normal. Graf or someone else would have to comment on whether that could be made available via A_PlaySound[Ex] or SNDINFO or something without breaking compatibility.
Note, however, that the snd_pitched CVAR currently controls whether any pitch shifting is done. If snd_pitched is false, no pitch shift is applied to sounds (except when underwater, where there's a fixed base of 0.7937 instead of 1.0). If you rely on different pitches for the same sound, that CVAR will need reconsideration.
Major Cooke wrote:But would it be possible to introduce a function that also changes the pitch? I've always wanted to replicate the ability to shift a pitch mid-playing like Battlezone's MAG Cannon does (raises the pitch + speed of the audio the bigger the charge).
Return to Closed Feature Suggestions
Users browsing this forum: No registered users and 2 guests