Previous topicNext topic

Iterator module syntax

Questions, comments, feedback, etc.
Post Reply
LenB
Posts: 2
Joined: Wed Nov 20, 2019 9:05 pm

Iterator module syntax

Post by LenB »

I'm struggling to get a good understanding of this module, so I am wondering if anyone can help me out. I haven't really managed to get past the manual or completely understand the iterator basic example project.

My understanding so far is that the module creates multiple copies of what is passed to it by the preceding modules. Is that correct?

Where I start to get really lost is when the internal variable iterator# is used as a modifier. What does this variable represent?

In the first scene of the basic example project, there are two iterator modules with different iterations parameter numbers. Am I to assume that there are more than one internal variables called interator#.

Or, does the use of Internal-iterator# instruct the module to iterate whatever it is doing the number of times set in the iterator module? And if there are two such modules, it is the one further downstream that defines the iteration number?

I was going to ask about the global variable iters in other scenes, but I see that is just a created, named and defined constant set to the iteration number and for use in expressions throughout the scene concerned.

However I still have a question about iteration frequency? What is that?

I'm sure this would all be much more transparent if I had something beyond a very basic coding experience ....

Thanks in advance
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: Iterator module syntax

Post by Sadler »

The iterator is one of the few modules that doesn't seem to do much by itself and because there are several aspects to it, it could be tricky to understand.

With an iterator in the circuit, the # is propagated back to all modules that access the internal Iterator or the iterator source. Each module operation will do something to each iteration based upon the iteration #. Let's choose rotation as an example. If the angle is set to use iterations it will rotate each iteration based upon its #. So iteration 1 will be rotated 1.0 turns, 2 will be rotated 2.0 turns and so on. Of course, in this case, each iteration turns a full number of turns and it doesn't look like much has changed. In order to see something more interesting, one now needs to scale the iteration # by, say a 1/4 to have each iteration rotate 90 degrees (a 1/4 turn). This would create some sort of square(ish) design depending on the image source.

The iterator frequency splits the audio frequencies by the iteration count. So 16 iterations would provide 16 bands of the audio spectrum. I don't know how the value is calculated but guess that it is averaged for each band. A module parameter can now use that frequency band to attenuate its value. Each of the 16 iterations receiving a different band.

It is best to start experimenting with one iterator module - its quite powerful on its own. If you haven't seen it already there's a good thread on here of what's possible: https://magicmusicvisuals.com/forums/vi ... ator#p8805
LenB
Posts: 2
Joined: Wed Nov 20, 2019 9:05 pm

Re: Iterator module syntax

Post by LenB »

Thanks for taking the time to respond. This is really helpful. As you suggested, I am also learning from messing about with it and the relevant settings.

At the moment I conceptualise it as a stack of magic pathways. Each iteration adds another layer, modified from the previous one as specified in the modifier expressions.

What is more I suspect that time is involved somewhere, as I can see some of the numbers in modules flickering even at rest. perhaps I am correct that each new iteration is produced in a cycle of the code, although what implications this would have I haven't yet worked out.

I haven't got my head round what iterator freq means exactly - I think I need to dig deeper into the more complicated examples.

Perhaps when I really understand it, I'll be able to work out how all those applications were actually constructed, in that thread you linked to. :)
Post Reply