For starters, I would refactor your setup into just two COMPonents, one that’s the UI controls and one that’s (all) the slides – that way, you’re not duplicating the UI buttons in every slide, and it’s scalable to an arbitrary number of slides (which presumably are single pictures, but don’t actually have to be).
On the slides COMPonent, make some custom parameters, including something like currentslide
. Figure out how to get the slide viewer to display the correct slide based on the currentslide
parameter (without any cross fading yet). This helps isolate issues – is the slide COMPonent displaying the correct slide given its input? Easy to test in isolation here, much harder if deeply wired with CHOPs or somesuch.
Inside the controls COMPonent, you have your previous and next buttons. Maybe you also display the current slide number at the bottom. You can even use KeyboardIn DAT or CHOP to react to the left/right arrow keys. Make some custom parameters on the controls COMPonent as well, in fact, also make a currentslide
parameter.
Figure out how to have the buttons increment, decrement, or reset the currentslide
parameter on the controls COMPonent. Test that to your satisfaction, then on your Slides COMPonent make a parameter reference (op('controls').par.Currentslide
) and confirm that your UI can drive your slide display. BTW, make sure the depth layer
parameter on the Controls COMP is higher than on the Slides COMP.
Now it’s time to figure out how to do transitions. The basics of a transition is that you have two active slides, the current and the next (remember, the next might be slide #1 in the case of a reset, it’s not necessarily the next higher slide number), and a crossfade parameter to control how much of each of the two TOPs is shown; then once the crossfade hits 1.0 the trick is to move the nextslide
number to the currentslide
parameter and reset the crossfade to 0.0 in anticipation of the next crossfade.
Keep in mind that the Slides COMPonent is intentionally fairly “dumb”: you have current slide, next slide, crossfade. The Slides don’t have any mechanism to decide when to transition, but just respond to direction from elsewhere.
Back in the Controls COMPonent, you now get to use a Timer CHOP and/or a trigger CHOP that, when pulsed, run the crossfade parameter from zero to one and then instantly back to zero again. The Timer CHOP is good for this because it can output pulses at the start of a transition and again at the end of it. You can initiate the pulse from the CHOPexec CHOP you have. Again, the goal here is to set and update the custom parameters on the Controls COMPonent until you’re convinced they’re correct. Then simply reference the Controls parameters from the Slides COMPonent’s parameters.
And I’d check out what they did in this slideshow forum discussion