tepples wrote:
GradualGames wrote:
If I allowed each to occupy a single 256 byte sequence
If all envelopes in the set have the same loop length, you can interleave them and see if that shrinks your RAM requirement.
What do you mean about loop length being the same?
What I'm thinking of doing is defining instruments like this:
instrument0:
.byte <vol_offset>,<pitch_offset>,<duty_offset>, <actual volume bytes>, <loop or stop opcode>, [optional loop point], <actual pitch bytes>, <loop or stop opcode>, [optional loop point], <actual duty bytes>, <loop or stop opcode>, [optional loop point], <actual arpeggio bytes>, <loop or stop opcode>, [optional loop point]
With this definition, I'll just be loading a 16 bit instrument address ONCE per channel, rather than loading a 16 bit address for EACH of the four envelope types. My hope is since the engine spends most of its time updating sequences that this could save a couple hundred cycles per frame. The constraint would be that all envelopes in use by any given instrument must all fit together in one 256 byte sequence. In actual practice, it seems like this should work. Really really long instruments that aren't long due to a loop point are pretty rare I think. Any extreme situations where it does need to be longer could just play a new note that starts where the last envelope leaves off...