I am trying to grab all of the values from the 0 column in tablex1 and search through them one by one to change a variable value to either 0 or 1. I already have it setup to change the value of a constant depending on if noise0 in the code is 0 or 1. I’m just looking for the easiest way to parse through the entire column and change the variable based on what value is given. And I’ll add a delay in afterwards because I need the value to stick for a second or so. Is going through python the best way to go about this or is there a better way with just nodes.
Can you clarify the logic between how the values in column 0 impact the result? Are you counting the number of '1’s and '0’s to ultimately set const0value
? Or is it one line per constant?
The 0 and 1 are binary code that is translated from user inputted audio and I’m using that binary to play back audio to the user. So I want the 0 to play one sound and the 1 to play another one. So the intent was to have the table be read one line after the other to play the desired audio.
I assume the logic to play the actual audio files are elsewhere. Some simple code is:
for row in op('tablex1').rows():
row[0].val = 1 if row[0].val != "1" else 0
That’s a simple toggling of the value that’s there, up to you what expression you want to use. That being said, it might behoove you to append a Script DAT to tablex1
so that you’re not modifying the source data. Also, note that DATs are inherently strings, even if they look like integers. Hence for comparisons you need to think string logic, but assignments can be integers and they’ll be converted to strings.