On other words, we have:
volume = 0 if attack else 15 # Start at 0 for attack, 15 for decay direction = 1 if attack else -1 # Upward for attack, downward for decay
When using the volume envelope generator, the volume is always increased from 00h to 0Fh (or vice versa), it is not possible to specify a starting/ending point (like from 00h to 07h).