sm64pc/src/audio/effects.h

45 lines
1.2 KiB
C
Raw Normal View History

2019-12-02 02:52:53 +00:00
#ifndef AUDIO_EFFECTS_H
#define AUDIO_EFFECTS_H
2019-08-25 04:46:40 +00:00
#include "internal.h"
2019-12-02 02:52:53 +00:00
#include "platform_info.h"
2019-08-25 04:46:40 +00:00
#define ADSR_STATE_DISABLED 0
#define ADSR_STATE_INITIAL 1
#define ADSR_STATE_START_LOOP 2
#define ADSR_STATE_LOOP 3
#define ADSR_STATE_FADE 4
#define ADSR_STATE_HANG 5
#define ADSR_STATE_DECAY 6
#define ADSR_STATE_RELEASE 7
#define ADSR_STATE_SUSTAIN 8
#define ADSR_ACTION_RELEASE 0x10
#define ADSR_ACTION_DECAY 0x20
#define ADSR_ACTION_HANG 0x40
#define ADSR_DISABLE 0
#define ADSR_HANG -1
#define ADSR_GOTO -2
#define ADSR_RESTART -3
2019-12-02 02:52:53 +00:00
// Envelopes are always stored as big endian, to match sequence files which are
// byte blobs and can embed envelopes. Hence this byteswapping macro.
#if IS_BIG_ENDIAN
#define BSWAP16(x) (x)
#else
#define BSWAP16(x) (((x) & 0xff) << 8 | (((x) >> 8) & 0xff))
#endif
2019-08-25 04:46:40 +00:00
void sequence_player_process_sound(struct SequencePlayer *seqPlayer);
void note_vibrato_update(struct Note *note);
void note_vibrato_init(struct Note *note);
void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, s16 *volOut);
2020-02-03 05:51:26 +00:00
#ifdef VERSION_EU
f32 adsr_update(struct AdsrState *adsr);
#else
2019-08-25 04:46:40 +00:00
s32 adsr_update(struct AdsrState *adsr);
2020-02-03 05:51:26 +00:00
#endif
2019-08-25 04:46:40 +00:00
2019-12-02 02:52:53 +00:00
#endif /* AUDIO_EFFECTS_H */