🔥 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.

Watchout for Bools/Lists and UI to UI commands

Submitted by trololololol on Mon, 04/24/2023 - 18:55
trololololol
Control Surface Studio User

Hi,
this Softare turned out amazing in the first steps, when you only want to little tinkering. But the moment you want to do basic things you run into bugs which are not solvable. No reaction from the developer aswell. But at the same time he posts "working on 2.8".
Please fix the Bugs or describe the error im making for the last weeks.

i attached a simple function (incl. setup so you can try it at home).
Something ist wrong with exit functions and/or lists.

The Arm Drums Action should arm a group of tracks i defined. One Press for Arm, next press for unarm. But instead it just doesnt run all the way through and stops working then completly.

Im really pissed at the moment and i would be happy to give the first person to help me out 100 bucks on paypal.

Topic Category: 

10 Responses

Comments

fatphil
Control Surface Studio User
#1

Hi Trololo,
I feel your frustration! I'll take a look.
I'm comfortable looking at the code that gets generated so Imight be able to find the problem.

Phil

trololololol
Control Surface Studio User
#2

Thank you Phil, i saw your comment yesterday and started implementing it. That was so nice of you! I cant program but starting points give me enough hints to figure it out.

Please check the "Exit Reaction" thing. This makes it very hard to work.
For your understanding: If you do an action like
Condition: Button Press is 0
Action: Exit Reaction.

Idea ist to filter out the 0 Values when a Button is momentary and to only react after this action block to values of 127

But if you do a reaction like this, all reactions which target the same button have this feature of filtering now. not only the Reaction i wrote the block in.

Thank you for your great contribution Phil!!

fatphil
Control Surface Studio User
#3

I've had a look at the code
It looks like as soon as you receive the midi CC value 0 the method ends. None of the other actions get reached. For any other CC values it goes on to the other actions. I think this may be by design but I may be wrong. You could do it differently by adding an AND condition on each action block like so self.midi_cc_ch_0_val_46.cur_val > 0
(NOTE I changed the CC val to work with my controller)

See the code in this gist:
https://gist.github.com/fatphil2001/3e257f9c97628f9768df2f43c6e593bb

Action block starts at line 11 and quits the method at line 13 if cur_val is zero
Action block 2 (Line 18) never gets reached in that case

trololololol
Control Surface Studio User
#4

Yeah i see the code and i understand it. Thank you very much for your time!

It just doesnt solve the problem.
After the first press and the arm on action block i write a new state in the list 6 for the button.
So when the button is pressed a second time the condition for the actions block for arm on should not trigger. just the last action blocks which meet the new state from list 6 to do arm off.

fatphil
Control Surface Studio User
#5

I noticed 2 things
- firstly is the offset for adding or getting from the list. This is a known bug where reading from lists starts at 1 not 0.
- secondly setting or comparing true/false values seems to mix up strings ("False") and boolean (False) values. I don't know if this is normal or if they are evaluated correctly.
Example:

if self.get_list_item("list6", 2) == True:
self.midi_note_ch_0_val_48.send_value(127)
self.add_to_list("list6", "False", 1)

If John the dev could step in to explain these 2 points that would be much appreciated

fatphil
Control Surface Studio User
#6

What if you change the code to use only strings like so
if self.get_list_item("list6", 2) == "True":

trololololol
Control Surface Studio User
#7

Wuuuuhu, thats a lot to do! Thank you for your ideas. i will implement all of these changes and let you know.

trololololol
Control Surface Studio User
#8

You my friend are a genius. It works now. I cant tell you how happy i am.
With this functionality my controller is finished. I will post all my custom actions and a template for the apc 40 mk2 in a thread the next days.... so everyone can make use of the effort you have brought into this forum.

fatphil
Control Surface Studio User
#9

That’s fantastic news! So glad you got it working.

PS. I’m not a genius, just a software developer by day :-) I’d never done any python before though. Hence my questions about strings and booleans.

fatphil
Control Surface Studio User
#10

Ps. Maybe change the title of your post. This one wasn’t really a CSS bug but more of a gotcha!