The error suggests that bgcolorr, bgcolorg, and bgcolorb parameters might not be available for your table operators. Instead, you can use a different approach to visually indicate which table is active, such as changing the text color within the table cells or highlighting the border.
Here’s an alternative approach where we change the text color of the table cells:
def valueChange(channel, sampleIndex, val, prev):
# Get the operator (CHOP) this DAT is monitoring
# Get the values of the channels
feminist = chop['feminist'][0]
# Find the channel with the highest value
values = [angel, hero, feminist, rebel]
max_index = values.index(max(values))
# Define the paths or names of the Font Tables
# Select the active font table based on the highest value
active_font_table = font_tables[max_index]
# Get all fonts from the selected font table
fonts = [row[0].val for row in active_font_table.rows()]
# Select a random font from the list
selected_font = random.choice(fonts)
# Set the selected font to the Text TOP
text_top = op('static_text') # Replace with the actual name of your Text TOP operator
text_top.par.font = selected_font
# Change the text color of all tables to white and active one to green
for i, font_table in enumerate(font_tables):
for cell in font_table.col(0):
for cell in font_table.col(0):
- Change cell background color: Iterate through the cells of the first column of each table and change the background color to green for the active table and to white for the others.
This approach should work, assuming your table cells have the bgcolorr, bgcolorg, and bgcolorb attributes. If these attributes are also unavailable, you might need to explore other methods such as using external indicators or annotations within your interface.