🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

Strange One - Midi Velocity Value

Submitted by R. on Sat, 03/30/2024 - 09:24
R.
Control Surface Studio User

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.

Topic Category: 

17 Responses

Comments

R.
Control Surface Studio User
#1

please please please if you have even the slightest suggestion i would really appreciate it

R.
Control Surface Studio User
#2

if anyone is out there, I am desperately calling out, I would love to pay someone with more knowledge than I have in order to over come this issue. At the moment the whole concept of my live set rests on this functionality and I'm not getting anywhere closer to working it out....

R.
Control Surface Studio User
#3

The issue is for sure something to do with the Push.

I have stripped the script down to the raw basics.

Whenever I change the chain selector and start with an input from the push it does not update/move

upload files: 
R.
Control Surface Studio User
#4

When I set up the CSS Log so that it displays the value of the relevant device parameter. It does not output any numbers to the log.

When first initialised it works, when I change the chain selector and move the push device, the device parameter changes but does not show on the log. When I click the Marco/Correct device parameter it starts to work.

R.
Control Surface Studio User
#5

....It doesnt make any sense to me?

If the parameter is moving within ableton then why is it not sending data?

Glenn Verhaeghe
Control Surface Studio User
#6

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.

R.
Control Surface Studio User
#7

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.

R.
Control Surface Studio User
#8

forgot to press the upload button the script....

upload files: 
Glenn Verhaeghe
Control Surface Studio User
#9

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.

R.
Control Surface Studio User
#10

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 :)

Glenn Verhaeghe
Control Surface Studio User
#11

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.

R.
Control Surface Studio User
#12

I'll get back to you properly when I sit down and look at this again, but a quick cursory script and it seems to work.

Thank you you legend.!!!

R
Free User
#13

Hey Glenn,
So thank you very much for outlining the above. It took me a few times to read and digest it but it makes sense to me now in an elementary way. It's amazing (but equally unsurprising) how such a brief syntax unravels the whole show.!

Anyway I have implemented the new code now and as far as I can tell I now have 32 encoders which are almost doing exactly what I want them to do. I have shared the code incase you and others find it useful.

There is only one glitch as far as I can tell and it leaves me scratching my head.

The endless encoders also have button functionality. I have set this button up using the controller's set up application ('Kilowatt') so that when I press it it quickly switches to bank 2.

In Kilowatt I have set it up so I have 4 banks - these are similar to modes in CSS but they function slightly differently. When I change a bank in Kilowatt it allows me to change the MIDI information sent from each of the controllers physical components.

On Bank 1, when I press an encoder it 'quick shifts' just that one encoder to bank 2. So say on Bank 1 the encoder controllers Macro 1 on Bank 2 it controls Macro 5.

This is super dope for what I'm looking to do buuuuut when I press the encoder and quick switch to back 2, I loose the feedback from Push to the Yaeltex Controller. The Yaeltex still sends to the Push but the push does not link to the Yaeltex.

Unlike last time, when I 'select' either the macro or the current device, this does not resync/update functionality. What I have to do is switch the bank on the Yaeltex from 1 to 4 and back and then it updates and it works. The additional steps needed here kinda negates the benefit of the cool functionality.

I thought one solution could be to add a listener to the script so that when the button was pressed the something was fired but the button has no visual MIDI information on the CSS Midi Monitor or that of Kilowatt.

It feels a little like the end of the road for that one for me, but hey you never know.

I have made a short video to try and makes things more visually clear, whether it will be allowed on the forum or not I don't know.

https://drive.google.com/file/d/18uhOiiBt3B35YPgWNcA1N_76sag-UZgS/view?u...

upload files: 
Glenn Verhaeghe
Control Surface Studio User
#14

This seems like the kind of problem that's hard to figure out without the controller and software in front of you. Maybe the Bank switching on the Yaeltex doesn't behave like you expect it to? I'm guessing that because of when you get no MIDI messages on the monitor (that's not a CSS or Ableton problem, I think). Maybe the button loses its MIDI configuration when switching back to Bank 1 via the button press?

I would need more insight in the MIDI configuration. Maybe if you could provide the following:
- Screenshots of the MIDI Config in Kilowhatt for all banks
- Some info on how the bank switching can be done for 1 button at a time.
- The controller template you are using with your CSS script.
- A video that focuses on the MIDI Monitor while you call out which buttons you press and knobs you turn, while you recreate your problem.

I want to point out a small detail: one controller doesn't communicate with the other controllers, at least not directly. The controllers communicate with Ableton and Ableton gives them feedback. If a controller doesn't receive feedback, then its communication with Ableton isn't functioning properly.

It is possible to have a Control Surface script where one controller is the input and another is the output, but there's always Ableton in between. A practical use case for this would be to control the effects of an instrument/hardware device that has no MIDI IN but does have a USB connection (e.g. a Boss Katana).

R
Free User
#15

Hey Glenn,

Thanks for your post. I've provided some more information for you below. Before I get too far into it, if it sounds interesting to you, I would be more than happy to pay for a zoom consultation or something like this. I have a few niggles that I need to iron out and I feel like your expertise could save me many future headaches.

The first screen shot gives you and overview of Kilowatt - the online program used for programming the Yaeltex Turn.
In the top left you can see the bank selection tabs
Each of the blue 'cards' represents a module (in this instance an encoder and a switch)
On the right you can see the switch configuration - you can see here it is set to "quick shift to bank + note"
Pressing the encoder switches the output of the current card to a different bank so it outputs a new message. Currently it switches from CH1/CC1 to Ch3/CC1. I added the "+ note function" to see if I could use that as some sort of 'bang' in order to sync Ableton and the Yaeltex - the note is CH 1 / Note On 33/ 0.

*- Screenshots of the MIDI Config in Kilowhatt for all banks* - a screen shot won't help much unfortunately as the switch functionality is hidden behind each card, I have outline each bank below

Bank 1
Encoder # Midi Channel Parameter No
1 1 1
2 1 2
3 1 3
.... .... ....
32 1 32

Bank 2
Encoder # Midi Channel Parameter No
1 2 1
2 2 2
3 2 3
.... .... ....
32 2 32

The switches don't send midi data per say, they only send midi information when the 'note' option is added, although this is not related to the bank switch.

"Some info on how the bank switching can be done for 1 button at a time."
Sure thing. The general concept is that Kilowatt allows you to set up and map 'banks' to buttons on your controller (similar to modes in CSS I guess). If you switch between banks using the 'primary' bank button then the whole interface of the Yaletex Controller changes. No MIDI message appears on the MIDI monitor when doing this.
In kilowatt you can change the functionality of the switches, and one of the options is 'quick shift to bank' (screen shot 2). This means that the encoder, and ONLY the encoder that you press will quickly shift to the bank you choose (Bank 2). In the instance I have set up encoder 1 would go from CH1/CC1 to CH3/cc1.

The controller script is attached. The knobs and buttons on the 2nd and 3rd rows aren't applicable to this part of the code.

Bank 1 is encoders 1 to 32 on CH1
Bank 2 is encoders 1 to 32 on CH3
Bank 3 & 4 aren't so relevant but they are on CH4 & 5

Video 1
https://drive.google.com/file/d/1jOBV5OHF_iibIouc7x6cFz3QBhSwjp0L/view?u...

Video 2
https://drive.google.com/file/d/1Z7iYn4sYnkykAHtzcfvXjKlLkT1HMMPE/view?u...

"I want to point out a small detail: one controller doesn't communicate with the other controllers, at least not directly."
- I hear you - this makes sense in terms of how i understand the issue. In layman's terms it feels like pressing the switch to bank button somehow interrupts or misaligns the code written in the .json

upload files: 
R
Free User
#16

Sorry, the formatting for the Encoder channels did not work - I have attached a PDF below

upload files: 
R
Free User
#17

Im wondering if anyone else has any thoughts on this issues?

If anyone is available to dial in via Zoom I'd be happy to pay to try and work this out :s

Thanks