Here's his script as copy & pasteable text
; add_patch.cal
;
; Set patch for selection of notes or existing patches
;
(do
(int adjval 1)
(int new_bank 1) ; New Bank Number
(int new_patch 1)
(getInt new_patch "New Patch Number: " 0 126 )
)
;; Body
(do
(if (== Event.Kind NOTE)
(insert (- Event.Time 5) Event.Chan PATCH new_patch new_bank)
(if (== Event.Kind PATCH) (do
(delete)
(insert Event.Time Event.Chan PATCH new_patch new_bank)
)
)
)
)
It does have a nice replace the patch change feature which is kind of handy. Might be able to expand it a bit to handle the early offset so it can work at 0.