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?
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
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.
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
}
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!
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
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: