SND_CalcTimer

Syntax

#include <nitro/snd.h>
u16 SND_CalcTimer( int orgTimer, int pitch );

Arguments

orgTimer The original timer value.
pitch The pitch-change value.

Return Values

The timer value after pitch conversion.

Description

Calculates the timer value after pitch conversion.

When the pitch-conversion value pitch is a positive number, the timer cycle speeds up. When it is negative, the time cycle slows down. Pitch changes by exactly a half-tone when value is set to 64. In other words, timer frequency = 2 ** ( 1 / 12 ) tone.

The calculation is performed using the following equation:

orgTimer ÷ (2 ** ( pitch / ( 64 × 12 ) ) )

See Also

None.

Revision History

2004/07/20 Initial version.


CONFIDENTIAL