Setting Limits of a Counter Node to the Spread Count of a IOBOX

Basically, I have a spread of Strings, file directories specifically, and I scroll through the files using getslice(strings) & a counter(animation). I have a spread which has 12 slices, this is so that I can add as many or as few files as I want (up to 12, which is about the most I’d need at this stage).

What I want to do though is make it so if I have added four file directories, for example, then as I am scrolling through the files it either stops at the fourth one or it loops back over to the first one again. I want this to be automatic so that all I have to do for set up is put in the directories I want to use rather than needing to specify it seperately. I’ve tried a “if string = empty then reset counter” but it wont let me connect to the counter.

Any thoughts?

Do you have an example patch? I don’t understand fully what you want to achieve. I guess you want to build a logical loop - so you have to use the Frame Delay node to reconnect to the counter node. But I would avoid the Frame Delay node as long as you can. So maybe you can only select slices which are set by the user and cycle these slices. To select these slices you can use the = and select node.

Also, I would reset the counter node by using the change + or spectral node to look if your spread has changed.

To stop the counter at the last Slice you can set the max count with the Count node, and set the count mode to Clamp.

In the patch are 2 other examples - I hope one solution will fit.

SelectFolder.v4p (42.7 KB)

1 Like

you can just set the counter to unlimited mode, then the spread will wrap around all by itself

If you set the counter to unlimited, without prefiltering the slices, it will also show the “empty” slices - assuming you are using an io box with a spread size of 12. But if you can avoid an io box with “hard coded” slice count, sunep described the easiest way. Also, these io boxes are sometimes a little bit confusing, as they are cutting spreads in a way that is not visible at first sight.

Thanks alot! So I got it working with frame delay, any particular reason why I should avoid using it for as long as possible?

hey newrendition, please share your solution so we can comment on it.

So Box 1 is the files, just one at the moment. The counter up and down is connected to two bangs. The reader enable is connected to a toggle. The split goes into Box 2 where the individual video files addresses are listed.

When the slice is empty the counter is reset, making it loop back around to the first file again.

Ooops, ignore that switch its in there from an old build

the framedelay is not needed here. there are different ways of doing it without, here is one that should be quite self-explanatory:

let us know if you have any further questions

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.