mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-18 05:44:53 +00:00
Audio Docs: Adsr Decay Rate (#1238)
* Init adsr decay docs * cleanup * cleanup * Revert some docs * Cleaner docs * count hex to dec * scaled updates per frame * Consistency * Oops, fix meaning * Avoid `decayRate` conflict with reverb `decayRate` * PR suggestion
This commit is contained in:
parent
d39ce02458
commit
8f1fd58f22
5 changed files with 59 additions and 47 deletions
|
@ -125,7 +125,7 @@ void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput)
|
|||
}
|
||||
|
||||
void Audio_NoteInit(Note* note) {
|
||||
if (note->playbackState.parentLayer->adsr.releaseRate == 0) {
|
||||
if (note->playbackState.parentLayer->adsr.decayIndex == 0) {
|
||||
Audio_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->channel->adsr.envelope,
|
||||
¬e->playbackState.adsrVolScaleUnused);
|
||||
} else {
|
||||
|
@ -506,10 +506,10 @@ void Audio_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
|
|||
} else {
|
||||
note->playbackState.unk_04 = 1;
|
||||
note->playbackState.adsr.action.s.decay = true;
|
||||
if (layer->adsr.releaseRate == 0) {
|
||||
note->playbackState.adsr.fadeOutVel = gAudioContext.unk_3520[layer->channel->adsr.releaseRate];
|
||||
if (layer->adsr.decayIndex == 0) {
|
||||
note->playbackState.adsr.fadeOutVel = gAudioContext.adsrDecayTable[layer->channel->adsr.decayIndex];
|
||||
} else {
|
||||
note->playbackState.adsr.fadeOutVel = gAudioContext.unk_3520[layer->adsr.releaseRate];
|
||||
note->playbackState.adsr.fadeOutVel = gAudioContext.adsrDecayTable[layer->adsr.decayIndex];
|
||||
}
|
||||
note->playbackState.adsr.sustain =
|
||||
((f32)(s32)(layer->channel->adsr.sustain) * note->playbackState.adsr.current) / 256.0f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue