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.
When I tried your script with my device, I got an error when the Chain Selector Value was higher than the amount of available Chains (with Device in the Chain). Maybe this error is causing your problems. Here are 3 ways of dealing with this error:
1) LOOPING THROUGH THE CHAINS
json file = testt (copy)_0_LOOP
This method you can setup without any custom code. It loops through all the Chains of the 1st Device of the 1st Track. Then it checks for every Chain if the Loop Iteration Number (which is the same as the Chain’s number) is Equal to Modifier m1. If it finds a Chain that meets this condition, it performs the Action.
2) CONDITION THAT COMPARES CHAIN LIST LENGTH TO MODIFIER m1
json file = testt (copy)_0_CONDITION
This uses some Custom Code. As a Condition, the following code is used:
len(self.song().tracks[0].devices[0].chains) > self.get_modifier_value(“m1”)
This code checks if the Length of the List of Chains (in the 1st Device of the 1st Track) is Greater Than the Value of Modifier m1. Why use Greater Than?
Say you have a List of 5 Chains, as an example. The index numbers associated to each Chain start at 0, meaning that the first Chain gets index 0, the second Chain gets index 1 … all the way to the fifth Chain that gets index 4. The index number is the number we use to refer to an item in a list. But when we ask for the length of a list, we get the actual amount of Chains that are in this List, which is 5.
Modifier m1 represents the index number of the Chain we want to call upon. So the highest valid number that Modifier m1 can be is 4 because the highest Chain index is 4. This means that, as long as the Length of the List (= 5) is higher than m1 (so 4 or less), we can move on to the Action of sending the Macro Value to the MIDI controller.
3) TRY / EXCEPT
json file = testt (copy)_0_TRY_EXCEPT
This method uses Custom Code that might not be obvious if you’re not familiar with Python.
Your original line of code (line 2 in Try_Except.png) was put inside a Try / Except Statement .
This Statement tries if your line of code works without producing any errors. No errors = no worries. When an error IS produced, then the statement produces whatever comes after “except”, in this case we “return” (meaning we end the Reaction).
This third method was the first one I used but then I thought not everyone might understand what’s happening and I went to find a few other methods.
Hi Glenn,
Thanks for the feedback – I am aware of the error and initially also thought this would be part of my problem. I troubleshoot what was triggering the issue and found out that it was to do with the chain selector going beyond the scale of the number of chains.
In my utilisation of the script I have paid attention to make sure not to make this error code occur and the problem persists.
To go a little further into what happens just incase this sparks some inspiration.
When I change the chain selector value I see the value of the desired Marco (Chain x, Macro 1) on all of the controllers (Push, Yaeltex & Ableton).
If i turn the encoder on the Yaeltex or Ableton first, it works fine without issue. It is only when I change the value on Push first that I don’t get tri-directional feedback. The values in Push and Ableton are updated but the yaeltex is somehow frozen.
When i turn the encoder on Yaeltex then the midi value jumps (to that of the Yaeltex controller) and then functions properly. The other way I can get it to function is by pressing the macro or by selecting the device rack with the mouse.
This new (also stripped back script) moves towards solving the problem. I have added a select device mapping to the script (with the M1 chain select modifier within it). when I press this button it syncs the the push and the Yaeltex. What I need now is to have that done without having to press a button, so when the chain selector is changed, the selected device button is activated.
I’m gonna work on this now and see what I can come up with.
I was able to recreate your problem but at the moment, I don’t know how to fix it. Or at least, I don’t know how to fix it with the way it is set up now because I think it has something to do with how the Device Parameter Mapping is processed.
I only used 2 of your mappings when evaluating the problem: the one that sets Chain Selector Value to Modifier m1 + the Parameter Mapping. I’m quite sure there’s nothing wrong with the Value that’s set to the Modifier (when I log it, it’s correct) so the only culprit I can think of is the Parameter Mapping.
OBSERVED BEHAVIOUR
I have a Live Set set up with 5 Chains, where each Macro 1 has a different Value (so I can monitor changes on my Encoder) and what I’ve noticed is that the status on the encoder will always change to that of the Macro on the previously Chain (meaning the Chain that was accessed using the Chain Selector previously).
Example: if I move from Chain 1 to Chain 2, the indicator on the Encoder represents the value of Chain 1; if I then were to move to Chain 3, then the value changes to that of Chain 2. If I then change from Chain 3 to Chain 1, the value of Chain 3 appears on the Encoder.
After a change in Chain, moving the correct Macro inside Ableton won’t change the indicator on the Encoder. However, changing the Encoder sets the Macro’s Value to that of the Encoder and it the Macro’s value does change dynamically with that of the Encoder. But if I then were to change the Macro again inside Ableton, it still wont change the Encoder’s value. And the Macro’s value will always jump to the value of the Encoder when its knob is turned.
The only way to have the Encoder and Macro communicating correctly is to select another Clip in the Track (without activating that Clip); then the indicator on the Encoder will first update to the position of the Macro + change when I move the corresponding Macro in Ableton.
So I’ve managed to get it working using the ‘Song>Select Device Parameter’
The problem I have run into now is the Macro I am looking to select is embedded within 2 Device racks.
With the Device Parameter mapping you are able to add multiple chains to a device (see screen shot 1) but with the ‘Song>Device Select Mapping you can only choose one chain. (screen shot 2a+b)
I would like the script to function how it does for the device parameter setting. With the first chain set to m1 and the second chain set by m2.
I have inspected the code as best I can and have tried adding a second chain selector via custom code for it but I got syntax error:
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])
Do you think there is some sort of custom code available for this type of mapping?
The script is attached 🙂
Sign up
User registration is currently not allowed.