How can I find adjacent controllers (FW2 / FW3 question)

Here’s what I want to do in all my Mod Matrices:

  • when depth of a modulation = 0, then all of its controls should be RED (or grey in FW3)
  • when depth of a modulation <> 0, then all of its controls should be GREEN

I try to solve this by giving a function colorDepth to the depth controls, but how do I then in the lua function:

  • retrieve the actual control belonging to that depth ?
  • retrieve the actual position (slot) of the control in FW2, or control ID in FW3?
  • find the 3 three adjacent controls?
    • in FW2 , these are the ones occupying the slots - 6, -5 and + 1 compared to the one of Depth
    • in FW3, these are the ones with an ID - 2, -1 and + 1 compared to the one of Depth

I’m doing this for a configuration screen (and some other stuff).

I just pulled up my most recent preset, but it looks like my last changes were not saved.

Basic idea (I’ll paste pic, code a bit later) is to define the consecutive controls and then either use

   local message = ValueObject:getMessage()
   local paramNum = message:getParameterNumber()
   -- 53 is the magic number of the first param in the list - 1  just to make array indexing easier
   local ccToSend = ccMap[paramNum - 53]


   local message = ValueObject:control()
   local paramNum = control:getId()
   -- 121 is the first ID of the controls -1  just to make indexing into arrays easier
   local ccToSend = ccMap[paramNum - 121]
1 Like

attached is a zip file with a couple screen shots and a text file with the code that implements it
Hope some of it helps

you’ll also need this array (forgot to copy/paste it)

trkCCName = {“Volume”, “Feedback”, “Pan”, “Speed”} (33.5 KB)

1 Like

congrats by the way on being 2 years on the forum !

1 Like

Seems like just yesterday asking my first questions.