1#ifndef COASTLINE_SOUND_MIX_H
2#define COASTLINE_SOUND_MIX_H
10#define SAMPLE_RATE 11000.0f
11#define STEP_ONE 4294967296.0
25 return scaled >= -0x1p63L && scaled < 0x1p63L ? (
u64)(
s64)scaled : ((
u64)1 << 63);
33 return (
f32)((
s32)((
f32)volume * upper) << 16);
39 long double upperProduct = (
long double)volume * upper;
40 long double lowerProduct = (
long double)volume * lower;
41 u32 upperWord = upperProduct >= -0x1p63L && upperProduct < 0x1p63L ? (
u32)(
s64)upperProduct : 0;
42 u32 lowerWord = lowerProduct >= -0x1p63L && lowerProduct < 0x1p63L ? (
u32)(
s64)lowerProduct : 0;
43 return (upperWord << 16) + lowerWord;
#define SAMPLE_RATE
Definition soundmix.h:10
#define STEP_ONE
Definition soundmix.h:11
static u64 FrequencyStep(SoundReal frequency)
Definition soundmix.h:22
f32 SoundReal
The precision used for Nintendo 64 sound-mixing calculations.
Definition soundmix.h:18
static f32 UpperVolume(s32 volume, f32 upper)
Definition soundmix.h:32
static u32 PackVolume(s32 volume, f32 upper, f32 lower)
Definition soundmix.h:37
The integer and floating-point types of the console, for headers shared with Windows.
unsigned int u32
Definition ultratypes.h:20
float f32
Definition ultratypes.h:38
long long s64
Definition ultratypes.h:26
int s32
Definition ultratypes.h:25
unsigned long long u64
Definition ultratypes.h:21