[Added] Set pitch of a playing sound

Moderator: GZDoom Developers

Set pitch of a playing sound

Postby D2JK » Sun Mar 10, 2019 9:34 am

Similar to A_SoundVolume, but this would modify the pitch instead, and perhaps have slightly extended functionality.

My use case would be a chaingun where the spin rate can change based on user inputs, but not instantaneously; the spin rate would settle on a new speed over a brief period. This new function would then be used to constantly match the pitch of the looping electric motor sound effect with the visual spin rate. Doing this manually with the existing functions would be very cumbersome and laborous, I think.

Another, more common use case would be a car engine sound, where you would be constantly evaluating the engine revolutions, matching the pitch of the looping sound accordingly.

Probably a "nice to have" addition to this function would be pitch change interpolation, because the more the pitch instantly changes, the more noticable and jarring the change sounds. So perhaps as a function parameter, you could set the time period in tics or seconds, over which the change in pitch should complete? Or perhaps you could set a hard limit X for the pitch change rate, so that the pitch could not change by more than X per tic (or second).
D2JK
 
Joined: 30 Aug 2014

Re: Set pitch of a playing sound

Postby D2JK » Thu Jul 25, 2019 11:05 am

The pitch controlling functionality has been recently added.

The latter part of the request (interpolated pitch changes) probably still stands, though I have to test this new addition to find out if it's actually a necessary feature. But I assume attempting to manually interpolate pitch changes by dividing the change over a range of tics, and progressively modifying the pitch each tic (which should be the finest control possible for the modder), will still produce discernible "steps" in the heard pitch. And manually doing this between the individual tics isn't possible at all.
D2JK
 
Joined: 30 Aug 2014

Re: Set pitch of a playing sound

Postby Major Cooke » Thu Jul 25, 2019 2:56 pm

Correct. You cannot adjust the pitch between tics. That's not going to be possible. Sorry.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Set pitch of a playing sound

Postby Graf Zahl » Sun Jan 12, 2020 4:57 am

This got added in the mean time.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest