How to get a number from a multisample channel? [SOLVED]

We have RGBA values from a TOP, converted to CHOP, and we have selected only the alpha channel. We need the alpha channel, which is changing from 0 to 8, to be expressed as a changing number rather than a channel. Every time we use the TOPtoCHOP / alpha channel as an input or a reference for another CHOP (such as a constant) the number never moves from zero.

The intended end purpose is to convert the 0 – 8 value of the alpha channel to a 0 – 1 value that can be used to pick a value from a ramp TOP. The network is using the changing number as the first input to a lookup CHOP, and the ramp as the second input. Then using a CHOPtoTOP from the lookup to get the changing colour sample. We’ve tried using a slider COMP instead of the alpha channel as the first input to the lookup, which has worked for sampling the ramp colour. We just can’t figure out how to use the alpha channel rather than the slider.

Can you post your network or send to ivan@derivative.ca? Pretty sure i can help, but not from written description.

1 Like

Got your network Ruby, and I understand the problem… you’re getting a multi-sample channel and want a single value.

I think your solution is to use the analyzeCHOP. You can wire it in after your mathCHOP then get the average value of the samples in that channel, or the maximum, or a number of other analyzed results.

Alternatively, you can get a single sample on a channel with an expression like this: op(‘math1’)[‘a’][#sample number#]. You could put that into a constantCHOP expression. But I suspect the analyzeCHOP will give you the result you’re really wanting…

1 Like

Hi Ivan - thanks so much for this - it works just as you said. Lifesaver!!

1 Like