Queueing GL Line Structure inside Iterator

jersmi's picture

Here I have the GL Line Structure patch Color 1 & 2 behaving as I understand it should.

In this composition I tried the built-in Queue and a Javascript Queue for Input Lines. The output appears the same from both queues, but the JS shows the line connecting end point to start. Why is this? Is there a simpler better method to get start/end color to gradate "properly", as this qtz shows? My trial and error led me to this solution, but I'd like to understand the behavior.

PreviewAttachmentSize
interpolation.qtz16.36 KB

gtoledo3's picture
Re: Queueing GL Line Structure inside Iterator

The queue size should usually be controlled by the Iteration count, or a non-connected number.

The Queue object is responding to the fact that you're using Current Index, and the Queue Size is reacting to the Current Index state, causing this effect. The Javascript's input isn't made to respond to each current index over the course of all the iterations.

One way to handle it, is to use a multiplexer.

"Power" the javascript queue count by a static number/index or the Iteration count. Setup a multiplexer and conditional to flip over from the current chain to a NaN value when it reaches the final iteration value, or when Current Position equals 1, or at the start of the loop, when it equals 0. I think your color multiplexing is doing something somewhat similar to that concept, but using the color to "block out" the strip instead of assigning it a NaN value like I'm suggesting. Either works.

jersmi's picture
Re: Queueing GL Line Structure inside Iterator

Thanks, George. I've used your nan trick before, not sure why I didn't think of it.