I found that his CAL added more Pan events than necessary, and didn't really give the synth any time to respond to the pan message before the note event - maybe not a problem for soft synths, but could be an issue with hardware synths.
FWIW, below is a revised version that inserts only one message per note, and inserts it 30 ticks
before each note. I didn't take time to make this 'lead time' user-specified or to automatically insert a message at 1:01:000 when the first note event is less than 30 ticks in. As noted in the CAL description, setting the Pan widget in the MIDI track will suffice to establish the initial position.
I have not 'bomb-proofed' this this script to avoid failure or bad results with unexpected input (e.g. chords) or to make it as efficient as possible so I can't make any guarantees of efficacy in all cases, but here it is:
;NotePan.CAL by David Baay, modified significantly from the original by Alisa Miller
;
; This CAL script will insert alternating Pan (CC10) events 30 ticks before each note event at 1:01:030 or later.
; If any notes occur before 1:01:030, the Track Pan should be set to the value equal to the left pan setting that you
; intend to set using the CAL to set the initial pan position before playback starts.
;
(do
(int count 0)
(int left 0)
(int right 127)
(int position 127)
;
;Get Min and Max Pan values to determine Pan changes
(getInt left "Enter the left pan amount" 0 64)
(getInt right "Enter the right pan amount" 64 127)
(= position right)
(forEachEvent
(if (&& (>= Event.Time 30) (== Event.Kind NOTE))
(do
(insert (- Event.Time 30) Event.Chan CONTROL 10 (= Control.Val position))
(if (<= position 64)
(= position right)
(= position left); else
);end if
);end do
); end if
); end for
); end do