Changes
PSG
,/* Algorithm */
direction *= -1
volume += direction
else: # direction unchangedshape == 8 or shape == 12 volume &= 0x0f # direction is unchanged
return volume, direction