I'm sure this sort of thing has been done many times before, however I've just made this today to assist with coding for Bhoreal (like a monome) and Livid Instruments Base controllers. Hope its useful to someone else. I'll post the full abstractions for the controllers as and when I've made them.
This abstraction allows you to simply map controllers using one of these objects per note number. Inlet 1 is the note number, inlet 2 toggles whether velocity is derived from the controller or set in the patch in which case inlet 3 is the velocity amount. Outlet 1 is note on, outlet 2 is velocity and outlet 3 is control data (where applicable). The controller number matches the midi number (for aftertouch where applicable). You will likely want to loadbang at least the note number of each iteration of this abstraction in your patch.