How to change the pitch of a sound?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
Get Phobo
Posts: 113
Joined: Fri Sep 07, 2018 8:30 am

How to change the pitch of a sound?

Post by Get Phobo »

I would like to make higher-pitched versions of some vanilla sounds for my WIP Doom Offspring mod using code, if possible.

How do I do this? Is it possible at all? I want to set a fixed pitch value, not specify a randomization range (I know how to do that).

Like, Mr. Baron has a son, and his son's voice has twice the pitch, so it sounds a lot higher.
User avatar
Cherno
Posts: 1321
Joined: Tue Dec 06, 2016 11:25 am

Re: How to change the pitch of a sound?

Post by Cherno »

viewtopic.php?f=3&t=21739

Using $pitchshiftrange <range> , then declaring the higher-pitched sound, then inserting $pitchshiftrange <range> again with a normal pitch value for all the sounds after that should do the trick in theory :]
User avatar
Get Phobo
Posts: 113
Joined: Fri Sep 07, 2018 8:30 am

Re: How to change the pitch of a sound?

Post by Get Phobo »

Okay, but this sets a range for random alteration, which is exactly what I do not want. I just want to set a fixed pitch for a specific sound, like 2.0 to make it twice the normal pitch.
User avatar
Cherno
Posts: 1321
Joined: Tue Dec 06, 2016 11:25 am

Re: How to change the pitch of a sound?

Post by Cherno »

The idea was to use a range that leaves no room for variation like 2.0 - 2.0. However, I never used ranged in zDoom so I'm noz sure how to delcare them.
User avatar
Get Phobo
Posts: 113
Joined: Fri Sep 07, 2018 8:30 am

Re: How to change the pitch of a sound?

Post by Get Phobo »

Well, I will try that and see what it gives. Thanks.
User avatar
Get Phobo
Posts: 113
Joined: Fri Sep 07, 2018 8:30 am

Re: How to change the pitch of a sound?

Post by Get Phobo »

It doesn't seem to work. I've tried this code in SNDINFO.txt:

Code: Select all

$pitchshiftrange  7
yknight/sight dskntsit
yknight/active dsdmnact
yknight/pain dsdmnpn
yknight/death dskntdth
$pitchshift yknight/sight 7
$pitchshift yknight/active 7
$pitchshift yknight/pain 7
$pitchshift yknight/death 7
$pitchshiftrange 0
Setting randomized pitches to either on or off will override any definitions, it seems.

Return to “Assets (and other stuff)”