Here is some example PD paches for controlling MB? via midi. A simple setup for doing this is to run PD in parallell with MB? using a loopback midi-cable connecting PD output to Mb input. You'll need a midi-interface with at least 2 different midi ports like the Midiman midisport 2x2 usb.
Patches: