Strange One – Midi Velocity Value
Hi Gang,
I have attached the .json Script incase its useful.
Weird one here, I am using Ableton, A Yaeltex Turn & Ableton Push 2.
I have a set up here, an instrument rack (1) with two other instrument racks (2a & 2b) or ‘chains’ embedded within.
I have set up my CSS script so every-time a new chain is selected the encoder on my Yaeltex is updated and will control Macro 1 on that chain.
The feedback between the Yaeltex and Ableton is fine. When I move the knob on one or the other then I get a feedback response every time.
The issue comes when I introduce Push into the mix. When I open Ableton I do get three way feedback between Ableton, Push & The Yaeltex – each device feeds back to the other. When I change to a different chain I still get feedback from Ableton and the Push but the Yaeltex stops giving me visual feedback.
When I move the endless encoder on the Yaeltex there is a Jump from the encoder to the Value on Ableton. I know Value Scale is out there but this is not a viable solution for this issue.
What I need is the value across all of the devices to be the same at all times. I’m very close but there is just one glitch which I need to iron out.
A little Python tutorial might help you out.
PYTHON BASICS
In this case “select_device” is what we call a “function“. Functions are useful because you can repeatedly call upon a block of code without having to retype everything. You just have to call upon the function’s name, in this case “select_device”.
To call upon a function we need opening and closing parentheses after the function’s name, like this: “select_device()”. These parentheses always come in a pair.
Some functions need some kind of input, which are called “arguments” in Python. In our case, the argument/input is the device we want to select. This argument needs to be put in between the opening and closing parentheses, like this: “select_device(this_is_an_argument) “
THE SYNTAX ERROR
Somewhere in the argument of the code, you have a parenthesis too many. In the picture “Syntax error.png” I colored the function and its parentheses green; the argument is colored red; and the parenthesis that you should remove is in white. Then the code should work. This is the line of code:
self.song().view.select_device(self.song().tracks[0].devices[0].chains[self.get_modifier_value(“m1”)].devices[0].chains[self.get_modifier_value(“m2”)].devices[0])
(optional) MAKING THE CODE MORE READABLE
At the moment, your argument is a huge string of code, that’s not easy to read. It might be useful to divide it into chunks. We can use variables for this purpose. Variables are like little aliases or nicknames to a string of code
In the picture “Optional.png”, the argument is broken down in 3 parts: first_device, first_chain and second_chain. So the long line of code is now replaced by the following 4 smaller lines of code:
first_device = self.song().tracks[0].devices[0]
first_chain = first_device.chains[self.get_modifier_value(“m1”)].devices[0]
second_chain = first_chain.chains[self.get_modifier_value(“m2”)].devices[0]
self.song().view.select_device(second_chain)
We only need to add the variable “second_chain” as an argument when we call the function “select_device” because “second_chain” actually contains the whole argument.
Sign up
User registration is currently not allowed.