Multiple PreArgs Targets

Can preArgs have more than one midi target?

I'm trying to use several external midi faders to change the display in one text field. For example, moving fader1 preArgs = [1,1] the text field will show the value for fader1. Moving fader2 preArgs = [1,11] the text field will show the value for fader2. And so on.

I am not clearly understanding how to get the preArgs to "look at" several different incoming midi CC's.
I can only get it to work using a single exactly midi message, ie [1,1]. But I would like it to respond to [1,1] and [1,11]. Is this possible?

Any help will be greatly appreciated!!

Can preArgs have more than one midi target?

No, widgets listen to only one set of address + preArgs. To route multiple messages to the same widget, either use multiple widgets + scripting or use a custom module

Thank you!! I appreciate the quick reply. I'll investigate the options you mentioned.

i don't know if it can answer your needs but if you just want a text widget to display the value you can use this in a buttons matrix.

displayValue

edit : note you have to set decimal to 0 in the above script

infoValue.json (5.5 KB)

Hi Greenman,

Thanks for your reply and example. A very interesting way to do it, I learned something new - thanks for sharing!! Is there a way to assign midi cc control for each of the the knobs independently?

I am now trying now to find a way to 'hide/show' text widgets depending on specific incoming midi CC information. I have successfully created several different text widgets, that correctly display the values from my external fader controller. Now I just need to find a way to Show/Hide each depending on which fader is being moved.

I'll keep digging!!

you can adapt this piece of code.
in my example, oxygen49 is my midi device.
Knobs begin at 23 and send a midi message like this /control/1/25/58
1 > midi channel
25 > Control change number
58 > value of this CC

JS{

var p = {} /* create a JS object */
var ids = ['A', 'B', 'C', 'D', 
           'E', 'F', 'G', 'H']

console.log($)

var colors = ['auto', 'red', 'cyan', 'orange', "pink", "yellow", "rgba(255, 50,200,0.95)", "#556633" ]

p.id = ids[$]
p.colorWidget = colors[$]

p.range = {min:0, max: 127}
/* p.steps = 6 */

/* adapt this value to your needs */
const start_CC = 23

const goo = start_CC + $
console.log(goo)
p.address = "/control"
p.preArgs = "[ 1, " + goo+ "]"
p.target="midi:oxygen49"

p.script = "set('info', value)"

return p

}

Good luck

Hi Greenman,
Thanks again for your reply and help. I appreciate you providing your example for me to learn from.
I did mange to find a solution, although not that elegant. But it does work for me with my limited coding skills.
I created several faders that react to my external faders. Then I created a panel with several tabs. On each fader I wrote the script:
For fader 1 =

if (value > 1) {
set('panel_CC',0)
}

For fader 2 =

if (value > 1) {
set('panel_CC',1)
}

So when I move fader 1, it selects tab 1 in the panel. Fader 2, selects tab 2, and so on. Inside each of the tabs I placed a text widget that reads out the values from each individual fader. Finally, I hide all the faders and the tabs, so now when I move a each fader it's selects (opens) the corresponding and show only the text.

Not the best solution I'm sure, but it's working great for me now and provides the visual feedback I was looking for, while I continue to improve my coding skills!

Thanks again for your help!

You know i am still a newbie and i keep believe every piece of code published will help someone one day.

So would you please post your json file corresponding to your solution ?

Cheers

Yes, I will post my solution. I also approach every hurdle by first searching through the forum to learn from others. I am very happy to contribute to the collective learning curve in any way I can :+1:

1 Like

fader feedback example.json (15.8 KB)

Here is the project demonstrating the my solution. Hope it helps someone!!
To use:

  1. Assign the 3 faders (hidden) to your corresponding external midi faders CC numbers, and adjust the midi Target to your setup.
  2. Moving each external fader individually will switch the "panel_CC" tabs (also hidden) to show the desired text widget for the fader values.

My midi assignment setup is:
fader1 "fader_exp" = [1,11]
fader2 "fader_mod" = [1,1]
fader3 "fader_vib" = [1,21]

You can easily add more faders and tabs as needed. Let me know if you have any questions. Good Luck!

Also, forgot to add that each fader has a script that points to each individual tab in "panel_CC".
The script in "fader_exp" (fader1) pointing to the first tab is:

if (value > 1) {
set('panel_CC',0)
}