summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2022-06-05 05:29:01 +1000
committerGitHub <noreply@github.com>2022-06-04 15:29:01 -0400
commitbd4912a1bd62a4ac509e2dacd836708d527d7ad8 (patch)
tree35924c62bd71bc567a80cbeebae0829cccfd4330 /src/code
parent1a41694d58d436c3728ad627f1b018672a628ed1 (diff)
Cleanup NotePlaybackState (#1255)
* Audio Cleanup * more * missed one * Audio docs imported from MM * Suggestions from Discord * Small fix * Fix sizes in z64audio.h * numSamples * Cleanup comments * Revert overlap with soundFont PR * revert Audio_AdsrUpdate cleanup (move to different PR) * PR Suggestion * Mainly typos * PR suggestion, vol -> volume * Better description * Name sampling frequency * A good number of PR suggestions * Missed a suggestion * More PR Suggestions * Cleanup NotePlaybackState * one more * Add comments for new variable names * Reverb samplePosInt * Missed one * Remove `Always set to 0`
Diffstat (limited to 'src/code')
-rw-r--r--src/code/audio_effects.c12
-rw-r--r--src/code/audio_playback.c8
-rw-r--r--src/code/audio_synthesis.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/code/audio_effects.c b/src/code/audio_effects.c
index 84fde3a30..9a6d1884a 100644
--- a/src/code/audio_effects.c
+++ b/src/code/audio_effects.c
@@ -174,11 +174,11 @@ f32 Audio_GetVibratoFreqScale(VibratoState* vib) {
}
void Audio_NoteVibratoUpdate(Note* note) {
- if (note->portamento.mode != 0) {
- note->playbackState.portamentoFreqScale = Audio_GetPortamentoFreqScale(&note->portamento);
+ if (note->playbackState.portamento.mode != 0) {
+ note->playbackState.portamentoFreqScale = Audio_GetPortamentoFreqScale(&note->playbackState.portamento);
}
- if (note->vibratoState.active) {
- note->playbackState.vibratoFreqScale = Audio_GetVibratoFreqScale(&note->vibratoState);
+ if (note->playbackState.vibratoState.active) {
+ note->playbackState.vibratoFreqScale = Audio_GetVibratoFreqScale(&note->playbackState.vibratoState);
}
}
@@ -188,7 +188,7 @@ void Audio_NoteVibratoInit(Note* note) {
note->playbackState.vibratoFreqScale = 1.0f;
- vib = &note->vibratoState;
+ vib = &note->playbackState.vibratoState;
vib->active = 1;
vib->time = 0;
@@ -212,7 +212,7 @@ void Audio_NoteVibratoInit(Note* note) {
void Audio_NotePortamentoInit(Note* note) {
note->playbackState.portamentoFreqScale = 1.0f;
- note->portamento = note->playbackState.parentLayer->portamento;
+ note->playbackState.portamento = note->playbackState.parentLayer->portamento;
}
void Audio_AdsrInit(AdsrState* adsr, AdsrEnvelope* envelope, s16* volOut) {
diff --git a/src/code/audio_playback.c b/src/code/audio_playback.c
index fb9f77e81..02c9422d6 100644
--- a/src/code/audio_playback.c
+++ b/src/code/audio_playback.c
@@ -926,11 +926,11 @@ void Audio_NoteInitAll(void) {
note->playbackState.attributes.velocity = 0.0f;
note->playbackState.adsrVolScaleUnused = 0;
note->playbackState.adsr.action.asByte = 0;
- note->vibratoState.active = 0;
- note->portamento.cur = 0;
- note->portamento.speed = 0;
+ note->playbackState.vibratoState.active = 0;
+ note->playbackState.portamento.cur = 0;
+ note->playbackState.portamento.speed = 0;
note->playbackState.stereoHeadsetEffects = false;
- note->unk_BC = 0;
+ note->startSamplePos = 0;
note->synthesisState.synthesisBuffers = AudioHeap_AllocDmaMemory(&gAudioContext.miscPool, 0x1E0);
}
}
diff --git a/src/code/audio_synthesis.c b/src/code/audio_synthesis.c
index 58135c335..d50d1f4d4 100644
--- a/src/code/audio_synthesis.c
+++ b/src/code/audio_synthesis.c
@@ -745,7 +745,7 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSubEu, NoteSynthesisS
if (noteSubEu->bitField0.needsInit == true) {
flags = A_INIT;
synthState->restart = 0;
- synthState->samplePosInt = note->unk_BC;
+ synthState->samplePosInt = note->startSamplePos;
synthState->samplePosFrac = 0;
synthState->curVolLeft = 0;
synthState->curVolRight = 0;