I think some for loops would help in all of the places where you’re doing things that are in sequence.
For example, lets say you want to print the names and vals for all of the channels in null 1 in your network. You can do that in two lines with a for loop like this:
[code]# print the channel vals in null1
for item in range(op(‘null1’).numChans):
print( op(‘null1’)[item].name ,op(‘null1’)[item][0] )[/code]
Instead of:
print(op('null1')[0][0])
print(op('null1')[1][0])
print(op('null1')[2][0])
print(op('null1')[3][0])
print(op('null1')[4][0])
print(op('null1')[5][0])
print(op('null1')[6][0])
print(op('null1')[7][0])
We might also check the > < == status of comparing channels and sliders. We could do that like this:
[code]# check if vals are greater than or less than faders1
faderPath = ‘faders1/item{}/slider1’
nullCHOP = op(‘null1’)
for item in range( nullCHOP.numChans ):
msg = ‘slider {slider} is {logic} than channel {channel}’
targetSlider = faderPath.format(item+1)
if float( nullCHOP[item][0] ) > op(targetSlider).panel.u:
print( msg.format(slider=op(targetSlider).parent(), channel=item, logic='>') )
elif float( nullCHOP[item][0] ) < op(targetSlider).panel.u:
print( msg.format(slider=op(targetSlider).parent(), channel=item, logic='<') )
else:
print( msg.format(slider=op(targetSlider).parent(), channel=item, logic='=') )[/code]
There’s some good bits here about Python in touch that might be useful:
matthewragan.com/teaching-resou … hdesigner/
findChildren() is a method that lets you find ops inside of a Component OP. In this case specifying a depth of 1 limits of the search distance of the call to only one network depth - otherwise it would recursively go through all layers of the children ops.
In your network try this:
[code]children = op( ‘faders1’ ).findChildren(depth=1)
for item in children:
print(item)[/code]
Try changing the depth parameter in call to see which ops show up in the textport.
When you say:
What do you mean exactly? I would interpret this to mean that you’re really after making relative changes to your sliders in Touch, but I don’t think I’m understanding exactly what you’re after.