AZ Controller is very flexible in logic definition. This flexibility has it's price. The only way I know to describe arbitrary logic is to program this logic. Everyone with basic programming skills can skip this post. But if "conditional execution" sounds like a rocket science for you, please read on.
I will cover only bare minimum of knowledge needed to understand configuration of AZ Controller.
What is Digital ComputerModern Digital Computer in fact still understand only 2 "digits": 0 (zero) and 1 (one). Something which can be either zero on one (and only zero or one) is called a
Bit. For mathematical calculations, several Bits are used to represent one bigger number. For example, if we have 2 Bits, we can represent numbers from 0 to 3 ("0":"0" = 0, "0":"1"=1, "1":"0" = 2, "1":"1" = 3). Computers "know" how to do arithmetical operations with numbers represented by many bits, and they do that fast and precise. So they can "mix" your 100 auto tracks represented by 24bit*192000 samples pro second without problem (in simplest possible mixing that is just a sum of 100s 24bit numbers, calculated 192000 times pro second).
But there is a big difference between very fast abacus and a computer. Computers can calculate something
conditionally. For example, it is possible to say computer: "If audio is louder then threshold, apply some gain reduction. But do not do this with silent material!"
When we look what computers can do in pure computational area, we can get feeling they are "smart". They show us complicated graphics, imitate complicated analog audio equipment, make our voice sound better and so on. But when it comes to "thinking", we immediately understand how "stupid" they are. They are "living" in very simple world of...
Boolean logicJust imagine everything is either
TRUE of
FALSE. No matter what it is. "Are you reading this text?" - "Yes, that is TRUE". "Have you already visited Mars?" - "No". "Is it going to rain next week?" - "Hmm... I do not know". It is impossible to "explain" the last answer to computer, it can not understand "may be", "i do not know", "that is better" and so on. It "understand" "Yes/True" or "No/False" only.
As soon as computer see any single, may be not even important, question on which the answer is not "True" of "False", it immediately CRASH. If that happens withing SONAR, your get SONAR crash. If that happens within the system, you get BSOD (Blue Screen Of Death).
Unlike mathematics, where 1+1=2, the result of any logical calculations is still either true of false. There is no "more true","double true" of "less false". In programming for AZ Controller only one logical operation is used, operation "
AND". And its meaning is the same as in the real world. For example:
You can record your voice if: microphone is connected to the audio interface AND audio interface is connected to computer AND computer is running recording program AND you have pressed "Record" button. So, you can record ONLY in case ALL conditions are TRUE. As soon as any single one (or several, or all) are not true (so, FALSE), the result is also FALSE. One more time, if you use logical operation AND, the result is TRUE in case (and only in case) all conditions are TRUE.
To be complete, boolean logic has 2 additional logical operations, "OR" and "NOT". But they are not used in AZ Controller.
VariablesWhen something is always TRUE or always FALSE, that is not very interesting. If some condition is always TRUE, we can skip the check. If it is always FALSE we can forget about consequences. We are interested in conditions which are some times valid and some times not. "Variable" is something which can have different meanings ("values") over time. But at any particular time, the variable has only one value. For example, "I_am_recording", "Microphone_is_connected", "Mixer_is_powered" are variables with possible values "True" and "False".
We are not computers and we use more that 2 words in our logic. While we can define many variables with "True" and "False" values only, "I_am_sleeping","I_am_eating","I_am_walking", more natural is to define variable "I_am" which can have values "sleeping","eating" and "walking". We should be careful there. A variable can have only one value at a time. But how can I describe that I am eating while walking? I can not just specify "I am" = "eating" and "walking", "I am" can not have 2 values at the same time. But I can define yet another value "eating_and_walking". So, the whole
set of possible values will be "sleeping","eating","walking","eating_and_walking".
As I explained previously, computer logic understand only something which is either TRUE of FALSE. So, how we can use our variable "I_am" which has different values? While values are not "True" and "False", 'Is "I_am" currently "walking"?' has the answer either True or False.
In AZ Surface all variables and values correspond to some
States. "SONAR" context is "Track","Console" or "Plugin", "Shift" is "Pressed" or "Not pressed", "ACT mapping" is "No mapping","EQ","Compressor","True Piano","Channel tools",etc. That is why I call each value a State. A complete list of all possible values for some variable is a State Set. Each State Set has one Current State. So, a variable is the "current state from the corresponding list of possible states". Using that terminology, a
Condition is specified by just one State and can be interpreted as: "the current State in State Set 'Context' is 'Console'", which obviously can be either TRUE of FALSE.
Sequential operationsAn analog mixer does everything in parallel. So, EQ setting, gain, etc. are applied at the same time to all inputs. But Digital Computers execute operations sequentially. So, it FIRST apply EQ to track ONE, THAN apply a gain to track ONE and only THEN apply EQ to track TWO and so on. That sometimes happens so fast you have no chance notice the difference (in Digital Mixers for example), but in case of DAW with many tracks and plug-ins that can take a while and you get significant delays. When we have several processors, they operate in parallel. But they are executing different programs.
When you write some
Program you define a Sequence of operations and it will be executed in sequence, one operation after an other. It is important in case you can modify what next operation should do in previous operation. Small mathematical example:
1. A equal 1.
2. A equal A plus 1.
3. B equal A plus 1.
What is B? If (2) and (3) are executed in parallel, B is equal "2". But (3) is executed AFTER (2), so B is equal 3.
Example from AZ Controller logicLet say I have one Button and one Rotor. I want to use the Button as a "Shift", so the Rotor control 'Volume' without Shift and 'Pan' with Shift. To make example more interesting, I want that the (same) Button act like "CapsLock" in case I pressed it without touching the Rotor.
One possible solution is:
1) I define a State Set (Variable) "SHIFT" with 2 possible States (Values): "OFF" and "ON"
2) I define a State Set "ROTOR_MOVED" with 2 possible States: "NO" and "YES"
3) On Button pressed event I execute the following program (a list of Actions in AZ Controller):
* "ROTOR_MOVED" is set to "NO" (we have not moved rotor after pressing Shift)
* If "SHIFT" is "OFF" then set "SHIFT" to "ON" and FINISH execution (no CapsLock, indicate Shift is ON, do not execute next instructions)
* If "SHIFT" is "ON" then set "SHIFT" to "OFF" (that was CapsLock mode, indicate Shift is OFF now)
4) On Button unpressed event I execute the following:
* If "SHIFT" is "OFF" AND "ROTOR_MOVED" is "YES" then set "SHIFT" to "ON" and FINISH (we used Shift in CapsLock mode)
* If "SHIFT" is "ON" AND "ROTOR_MOVED" is "YES" then set "SHIFT" to "OFF" and FINISH (normal Shift)
* If "SHIFT" is "OFF" AND "ROTOR_MOVED" is "NO" then do nothing (we unset CapsLock, since we do nothing, we could skip this operation)
* If "SHIFT" is "ON" AND "ROTOR_MOVED" is "NO" then do nothing (we enter CapsLock mode, we could skip this operation as well)
4) On Rotor moved event:
* Set "ROTOR_MOVED" to "YES"
* If "SHIFT" is "ON" then change Pan
* If "SHIFT" is "OFF" then change Volume
Do you understand how it works? Do you understand why we need "and FINISH" instruction? If yes, you are ready to program complex logic in AZ Controller. If not, do not worry. After reading User manual you should be able to really program this example. And then you can see what happens on each event/operation.
I hope your brain is still in tact. I am happy I am not near you otherwise
