Calculate the multi-channel panning in a separate function