Mario Kart 64
Loading...
Searching...
No Matches
effects.h
Go to the documentation of this file.
1#ifndef AUDIO_EFFECTS_H
2#define AUDIO_EFFECTS_H
3
4#include "audio/internal.h"
5
6#ifdef TARGET_N64
7#define IS_BIG_ENDIAN 1
8#endif
9
10#define ADSR_STATE_DISABLED 0
11#define ADSR_STATE_INITIAL 1
12#define ADSR_STATE_START_LOOP 2
13#define ADSR_STATE_LOOP 3
14#define ADSR_STATE_FADE 4
15#define ADSR_STATE_HANG 5
16#define ADSR_STATE_DECAY 6
17#define ADSR_STATE_RELEASE 7
18#define ADSR_STATE_SUSTAIN 8
19
20#define ADSR_ACTION_RELEASE 0x10
21#define ADSR_ACTION_DECAY 0x20
22#define ADSR_ACTION_HANG 0x40
23
24#define ADSR_DISABLE 0
25#define ADSR_HANG -1
26#define ADSR_GOTO -2
27#define ADSR_RESTART -3
28
29// Envelopes are always stored as big endian, to match sequence files which are
30// byte blobs and can embed envelopes. Hence this byteswapping macro.
31#if IS_BIG_ENDIAN
32#define BSWAP16(x) (x)
33#else
34#define BSWAP16(x) (((x) & 0xff) << 8 | (((x) >> 8) & 0xff))
35#endif
36
37void sequence_channel_process_sound(struct SequenceChannel* seqChannel, s32 recalculateVolume);
38void sequence_player_process_sound(struct SequencePlayer* seqPlayer);
42void note_vibrato_update(struct Note* note);
43void note_vibrato_init(struct Note* note);
44void adsr_init(struct AdsrState* adsr, struct AdsrEnvelope* envelope, s16* volOut);
45f32 adsr_update(struct AdsrState* adsr);
46
47#endif /* AUDIO_EFFECTS_H */
void note_vibrato_init(struct Note *note)
Definition effects.c:166
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, s16 *volOut)
f32 adsr_update(struct AdsrState *adsr)
Definition effects.c:206
f32 get_portamento_freq_scale(struct Portamento *p)
Definition effects.c:86
s16 get_vibrato_pitch_change(struct VibratoState *vib)
Definition effects.c:101
f32 get_vibrato_freq_scale(struct VibratoState *vib)
Definition effects.c:108
void note_vibrato_update(struct Note *note)
Definition effects.c:157
void sequence_player_process_sound(struct SequencePlayer *seqPlayer)
Definition effects.c:50
void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 recalculateVolume)
Definition effects.c:10
Definition internal.h:113
Definition internal.h:237
Definition internal.h:433
Definition internal.h:106
Definition internal.h:285
Definition internal.h:186
Definition internal.h:90
signed int s32
Definition ultratypes.h:15
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:34