Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Support for frequencymultiplier in character sounds

Open TheNinjaScout opened this issue 1 year ago • 2 comments

Allows "frequencymultiplier" to have an effect on character sounds (idle,attack,damage,die,happy,unhappy)

The error that happens when the frequency value of a sound goes out of range now also states what the minimum and maximum acceptable values are.

Demonstration: https://youtu.be/fJ1g85Ce0Hg

(For the demonstration video, I edited all the crawlers' sounds to include a notable frequency multiplier)

  <sound file="Content/Characters/Crawler/CRAWLER_attack1.ogg" state="Attack" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_attack2.ogg" state="Attack" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_attack3.ogg" state="Attack" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_attack4.ogg" state="Attack" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_idle1.ogg" state="Idle" range="1000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_idle2.ogg" state="Idle" range="1000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_idle3.ogg" state="Idle" range="1000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_death1.ogg" state="Die" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_death2.ogg" state="Die" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_damage1.ogg" state="Damage" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_damage2.ogg" state="Damage" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>
  <sound file="Content/Characters/Crawler/CRAWLER_damage3.ogg" state="Damage" range="2000" volume="1" frequencymultiplier="0.26,1.8"/>

TheNinjaScout avatar Nov 06 '24 20:11 TheNinjaScout

You mean sound pitch?

SomeRandomNoobKekeke avatar Nov 06 '24 22:11 SomeRandomNoobKekeke

You mean sound pitch?

Yes

As of right now, sounds placed in status effects accept a parameter called "frequencymultiplier" which lets you write two numbers to specifiy the minimum and maximum pitch that the sound can randomly have (Or just one number to set the pitch to something other than default without making it random, like frequencymultiplier="0.8"). You can use frequencymultiplier to, for example, add some subtle pitch variation to make a sound less repetitive each time it plays by setting a value like frequencymultiplier="0.95,1.05"

This PR extends that functionality to character specific sounds (which are defined differently than status effect sounds and currently don't use frequencymultiplier parameter at all)

TheNinjaScout avatar Nov 06 '24 23:11 TheNinjaScout