Here are a few patches that use ILD (inter-aural level difference) and ITD (inter-aural time difference) for more realistic panning. Download here: 07-ILDpanning
1) This patch simply drops the ear most distant from sound (contra-lateral) by 12 dB relative to the ear closest to the sound (ipso-lateral). It uses cos and sin to turn azimuth into cartesian coordinates.
2) This second patch replaces the simple gain control with 2 cascaded lowpass filters at 1400Hz to simulate the filtering effect of the head on the contra-lateral ear. Your results may vary – a smaller head would require a higher frequency filter.
3) With the third panner we add ITD (inter-aural time difference). The difference is set at 1ms when the position is 90 degrees or 270 degrees. No difference when the sound is directly in front (0 degrees) or behind (180 degrees) the listener. Note that a quick change of azimuth can cause doppler effects due to the modulated delay time.