» MainLoop (VVVV)
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

MainLoop (VVVV)

Help Configure the mainloop
Author vvvv group

Here you are supposed to see an image (rendered with SVG) describing the pins of this node. However, this does not work with Internet Explorer. You may want to consider using another browser, like FireFox, Chrome, Safari or Opera that do support SVG.

Credits
Warnings
Bugs

related discussions

start a forum thread about this node

about MainLoop (VVVV)

The mainloop defines, how fast vvvv can run. By default it runs as fast as possible with a maximum of 120 in foreground and 30 in background, which means that vvvv is sometimes a little faster and sometimes much slower, even if it tries to run at a constant framerate.

The mainloop does not only affect drawing issues, but the whole application including the GUI.
Try to set the Foreground FPS to a very low value (1 or 2), create some nodes and connect them. Notice how long it takes until things happen.

MainLoop is the way to control the speed of operations and flow.

The time modes are:

  • Raw: vvvv requests the time from the high resolution counter of your mainboard and uses this value directly for all nodes. as it is on the windows scheduling architecture not sure when this will happen, the time intervals from frame to frame can vary a lot. this is not very good, because the graphics card renders in a very precise interval.
  • Filtered (default): same like Raw, but the time values are smoothed by a slow filter to have more constant time intervals for better animation quality. as the filter is really slow, you shouldn't use this mode, if the framerate of your patch has to change often by large amounts.
  • Increment: the time is incremented every frame by a constamt value set on the MainLoop node no matter how fast vvvv runs in reality.

The Increase Timinig Precision config-pin is on by default. While causing a smoother framerate in many cases it also causes higher CPU-needs in all cases. You'll have to find find out for your case if you want to change this setting. Here is a good read on the topic Windows Timer Resolution Megawatts wasted.

This node is a singleton

FAQ

MainLoop - What does MainLoop do? Setting this value to 400, means that that the whole graphics will be calculated 400 times a second?

With the mainloop node you only can slow down vvvv. If the fastest possible speed to do your rendering is lets say 180 fps then there is no possibility to do the same calculations faster. VVVV will happily use 100% of your CPU when trying. With mainloop you can slow it down to allow other programs on your computer to run.

  • foreground fps: maximum fps of vvvv as active application (vvvv has focus)
  • background fps: maximum fps of vvvv when running in background (other applications have focus)

Note that if you have a Renderer (DX9) and the Sync-Mode of the renderer is not "immediate present" then it's not possible to run faster then screen refresh rate of your monitor.

If there is no mainloop node, vvvv defaults to 120fps in foreground mode. if you want to increase that you have to add aMainLoop and set this to a higher value.

For now we had to block setting the mainloop to values 0 because since the gui also depends on the mainloop it would not be possible to reset the value to something else after having it set to 0 once. ahm..this is by design (flaw). You may encounter a gist of that problem when setting the mainloop to some lower values.

What is this AsyncThreadPriority pin for?

It was for experimenting with the process of loading textures or xfiles in background. But probably we will remove that pin again.

anonymous user login

Shoutbox

~6d ago

joreg: vvvvTv S02E00 is out: Sensors & Servos with Arduino: https://visualprogramming.net/blog/2024/vvvvtv-is-back-with-season-2/

~7d ago

fleg: hey there! What's the best tool for remote work? Teamviewer feels terrible. Thanks!

~20d ago

joreg: Last call: 6-session vvvv beginner course starting November 4: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-part-i/

~1mth ago

joreg: Missed the last meetup? You can rewatch it here: https://www.youtube.com/live/MdvTa58uxB0?si=Fwi-9hHoCmo794Ag

~1mth ago

theurbankind: When is the next big event, like node festival ?

~1mth ago

~1mth ago

joreg: Join us for the next vvvv meetup on Oktober 17th: https://visualprogramming.net/blog/2024/25.-vvvv-worldwide-meetup/

~1mth ago

joreg: 6 session beginner course part 2 "Deep Dive" starts January 13th: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-part-ii/

~1mth ago

joreg: 6 session beginner course part 1 "Playground" starts November 4th: https://thenodeinstitute.org/courses/ws24-5-vvvv-beginners-part-i/