Logic Pro X Add fader values in Environment?

oortone

Logician
Is there a way to add two fader values in Environment?
Llike this:

Fader A outputs a specific fader value.
Fader B outputs the same type of value (same ch, and "cc") and I want to add this value as an offset to the value from A.

I had a look in the Transformer object and in faders called Transform Operation but I can not see a solution.

add.png
 

Peter Ostry

Administrator
Staff member
Depends on what you want.

Option 1:
Fader A is the master and operates with an offset set by Fader B. In this case Fader B doesn't produce output, it just sets the offset.

Option 2:
If Fader B is moved, it constantly adds the offset to the current value of Fader A. In this case, both faders produce output.

Which option do you prefer?
 

Peter Ostry

Administrator
Staff member
Well, this is a simple addition of two fader values, but in the Logic Environment it is not as simple as it sounds. The transformer is the only object capable of some math, but changing the "add" value in a transformer does not trigger output. This means, the output only changes if you move the "master" fader, not with the "offset" fader.

For continuous output, the "offset" fader has to set the offset value and then send the current "master" value again to force output. Actually there is no "master" or "offset" anymore, just two summed faders.

Here is the smallest reliable patch I found:

patch_1.png


If someone knows a simpler solution, just post it here.

Basic function
FADER A goes through a number box that acts as a storage for the current value and then to a transformer where the value of FADER B gets added. If you move FADER B, it first sets the value to add and then bangs the current FADER A value to trigger the addition. This way the result is always the same, regardless which fader you move.



You could replace the "Storage" number box by FADER A, but I find the method with an independent fader better.

In case you don't know "Meta Events" yet: Their syntax is similar to the controller syntax, but the special type "Meta" can perform several actions in Logic. You find a list of available Meta events in the Logic Pro User Guide on page 915 of the PDF version.

There are some traps when building such a patch:
  • Meta event number 99 is the "Bang!" function, it forces a fader to resend it's current value. But if the value of Meta 99 goes higher than 120, it has other functions. For a simple bang we have to keep the value low.
  • Meta 99 does not die at the target object, it keeps flowing through almost everything. Most times this does no harm but it is good practice to block all unnecessary data as soon as possible, at least at the end of a patch.
  • Meta event number 127 sets a value in the second row ("Operations") of a transformer. Due to this function Meta 127 does not go through transformers, you cannot route or change it by a following transformer.


The function in detail

Here is the same patch as above, with monitor objects:

patch_2.png

Monitor 1: Meta 99 (bang) comes after the fader value, as we need it.
Monitor 2: FADER B was converted to Meta 127 with the same value and sets the offset before the bang.
Monitor 3: FADER B finally banged the number box. Meta 99 is still alive.
Monitor 4: The last transformer summed both faders and removed Meta 99.

Settings:

FADER A and FADER B are default, no special settings.

Transformer "Meta 99"
transformer_Meta_99.png

Mode: The selected mode duplicates the incoming event and sends the new event after the original.
Conditions: Unchanged, we accept what the fader says.
Operations: The new event should be "Meta" with number 99 and a fixed value. We don't care about the channel.

Transformer "split"
transformer_split.png

Mode: Events meeting the conditions are sent to the upper outlet, others to the lower outlet.
Conditions: We select "Meta" to lead Meta 99 to the upper outlet.
Operations: Unchanged.

Transformer "Meta 127"
transformer_Meta_127.png

Mode: Default.
Conditions: None. We know that only FADER B comes in.
Operations: We select "Meta" and number 127.
Function: The incoming value of FADER B gets converted to Meta 127 with the same value as the fader.

Transformer "add"
transformer_add.png

Mode: The selected mode lets only pass what meets the conditions.
Conditions: We want the value of FADER A, which has the type "Control". Everthing else (our Meta 99) gets blocked.
Operations: We just select the operation"add" for the value, the actual value is set by incoming Meta 127.
Result: Summed values of FADER A and FADER B without the Meta event.



Final notes:

For clarity I've set only the fields which are absolutely necessary. In bigger patches you would set the transformers as exactly as you can, to avoid failures due to wrong types, channels, numbers or values.

Be aware that you cannot get higher values than 127. If the sum of your faders exceeds this limit, your patch will output 127. If your application allows it, you could limit the "master" and "offset" faders in the inspector in a way where the sum does not exceed 127.
 
Last edited:
Top