Ken has already explained how it goes.
I just can add M-Audio Code specific info:
* it has 2 modes (switchable on the fly, also per control group), MackieControl and MIDI
* MackieControl is fixed, not really documented, layout which imitates Mackie. With my mod of MackieControl (more stable) or Mackie preset in AZ Controller (almost untested but freely re-configurable) you can get normal set of mixing functions in no time. Just aware that stock MackieControl supplied with Sonar will not work.
* MIDI mode layout is configurable with M-Audio editor. You will need to create your own preset, but you can define you own needs specific configurations, f.e. with a kind of "macro" sequences (AZ Controller can send arbitrary computer keyboard shortcuts), specific tracks / effects parameters hardcoded mappings, etc.
For meltdown on stage... I provide no warranty of any kind. I recommend to test any function before using it on stage, I mean "last minutes" changes in the configuration can be looking for troubles. There are several Control Surface related inconsistencies in Sonar which are easy to overseen in a hurry (all known by me problematic points are documented on my site, what is know to produce Sonar crashes is workaround-ed, still there can be something I have not noticed so far).