Hi,
I'm trying to simply get data from an array by gathering a number received from a midi channel (widget called Received in this case).
I would like to make all of my buttons read a specific value from the grid (gridValue.1 read first value, gridValue.12, the 12th value, etc.)
var selector = @{Received.value}
var config = [{
'name': 'Violins 1',
'grid': ['1', '1', '1', '1', '0', '0', '1', '1', '0', '0', '0', '1', '1']
},
{
'name': 'Violins 2',
'grid': ['1', '1', '1', '1', '0', '0', '1', '1', '0', '0', '0', '1', '1']
},
{
'name': 'Violas',
'grid': ['1', '1', '1', '1', '0', '0', '1', '1', '0', '0', '0', '1', '1']
},
{
'name': 'Cello',
'grid': ['1', '1', '1', '1', '0', '0', '1', '1', '0', '0', '0', '1', '1']
}
]var artNumber = config[selector]['grid'].length;
var artValue = config[selector]['grid'];
var name = config[selector]['name'];
then to have something like that to display the button:
#{
@{SCRIPTNAME.artValue.1} == 1 ? "display:flex;" : "display:none;"
}
}
Usually this is something I could easy do with Angular but nothing works here.
What I've done wrong? I'm pretty sure I have difficulties to unterstand OSC logic.