Hi there !
I’m very fresh to this TD and coding experience, so I was hoping that somebody might be able to give me a little bit of guidance when it comes to conjuring more rounded code
I have a very basic network of (5 channel) Noise chop on time slice to Chop execute which inputs Select Chop on value change. the idea is very simple: to constantly output a single channel with the largest value into select chop, so I hammered down this simplicity:
n1 = op('noise1') s1 = op('select1') maxVal = max(n1, n1, n1, n1, n1) if n1 == maxVal: s1.par.channames = 'chan1' if n1 == maxVal: s1.par.channames = 'chan2' if n1 == maxVal: s1.par.channames = 'chan3' if n1 == maxVal: s1.par.channames = 'chan4' if n1 == maxVal: s1.par.channames = 'chan5' return
which as it seems to me is working correctly, although probably not very practical and pretty looking, but then I thought- what if i need to compare and output values of like 100 channels, I’m sure there’s a smarter way of going around it than copying and pasting 100 if statements. So after numerous tutorials and peeks at toe examples I couldn’t find anything helpful and gotten myself here, so any help would be really appreciated. Thanks