rogeriodec
Right. I know Python. Do you know how to communicate Python With CbB?
The short answer, for all practical purposes is, you can't.
There are currently two ways of communicating with Sonar/CbB:
1. As an Audio VST or MIDI VST (e.g. AzLua is implemented as a MIDI VST)
2. As a custom control surface through the ControlSurface API.
For what I think you want it for (i.e. manipulating MIDI data), AzLua is about as close as you'll get to having MIDI control outside CAL, but in the end it's just a MIDI effect, so you'll have to live with the limitations of what a MIDI effect can do.
Outwith the usual control surface operations, the most the control surface API can do is invoke key shortcuts and menu commands - basically anything you could assign a hardware function key to. But manipulating MIDI data at the event level, it can't do. Also, unlike CAL, none of the cakewalk "commands" are parameterised, so many of them will use default parameters or pop-up a dialog.
What the control surface API can do however, is run CAL scripts. So in theory, you could programmatically translate parts of the LUA/Python script into a temporary CAL file, then run that in the background.
Getting information out of the CAL program is tricky though... My thoughts around this were that since the control surface DLL is already loaded, invoking a CAL DLL command on the same DLL to store any results would allow the results to be available to the rest of the LUA/Python script.
Doing any of this is a huge job though, as you'd basically have to:
1. Write a completely new Control Surface DLL
2. Embed Python or LUA into the DLL
3. Find some way of overriding/implementing new Python/LUA functions to call the Cakewalk API functions
4. For any loops, translate them to CAL
5. Deal with all the parameter passing / external file creating & locking / DLL loading & unloading issues.
None of the above is trivial.
So unless BandLab provide a new API (or extend the Control Surface API) to allow direct access to the track/clip data, and extend the command invoking to allow parameters, I doubt if anyone would want to take this on.