From 9ca1a1c1c7bf56e39b516c299b4e0d3efe59652b Mon Sep 17 00:00:00 2001
From: Alexander Kassouni ProgToVp is the only consumer of the instrument number, and it is a plain
-array index bounded by num_instruments. This is exactly why
-you (instrument 118) cannot work on bank 157's 83 instruments: the bounds
-check fails, audio_error_flags is set to
-0x03000000 + (prog << 8) + inst, and nothing plays — though in practice the
-sequence's dynamic table has already clamped the index before it gets there.num_instruments: on an out-of-range instrument the
+bounds check fails, audio_error_flags is set to
+0x03000000 + (prog << 8) + inst, and nothing plays. In retail data the
+guard never trips — each sequence's dynamic table only names instruments its own bank
+has. In particular you on bank 157 is not an error case: sequence 244 maps
+code 0x77 to instrument 82, the last instrument of the bank
+(see the disc page).
Every voice instrument uses only the normal slot, so NoteToVoice is a
formality here.
../extraction.md §2.2 guessed
+Field naming. Earlier working notes guessed
u8 loaded, rangeLo, rangeHi, releaseRate for the instrument header. The decomp
calls them is_relocated, normal_range_low,
normal_range_high, adsr_decay_idx. Same layout, and
@@ -213,9 +215,9 @@ calls them is_relocated, normal_range_low,
the file.
Decoding the VADPCM frames themselves is covered in ../extraction.md §2.3 —
-including the one easy mistake, which is convolving the decoded outputs instead of the
-scaled residuals.
Decoding the VADPCM frames themselves is covered on +the disc page — including the one easy mistake, which is +convolving the decoded outputs instead of the scaled residuals.