Sound pitch: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
New page: Changes the pitch of all sounds for the specified player. Negative values lower pitch, positive values raise pitch. Pitch will remain altered, even if a new game is started, until sound_...
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Changes the pitch of all sounds for the specified player.  Negative values lower pitch, positive values raise pitch.  Pitch will remain altered, even if a new game is started, until sound_pitch is set back to 0.  Note that sound_pitch will not affect the pitch of sounds already being played (so a looping sound will not be altered until the next time it starts).
Changes the pitch of all sounds for the specified player.  The pitch is measured in cents (1/100 of a semitone); negative values lower pitch, positive values raise pitch.  Pitch will remain altered, even if a new game is started, until sound_pitch is set back to 0.  Note that sound_pitch will not affect the pitch of sounds already being played (so a looping sound will not be altered until the next time it starts).


Example:
Example:
Line 6: Line 6:


...will lower the pitch of sounds as if the player were underwater.
...will lower the pitch of sounds as if the player were underwater.
If you want to manipulate the pitch of a specific sound dynamically, change this parameter before producing the [[sound]] and restore its original value thereafter:
  getplayer[THISACTOR].sound_pitch temp
  setplayer[THISACTOR].sound_pitch -1024
  sound BOS4_ATTACK
  setplayer[THISACTOR].sound_pitch temp
[[Category:Player structure members]]

Latest revision as of 03:30, 8 May 2011

Changes the pitch of all sounds for the specified player. The pitch is measured in cents (1/100 of a semitone); negative values lower pitch, positive values raise pitch. Pitch will remain altered, even if a new game is started, until sound_pitch is set back to 0. Note that sound_pitch will not affect the pitch of sounds already being played (so a looping sound will not be altered until the next time it starts).

Example:

  setplayer[THISACTOR].sound_pitch -1024

...will lower the pitch of sounds as if the player were underwater.

If you want to manipulate the pitch of a specific sound dynamically, change this parameter before producing the sound and restore its original value thereafter:

  getplayer[THISACTOR].sound_pitch temp
  setplayer[THISACTOR].sound_pitch -1024
  sound BOS4_ATTACK
  setplayer[THISACTOR].sound_pitch temp