Hi,
I'm using a dropdown menu to change the label of a matrix button using a 2d array
But When the first and second array has the first same name( in this case "Hz"), the dropdown menu is no more able to change the array.
Is it a commun restriction ?
Best
2D-array.json (5.8 KB)
JS{{
var props = {}
var cc = [10,11,12,13,14,15,16,17]
var names = [
["Hz","Rez","Hz Attack","Delay","Porta Time","Unison","Reverb","Volume"],
["Hz Cut", "Rez", "Echo", "Reverb", "Attack", "Release", "Wave Position", "Unison"],
["Hz", "Filter Decay", "Filter Release", "Amp Release", "Reverb Decay", "Reverb Freeze", "WReverb HiShelf", "Reverb Dry/Wet"]
]
var defaults = [
[52,53,69,38,62,116,43,107],
[31,31,23,16,11,58, 59,11],
[0,0,111,119,85,0,90,51]
]
props.html = names[@{dropdown_@{parent.variables.device}_instrument}-1][$]
props.alphaFillOn = 1
props.default = defaults[@{dropdown_@{parent.variables.device}_instrument}-1][$]
props.range = { "min": 0,"max": 127}
props.doubleTap = true
props.address = "/control"
props.preArgs = [@{variable_@{parent.variables.device}_mc}, cc[$]+(8*(@{dropdown_@{parent.variables.device}_instrument}-1))]
props.target = @{variable_midi_port}
return props
}}
With this code I have incoming error message
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '1' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '2' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '3' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '4' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '5' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '6' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '7' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '7' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '6' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '5' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '4' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '3' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '2' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '1' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined
matrix_minilab_macro.props JS{{}} error at line 14: TypeError: Cannot read property '0' of undefined