AZ Controller plug-in for Cakewalk SONAR => Tutorials => Topic started by: azslow3 on December 03, 2014, 09:40:50 PM

Title: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 03, 2014, 09:40:50 PM

Some mystery surround Control Surfaces. Producers of that type of devices have a good reason for that: more mystery means more money. Some Control Surfaces looks like Digital Mixers, and with a bit of "smoke" they can be sold like something equally valuable. The fact is: while controls and the body look the same, instead of preamps and DSPs inside you can find one (cheap) chip with USB/MIDI interface. This chip has near nothing to do, everything your Control Surface does is happening in software within the DAW.

The marked is flooded with cheap MIDI controllers. Some of them have complete documentation what they do. Also DAWs have some support for them, from as simple as "Assign MIDI" to more complex like "ACT MIDI". But all that is more or less transparent for users, they see that the hardware part is "simple".

So hardware producers have started to use a trick: they hide the way the information is sent, put some fancy labels on "dedicated buttons" (hardware is still the same) and call the result "Ultra/Super/Hyper/Human/Logic" Control. Once they have written a nice (sometimes not) peace of software, they claim "Deep/Tight/Special" Integration with DAW. One table with two columns and 20 rows for 10-20 most rated VSTs and they can already write "Auto/Seamless" mapping.

In the following I am going to show how (always!) simple input from Control Surface can produce so "deep integrated" results within DAW. I will go step by step filling "small gap" between "smart" Control Surface speaking "complete/complicated/magical" Mack.. Logic Control Protocol and CakeWalk SONAR DAW.

Please do not understand me wrong. Good Control Surface has its value! Faders, encoders, buttons, displays can be horrible or perfect. The body, layout and design are also important and can be pricey. But the rest... when it comes to what your computer receives from these devices there is no difference between cheapest possible applet on your phone and $Xk surface.

And please do not underestimate the software component. While AZ Controller is "free" ~100kB plug-in with old style interface, it is compiled from ~20000 lines of handwritten lines in C, implementing an interpreter of specially invented for the purpose visual scripting language plus IDE (Integrated Development Environment).  You can imagine what that can cost if developed on commercial basis.
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 03, 2014, 10:53:39 PM
Quick start

Insert AZ Controller into the list of Control Surfaces, attach input (and output!) of your MC (compatible) device to it, visit "Options" tab, click on "Tweak current configuration" and select "Mack.. control". Do not forget to remove the original Mack.. Control plug-in(s) from the list.

Go to the "Overview" Tab. In case you see "Device (Online)" there, the plug-in has recognized your controller. You can try to use it and please report any bugs you spot and everything you do not like. And you can skip the rest of this topic.

If you see "Device (Offline)", your device was not recognized as MC. Try to switch off the device and switch it on again. If you still have no luck, check that it is recognized by the original plug-in (unlikely). With other plug-ins it is time to shout "It does not work...". But AZC is fully configurable so most probably you can make it work with your device.


I do not have real Logic Control. Neither I have some other compatible device. But thanks to Humatic (, everyone with Android phone/tablet can taste how that works. Sure, touch screen is nothing in comparison with well made hardware. But the price is nice and it takes no extra space.

If you want to follow the text and configure AZ Controller (AZC) yourself, please read the manual and ACT MIDI Explained tutorial first. In this text I assume you already know how to define Software State Sets, Hardware and Logical Controls and add Actions with Conditions. There will be step by step but not "click by click" instructions.

I also assume that you have got your Device  (Dev) (TouchDAW or whatever LC/MCU compatible) somehow working with sonar. Solving problems with connections and MIDI configuration in SONAR is not the topic here. In case you already have some other Control Surface (CS) plug-in configured for your Dev, please detach it. Two plug-ins for one device will not work (it sometimes make sense for ACT MIDI/Generic Surface combination, but not for Mack..).

First of all, AZC support complete Logic Control (LC) MIDI specification. It understand what LC "say" and can send everything LC understand. In case you already have AZC in sonar with Dev connected and you press/move/turn controls, you just can see something changing in the "Last MIDI Event". But SONAR keep silence, no fader movements, no transport changes and Dev display is empty.

May be your slowly start to think: "this man tries to fool me, hi DOES NOT support LC! At least "Play" button should work! My device/program speaks Mighty Protocol, it is not plain MIDI!". Sorry to say, but your device is plain MIDI. "Play" button sends "Note 94 with Velocity 127 is pressed". The Mighty Protocol just define that "Note 94 with Velocity 127" is sent when the "Play" button is pressed. No more, no less. Are you confused? I hope not  ;)
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 04, 2014, 07:33:24 PM

LC protocol is bidirectional. It defines some "greeting ceremony" procedure. I can only speculate for what it is good, but let say the intention was to let the device know we understand with what we are working and check that the device is there (and not just to show respect to the producer of the device and make everything incompatible). Some devices (like TouchDAW) do not require this procedure, but I still prefer to do this for the first guessed reason: we can be sure the device is connected and ready (quite important for TouchDAW since it is just an applet communicating throw network).

MC preset has the initialization described here. But you can try to configure it yourself (starting from empty preset) to get the idea how it works.

Important: AZC needs  "Hello" in any case. The device ID specified there is used in all other LC commands.

If you follow the tutorial with TouchDAW, after it is started you can see some messages incoming (Note 24/25) (in the Last MIDI Event). Just wait till there is no more changes.

Dialogs in AZC are configured throw Control/Monitor combinations and may be the most hard to understand feature of the plug-in. You can read "once more how it works" at the end of this post to see what we try to achieve. First we define:

The initialization dialog has (up to) 4 steps:
Save AZC preset, close sonar and switch off the device (exit TouchDAW). Now start everything as usual, so turn on surface, start sonar and load/create project.
You should see "Device" "Online" in the Overview Tab within a second. Try to set it to "Offline" and check that it goes to "Online" again. Change Hardware Control Type for "Hello" (in the Options Tab) to "System" (do not forget to press "Save"...). We have "programmed" the greeting dialog!

Once more how it works. We have "Timer" which "Slow"ly (every 1 second) send "Hello" in case our "Device" is "Offline". In case Dev reply with "Ehlo" we remember that in "Device" "Onlice" state (so, we no longer send "Hello") and possibly send "Connect" (once). Sound simple when written in words, is not it?  ;)

If at some point you want "renegotiate" (your device was temporarily off but you do not want restart SONAR/ reload AZC preset), you can just put "Device" into "Offline" again. In case you follow corresponding recommendations below, that will update the device (send Hello, set Displays, Rings, Faders and LEDs).

If you still think why you need all that... Just imagine your have got some device with unusual imagination how the initialization should be done. What you can do with "normal" SONAR plug-in? You can write into Forum, submit bug report, fill "Wishes" and hope for the best. With AZC you just fix it yourself within a minute and then happily use your device. And the same for any aspect which is buggy or does not work as you want.
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 05, 2014, 09:39:51 PM
Time display

If you do not have special Time display you obviously can skip this part (except the last "Monitor reset" "All" Action). Please note I assume you work with preset from the previous post and you see "Device" "Online" in the Overview Tab ("Hello" was sent):
Do you see 123456 on your display? If not (on TouchDAW for example), change "SysEx" to "MIDI". Press "Play" again. Still no luck? Your device is not LC/MC compatible... As with everything else, you can inform me to find some solution.

If you see the numbers, change "Text" from "Fixed" to "Time" "MC MBT" "No format" "Replace". Then go back to the Logic Tab and activate the timer (change "Once" to "Fast"/"Ultra"). You should immediately see the real time on display. Try to change current time in SONAR (play for example). You should see it works as expected.

There are some limitations for now: MBT time in 2 formats is supported. SMPTE and/or other formats can be added on request.

The last "touch". I like to have 2 actions from Time monitor ("Text/Time" and "Time display") also at the end of my "(EHLO) Hello" action list (right after "Device -> Online"). With one small change: in the "Time display" action, instead of "Update" set "Set". That will send the whole time on any "reconnect". The first variant (inside Monitor) just send updates to whatever it think already there. This saves quite some MIDI traffic (especially in "Ultra" speed) and I prefer to explicitly send the whole time once (or on reinitialization).

And since we are here... I also add "Monitor reset" "All" to the end of "Hello" Action List. As with Time display, that should resend all indication (display, LED) to the Dev on reconnect (in assumption we define it with monitors, as I am going to explain in the corresponding sections later).
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 14, 2014, 10:26:40 AM
Buttons with LEDs.

All buttons of LC use the same simple rules:
Several notes:

To work with LC buttons and LEDs, we are going to take the following approach:
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 14, 2014, 11:37:13 AM
Modifier buttons.

On real device, there are "Shift" "Alt" "Ctrl" (and some more) modifiers buttons. And these buttons are technically the same as all other. In TouchDAW, "Shift" and "Alt" are internal keys not transmitted to the DAW. But many "Buttons" send some combinations of the original LC mod plus other button. For example, "|<" button in TouchDAW send "Mod_85 On","<< on" when pressed and "<< off","Mod_85 Off" once depressed. Since that happens instantly, you can not see what is going on in the "Last MIDI Event" (you see the last message only there). Use separate MIDI monitoring (or just record MIDI track and then check the event list in SONAR).

I name modifiers by codes they generate: "Mod_85", "Mod_70", etc. In preset, they are called M1...M4.

The Transport view of TouchDAW make use of 4 modifier keys. The first modifier definition:
In the Overview Tab check that it works: "Mon_70" state should be "On" during the time the button is pressed and "Off" otherwise.

In the Feedback action list for "Mod_70 : : State monitor", add one action:
I can not check the result since I do not have the button as dedicated.

We repeat the whole definition (new control, state set, action list and monitor list) for other 4 modifiers:

Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 14, 2014, 12:20:20 PM
Transport. Part I.

The origin is the Transport view of TouchDAW.

I describe corresponding Actions, I skip Hardware Control definition and Logical Control assignment/attachment.

"Stop" (Note 93):

"Play" (Note 94):

"Rec" (Note 95):

"Loop" (Note 89):

"Scrub" (Note 101):

"Jog" "Rotary" (CC 60):
That is what I like at the moment. I do not think that jogger settings are good for everyone.
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 14, 2014, 03:50:51 PM
Transport. Part II.

Real LC Rewind and Fast Forward buttons can be used with modifiers. In TouchDAW there are several buttons representing such combinations, but the logic still should be encoded into the 2 buttons Action Lists, taking modifiers into account. Both lists are almost identical, so I describe the list for "Rewind" and mention the difference for "Fast Forward".

"Rewind" (Note 91) and "FF" (Note 92)
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 15, 2014, 09:04:30 PM

As it is presented on TouchDAW Transport view, navigation keys have 2 modes: normal, when they imitate PC keyboard arrows and Zoom, when keys do vertical/horizontal zoom in/out.

Zoom button (Note 100). We should predefine "Zoom" software state set with "On" and "Off" states ("Off" should be the default). The Action List :

Up/Down/Left/Right (Note 96/97/98/99). We create "Pad"s with that names and Action Lists:
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 16, 2014, 10:14:25 PM
Commands and functions

Original LC has quite some number of labeled not strip/transport related buttons. In TouchDAW some of them are exposed directly, other throw menu. The action list for such controls consist of one Action, so I just list all controls I have defined so far in one table:

Function buttons F1...F8 (54...61) produce different effect when used with modifiers, so there can be many Actions per function key: without modifier, with Shift, with Alt and with Shift+Alt and so on. In the original plug-in, the reaction without modifier is configurable and the rest is hard coded. So, "Mod_70"+"F" have some effect and "F" buttons can be used as numeric keyboard. For the case without modifiers, we should explicitly use the condition "Mod_70:Off", "Mod_73:Off", etc. For the case with modifiers, appropriate state check should be changed to "On". I omit complete condition specification for each function action for clarity, but do not forget to put them in case you follow this tutorial:
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 19, 2014, 08:21:46 PM

Channel controls (buttons, faders, encoders) have mode dependent functionality. In AZC, Mode is represented by Software State. So we should define these before configuring channel controls.
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 19, 2014, 09:03:39 PM

LC Faders are in general touch sensitive. So we need 2 Hardware/Logical Controls per fader. I call them "Fader 1" (type "Slider") and "F1 Touch" (type "System"). We need 8 such pairs. If we predefine all that Hardware Controls, assignment in the Hardware Tab can be done with the following procedure:

I have defined also "Master" fader ("Ch:9 PB"). It has no touch function in TouchDaw.

Touch control Actions.
For each slider touch control, we need 2 Actions:
Where X is 1 to 8. The plug-in will automatically determine which parameter should be touched based on other settings.

Fader Actions.
First we define complete logic for one slider. That is simplified version of what the original plug-in allows, check the preset for complete implementation. The Actions are listed as they should appear in the Action List:
For the "Master" I use the same actions, but change Strip "Master" "First" "+0".
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 20, 2014, 09:42:11 AM

LC and TouchDAW have 8 endless encoders. I define them as "VPot 1"..."VPot 8" and assign/attach to the corresponding MIDI (CC 16 .. CC 23). Please note that unlike sliders and buttons, LC waits for specific MIDI messages to highlight rings correctly.

The Action List:
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on December 20, 2014, 09:47:33 AM
Select buttons

There is 8 "Select" buttons, one for each strip. TouchDaw does not have them directly, but they are "pressed" by "left" and "right" navigation buttons in the "TouchDAW" view (till current strip is not 1 and 8, in this case TouchDAW send "Previous/Next Bank"). While theoretically LC support Multi select, I have not found a possibility to select strips from CS API. We configure Select as Highlight (Focus), and only one strip can be focused. Original plug-in support "hidden" select mode, in which selected strip is not highlighted  in SONAR. That looks a bit confusing for me, so I want that selecting on surface and in SONAR is always in sync (withing one strip type... SONAR actually has "current" track and "current" bus, which can be set independently).

We define 8 "Sel 1"... "Sel 8" "Pad" type hardware controls and Assign/Attach proper MIDI to then (Note 24 ... Note 31).

The Action list for each of them:
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on March 11, 2015, 07:10:13 PM
Other controls

There are other buttons, for channels and in the general section. I do not want take too much of your time to describe everything. In the preset, you can see what all that controls do. I have written everything up to this point before I have start to write the preset. But the preset is much more complicated then ACT MIDI one, so I just stop there.


As you could see, there is no magic in how to make such presets. And there is no magic in MC devices. But as with presets in complicated Synts, the evil is in details. It takes quite some time to program complicated logic which works as you like.
Title: Re: TouchDAW with AZ Controller (or "Mack.. Logic Control explained")
Post by: azslow3 on March 11, 2015, 07:39:29 PM
Reference for the MC preset

Just short description what is what here.

Software State Sets

Hardware controls always have one Context and so one Logical Control. MC defines no hardware presets (unlike other, general oriented surfaces).