Hi All. I've found some great answers already on this forum, but am stuck on this one...
The below code works well to populate switch values from incoming OSC.
JS{{
var values = {}
values[OSC{/SongName0,Song 1}] = 0
values[OSC{/SongName1,Song 2}] = 1
values[OSC{/SongName2,Song 3}] = 2
values[OSC{/SongName3,Song 4}] = 3
values[OSC{/SongName4,Song 5}] = 4
return values
}}
But I would like this list to be dynamic - based on a song_count variable.
This is the closest I have got:
JS{{
var values = {}
var i, idx;
for (i = 0; i < @{song_count}; i++) {
idx = "\O\S\C{/SongName"+i+",Song"+i+"}";
values[idx] = i
};
return values
}}
But I can't get the OSC listener command to be treated correctly, as the switch value just shows the text: