Here's an abstraction inspired by hamster's recent post (http://puredata.hurleur.com/sujet-4261-midi-learnable-mixer-channel).
It adds learned MIDI control to your patches. Learned MIDI settings may then be saved in a text file for loading later. You can create as many control objects as you need, and all settings will be saved to a single text file. Works with both control and note MIDI values.
(note, saved settings do not include current control values, just the learned channel and control/note numbers)
It's called bb_learn and can be downloaded here:
http://bitsynthesis.com/pd/