pitch
pitch
gets/sets the pitch of the sound.
Return type: Float number.
Range: 0.5 to 2.0
Note:
Sound Actuator Pitch button:
Range: -12.0 to 12.0
If Sound Actuator Pitch button is set to 0.00:
getPitch() returns 1.00
If Sound Actuator Pitch button is set to 12.00:
getPitch() returns 2.0
If Sound Actuator Pitch button is set to -12.00:
getPitch() returns 0.5
Sample
Code
################## Get pitch
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named slam
act = controller.actuators["slam"]
# get current pitch
pitch = act.pitch
################## Set pitch
# get the controller
controller = GameLogic.getCurrentController()
# get the actuator attached to the controller named slam
act = controller.actuators["slam"]
# set current pitch
act.pitch = 1.0
|