One dropdown (5 values ), Nine buttons, 45 CCs... How to script that ?!

Hello

Regarding the dropdown's value, each one of my nine buttons may send a CC (nine consecutive numbers).
midiCh may be different from one dropdown's value to another.

Example :

  • dropdown's value 1 ("Aller au marqueur") --> midiCh 7; CC9 to CC17
  • dropdown's value 5 ("Zoom Boucle") --> midiCh 2 ; CC55 to CC63

Navigation marqueurs

How can i script this ? I think i can do it on a "one by one" base... if that == 1 and this == 1... but if there is a more efficient and time-saver way to do this, i'd like to know/learn what it could be ! :wink:

Thank you !

The shortest way I can think of now: set each button's on property to its rank (1 to 9) mode to tap, and linkId to some_id. Create a script widget with the same linkId so that it receives the buttons' values and write something like this in its script:

var dropdownMap = {
  1: {ch: 7, cc: 9},
  5: {ch: 2, cc: 55},
  // etc
}
var data = dropdownMap[get('dropdown_id')]
if (data) {
  send('midi:port', '/control', data.ch, data.cc + value - 1, 127)
} 

Thank you Jean-Emmanuel. I'll try this.

That's perfect :wink: Thank you very much !