N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
Mus - Mus Library
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

Mus Library Reference

## MusHandleSetTempo()

Set the tempo scale value using a sound handle.

Syntax

      void MusHandleSetTempo(musHandle handle, int tempo);

Arguments

- handle is the sound handle

- tempo is the tempo offset value

Explanation
Set the tempo scale value for the channels associated with the specified sound handle. This function allows the programmer to speed up or slow down songs and sound effects relevant to the defined song speed or the default sound effect speed.

The handle must be a sound handle returned by MusStartSong(), MusStartEffect() or MusStartEffect2(). If an handle of zero is supplied, this function will always return zero.

The tempo value should be within the range of 0 to 0x100 (256), with this range representing 0% to 200% of the value defined in the original sound data. The default tempo scale value for all channels is 0x80 (100%).

Return Value
Number of channels which have been changed.

Example

      void SongSpeedFromBossHealth(unsigned long handle, int health)
      {
        /* health In range 0-32767 */
        health = (32767 - health)>>9;
        MusHandleSetTempo(handle, health + 128);
      }

See Also
MusStartSong()
MusStartEffect()
MusStartEffect2()

Nintendo® Confidential Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.
Copyright © 1998-1999
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1999